From 96d2c57952b22ed69819426224247cff6e955056 Mon Sep 17 00:00:00 2001 From: Lachlan Glen <54282009+lachlanglen@users.noreply.github.com> Date: Tue, 7 Nov 2023 16:20:09 -0500 Subject: [PATCH] update team members styling on create form --- apps/potlock/widget/Index.jsx | 25 ++++++++++++++++------ apps/potlock/widget/Project/CreateForm.jsx | 2 +- build/potlock/src/Index.jsx | 25 ++++++++++++++++------ build/potlock/src/Project/CreateForm.jsx | 2 +- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/apps/potlock/widget/Index.jsx b/apps/potlock/widget/Index.jsx index 79d4aac3..f4898174 100644 --- a/apps/potlock/widget/Index.jsx +++ b/apps/potlock/widget/Index.jsx @@ -45,22 +45,35 @@ const Theme = styled.div` State.init({ cart: null, - nearToUsd: null, + // nearToUsd: null, + nearToUsd: useCache( + () => + asyncFetch("https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd").then( + (res) => { + console.log("congecko res body: ", res.body); + return res.body.near.usd; + } + ), + "nearToUsd", + { subscribe: false } + ), isCartModalOpen: false, registryAdmins: null, }); -if (state.nearToUsd === null) { - const res = fetch("https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd"); - console.log("coingecko res: ", res); - State.update({ nearToUsd: res.body.near.usd }); -} +// if (state.nearToUsd === null) { +// const res = fetch("https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd"); +// console.log("coingecko res: ", res); +// State.update({ nearToUsd: res.body.near.usd }); +// } if (state.registryAdmins === null) { const registryAdmins = Near.view(registryContractId, "get_admins", {}); State.update({ registryAdmins }); } +console.log("state: ", state); + const tabContentWidget = { [CREATE_PROJECT_TAB]: "Project.Create", [EDIT_PROJECT_TAB]: "Project.Create", diff --git a/apps/potlock/widget/Project/CreateForm.jsx b/apps/potlock/widget/Project/CreateForm.jsx index 72786821..e7aad7d3 100644 --- a/apps/potlock/widget/Project/CreateForm.jsx +++ b/apps/potlock/widget/Project/CreateForm.jsx @@ -46,7 +46,7 @@ const Container = styled.div` const LowerBannerContainer = styled.div` position: absolute; - bottom: -210px; + bottom: -250px; left: 0px; display: flex; align-items: stretch; /* Ensuring child elements stretch to full height */ diff --git a/build/potlock/src/Index.jsx b/build/potlock/src/Index.jsx index 79d4aac3..f4898174 100644 --- a/build/potlock/src/Index.jsx +++ b/build/potlock/src/Index.jsx @@ -45,22 +45,35 @@ const Theme = styled.div` State.init({ cart: null, - nearToUsd: null, + // nearToUsd: null, + nearToUsd: useCache( + () => + asyncFetch("https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd").then( + (res) => { + console.log("congecko res body: ", res.body); + return res.body.near.usd; + } + ), + "nearToUsd", + { subscribe: false } + ), isCartModalOpen: false, registryAdmins: null, }); -if (state.nearToUsd === null) { - const res = fetch("https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd"); - console.log("coingecko res: ", res); - State.update({ nearToUsd: res.body.near.usd }); -} +// if (state.nearToUsd === null) { +// const res = fetch("https://api.coingecko.com/api/v3/simple/price?ids=near&vs_currencies=usd"); +// console.log("coingecko res: ", res); +// State.update({ nearToUsd: res.body.near.usd }); +// } if (state.registryAdmins === null) { const registryAdmins = Near.view(registryContractId, "get_admins", {}); State.update({ registryAdmins }); } +console.log("state: ", state); + const tabContentWidget = { [CREATE_PROJECT_TAB]: "Project.Create", [EDIT_PROJECT_TAB]: "Project.Create", diff --git a/build/potlock/src/Project/CreateForm.jsx b/build/potlock/src/Project/CreateForm.jsx index 72786821..e7aad7d3 100644 --- a/build/potlock/src/Project/CreateForm.jsx +++ b/build/potlock/src/Project/CreateForm.jsx @@ -46,7 +46,7 @@ const Container = styled.div` const LowerBannerContainer = styled.div` position: absolute; - bottom: -210px; + bottom: -250px; left: 0px; display: flex; align-items: stretch; /* Ensuring child elements stretch to full height */