Skip to content

Commit

Permalink
Merge pull request #25 from GenaDrop/drops-fix
Browse files Browse the repository at this point in the history
fix: made contest changes
  • Loading branch information
Ebube111 authored Dec 14, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Czaki Grzegorz Bokota
2 parents 111c015 + 2deb3c3 commit 7cde56c
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
@@ -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,
}}
/>
))}
6 changes: 5 additions & 1 deletion apps/BosGenaDrop/widget/CPlanet/Index.jsx
Original file line number Diff line number Diff line change
@@ -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 = (
4 changes: 2 additions & 2 deletions apps/BosGenaDrop/widget/CPlanet/Navbar/Index.jsx
Original file line number Diff line number Diff line change
@@ -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
@@ -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
11 changes: 6 additions & 5 deletions build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Index.jsx
Original file line number Diff line number Diff line change
@@ -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,
}}
/>
))}
2 changes: 1 addition & 1 deletion build/BosGenaDrop/src/CPlanet/DropsFund/Explore/Card.jsx
Original file line number Diff line number Diff line change
@@ -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"
>
7 changes: 3 additions & 4 deletions build/BosGenaDrop/src/CPlanet/Index.jsx
Original file line number Diff line number Diff line change
@@ -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,
4 changes: 2 additions & 2 deletions build/BosGenaDrop/src/CPlanet/Navbar/Index.jsx
Original file line number Diff line number Diff line change
@@ -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
@@ -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

0 comments on commit 7cde56c

Please sign in to comment.