Skip to content

Commit

Permalink
fix: updated contest navbar and made other changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebube111 committed Dec 14, 2023
1 parent 965f971 commit 2deb3c3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
2 changes: 2 additions & 0 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const ExploreRoot = styled.div`

const ExploreContainer = styled.div`
background: #f8f8f8;
padding: 20px;
.searchContainer {
display: flex;
margin-top: 32px;
Expand Down Expand Up @@ -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,
}}
/>
))}
Expand Down
6 changes: 5 additions & 1 deletion apps/BosGenaDrop/widget/CPlanet/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const availableTabs = [
"community",
"feed",
"daoProfile",
"dropFunds",
"singleContest",
];

const getTab = (tab) => {
Expand All @@ -34,6 +36,7 @@ State.init({
tokenId: "",
chainState: "",
state: "",
contestId: "",
daoId: "",
daoContractId: "",
});
Expand All @@ -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 = (
Expand Down
4 changes: 2 additions & 2 deletions apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ return (
Feeds
</a>
<a
href={`#/bos.genadrop.near/widget/CPlanet.DropsFund.Explore.Index?tab=dropFunds`}
href={`#/bos.genadrop.near/widget/CPlanet.Index?tab=dropFunds`}
onClick={() => tabToggleHanler("dropFunds")}
>
Drop Funds
Expand Down Expand Up @@ -387,7 +387,7 @@ return (
Feeds
</a>
<a
href={`#/bos.genadrop.near/widget/CPlanet.DropsFund.Explore.Index?tab=dropFunds`}
href={`#/bos.genadrop.near/widget/CPlanet.Index?tab=dropFunds`}
onClick={() => tabToggleHanler("dropFunds")}
>
Drop Funds
Expand Down
11 changes: 6 additions & 5 deletions build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const ExploreRoot = styled.div`

const ExploreContainer = styled.div`
background: #f8f8f8;
padding: 20px;
.searchContainer {
display: flex;
margin-top: 32px;
Expand All @@ -63,7 +64,7 @@ const Search = styled.div`
`;

const Filter = styled.div`
display: flex;'
display: flex;
height: 48px;
padding: 12px 24px;
align-items: center;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
}}
/>
))}
Expand Down
2 changes: 1 addition & 1 deletion build/BosGenaDrop/src/CPlanet/DropsFund/Explore/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ return (
</div>
</div>
<a
onClick={() => 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"
>
Expand Down
7 changes: 3 additions & 4 deletions build/BosGenaDrop/src/CPlanet/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const availableTabs = [
"feed",
"daoProfile",
"dropFunds",
"singleContests",
"singleContest",
];

const getTab = (tab) => {
Expand All @@ -36,8 +36,8 @@ State.init({
tokenId: "",
chainState: "",
state: "",
daoId: "",
contestId: "",
daoId: "",
daoContractId: "",
});

Expand All @@ -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 = (
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ return (
Feeds
</a>
<a
href={`#/bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Index?tab=dropFunds`}
href={`#/bos.genadrop.near/widget/CPlanet.Index?tab=dropFunds`}
onClick={() => tabToggleHanler("dropFunds")}
>
Drop Funds
Expand Down Expand Up @@ -387,7 +387,7 @@ return (
Feeds
</a>
<a
href={`#/bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Index?tab=dropFunds`}
href={`#/bos.genadrop.near/widget/CPlanet.Index?tab=dropFunds`}
onClick={() => tabToggleHanler("dropFunds")}
>
Drop Funds
Expand Down

0 comments on commit 2deb3c3

Please sign in to comment.