From 2deb3c370e936a62f030c45f28444d123e8b91fe Mon Sep 17 00:00:00 2001 From: Ebube Agwaze Date: Thu, 14 Dec 2023 20:13:12 +0100 Subject: [PATCH] fix: updated contest navbar and made other changes --- .../widget/CPlanet/DropsFund/Contest/Index.jsx | 2 ++ apps/BosGenaDrop/widget/CPlanet/Index.jsx | 6 +++++- apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx | 4 ++-- .../src/CPlanet/DropsFund/Contest/Index.jsx | 11 ++++++----- .../src/CPlanet/DropsFund/Explore/Card.jsx | 2 +- build/BosGenaDrop/src/CPlanet/Index.jsx | 7 +++---- build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx | 4 ++-- 7 files changed, 21 insertions(+), 15 deletions(-) diff --git a/apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Index.jsx b/apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Index.jsx index ccaf8173..127564d6 100644 --- a/apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Index.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Index.jsx @@ -37,6 +37,7 @@ const ExploreRoot = styled.div` const ExploreContainer = styled.div` background: #f8f8f8; + padding: 20px; .searchContainer { display: flex; margin-top: 32px; @@ -208,6 +209,7 @@ return ( isSubmissionOpen: isFutureTimestamp(data[1]?.submission_end_time), isVotingEnded: isFutureTimestamp(data[1]?.voting_end_time), id: data[0], + update: props.update, }} /> ))} diff --git a/apps/BosGenaDrop/widget/CPlanet/Index.jsx b/apps/BosGenaDrop/widget/CPlanet/Index.jsx index 3fc34af8..5c10b56b 100644 --- a/apps/BosGenaDrop/widget/CPlanet/Index.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/Index.jsx @@ -18,6 +18,8 @@ const availableTabs = [ "community", "feed", "daoProfile", + "dropFunds", + "singleContest", ]; const getTab = (tab) => { @@ -34,6 +36,7 @@ State.init({ tokenId: "", chainState: "", state: "", + contestId: "", daoId: "", daoContractId: "", }); @@ -48,7 +51,8 @@ const tabContentWidget = { daoProfile: "bos.genadrop.near/widget/CPlanet.DAO.Index", feed: "bos.genadrop.near/widget/CPlanet.MainPage.Social", profile: "bos.genadrop/widget/GenaDrop.Profile.Main", - dropFunds: "bos.genadrop.near/widget/CPlanet.DropsFund.Explore.Index", + dropFunds: "bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Index", + singleContest: "bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Single", }[state.tab]; const tabContent = ( diff --git a/apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx b/apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx index 9c18e44a..4327f460 100644 --- a/apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx +++ b/apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx @@ -282,7 +282,7 @@ return ( Feeds tabToggleHanler("dropFunds")} > Drop Funds @@ -387,7 +387,7 @@ return ( Feeds tabToggleHanler("dropFunds")} > Drop Funds diff --git a/build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Index.jsx b/build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Index.jsx index 04e74f91..127564d6 100644 --- a/build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Index.jsx +++ b/build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Index.jsx @@ -37,6 +37,7 @@ const ExploreRoot = styled.div` const ExploreContainer = styled.div` background: #f8f8f8; + padding: 20px; .searchContainer { display: flex; margin-top: 32px; @@ -63,7 +64,7 @@ const Search = styled.div` `; const Filter = styled.div` - display: flex;' + display: flex; height: 48px; padding: 12px 24px; align-items: center; @@ -130,10 +131,9 @@ const isFutureTimestamp = (timestamp) => { return isFuture; }; -const fetchedContests = - Near.view("fund-v1.genadrop.near", "get_contests", { - subscribe: true, - }) ?? []; +const fetchedContests = Near.view("fund-v1.genadrop.near", "get_contests", { + subscribe: true, +}); const [activeTab, setActiveTab] = useState("ALL"); const [contest, setContest] = useState(fetchedContests); @@ -209,6 +209,7 @@ return ( isSubmissionOpen: isFutureTimestamp(data[1]?.submission_end_time), isVotingEnded: isFutureTimestamp(data[1]?.voting_end_time), id: data[0], + update: props.update, }} /> ))} diff --git a/build/BosGenaDrop/src/CPlanet/DropsFund/Explore/Card.jsx b/build/BosGenaDrop/src/CPlanet/DropsFund/Explore/Card.jsx index fda932da..0bea15d3 100644 --- a/build/BosGenaDrop/src/CPlanet/DropsFund/Explore/Card.jsx +++ b/build/BosGenaDrop/src/CPlanet/DropsFund/Explore/Card.jsx @@ -258,7 +258,7 @@ return ( props.update({ tab: "single", contestId: props.id })} + onClick={() => props.update({ tab: "contest" })} href={`#/bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Single?contestId=${props.id}`} className="card-button" > diff --git a/build/BosGenaDrop/src/CPlanet/Index.jsx b/build/BosGenaDrop/src/CPlanet/Index.jsx index a22c8f51..5c10b56b 100644 --- a/build/BosGenaDrop/src/CPlanet/Index.jsx +++ b/build/BosGenaDrop/src/CPlanet/Index.jsx @@ -19,7 +19,7 @@ const availableTabs = [ "feed", "daoProfile", "dropFunds", - "singleContests", + "singleContest", ]; const getTab = (tab) => { @@ -36,8 +36,8 @@ State.init({ tokenId: "", chainState: "", state: "", - daoId: "", contestId: "", + daoId: "", daoContractId: "", }); @@ -51,8 +51,8 @@ const tabContentWidget = { daoProfile: "bos.genadrop.near/widget/CPlanet.DAO.Index", feed: "bos.genadrop.near/widget/CPlanet.MainPage.Social", profile: "bos.genadrop/widget/GenaDrop.Profile.Main", - singleContest: "bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Single", dropFunds: "bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Index", + singleContest: "bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Single", }[state.tab]; const tabContent = ( @@ -64,7 +64,6 @@ const tabContent = ( tokenId: state.tokenId, accountId: state.accountId, chainState: state.chainState, - contestId: state.contestId, daoId: state.daoId, isGateway: props.isGateway, daoContractId: state.daoContractId, diff --git a/build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx b/build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx index f8106a99..4327f460 100644 --- a/build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx +++ b/build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx @@ -282,7 +282,7 @@ return ( Feeds tabToggleHanler("dropFunds")} > Drop Funds @@ -387,7 +387,7 @@ return ( Feeds tabToggleHanler("dropFunds")} > Drop Funds