Skip to content

Commit

Permalink
Merge pull request #55 from GenaDrop/stagging
Browse files Browse the repository at this point in the history
Stagging to main
  • Loading branch information
Ebube111 authored Jan 2, 2024
2 parents 1edbaed + aae0b29 commit a6c03af
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 28 deletions.
13 changes: 7 additions & 6 deletions apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,6 @@ const NotDAO = styled.div`
`

const profile = Social.get(`${daoId}/profile/**`, "final");
console.log(profile)
if(!profile) {
return (
<NotDAO className="">This is Not a Valid DAO</NotDAO>
)
}


const accounts = [daoId];
Expand All @@ -295,6 +289,13 @@ policy &&
members = [...new Set(members)];
// --

if(!members.length) {
return (
<NotDAO className="">This is Not a Valid DAO</NotDAO>
)
}


function makeAccountIdShorter(accountId) {
if (accountId.length > shortenLength) {
return accountId.slice(0, shortenLength) + "...";
Expand Down
19 changes: 15 additions & 4 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const Root = styled.div`
flex-wrap: wrap;
height: 100%;
}
.cardContent {
width: 70%;
@media (max-width: 500px) {
width: 100%;
}
}
`;

const Image = styled.div`
Expand Down Expand Up @@ -139,7 +145,7 @@ const CardBody = styled.div`
}
@media (max-width: 500px) {
.desc {
min-width: 100%;
min-width: inherit;
}
}
`;
Expand Down Expand Up @@ -240,7 +246,7 @@ const StartedButton = styled.div`
border-radius: 32px;
text-transform: uppercase;
font-family: Helvetica Neue;
margin-bottom: 40px;
margin-bottom: 10px;
}
.disabled:hover {
background: none;
Expand Down Expand Up @@ -363,7 +369,6 @@ function makeDescriptionShorter(desc) {
}



return (
<Root
selected={
Expand Down Expand Up @@ -431,7 +436,13 @@ return (
{props.isOpen ? "Not Started" : "Contest Ended"}
</button>
)}
<button className="proposal">VIEW PROPOSAL</button>
{
props.isClosed && props?.councilMember && (
<a href={`https://app.astrodao.com/dao/${props.daoId}/proposals`} target="_blank">
<button className="proposal">CREATE PROPOSAL</button>
</a>
)
}
{props?.owner !== nftData?.owner ? (
<div className="bannedUser">
{redFlag}
Expand Down
5 changes: 5 additions & 0 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const searchInputHandler = (e) => {
setFilteredValue(searched)
};

const isUserInCouncil = props?.councilMembers?.includes(context?.accountId)

return (
<>
Expand All @@ -145,6 +146,8 @@ return (
owner: data[0],
content: data[1],
isOpen: props.isOpen,
daoId: props.daoId,
councilMember: isUserInCouncil,
winners: props.winners,
isClosed: props.isClosed,
contestId: props.contestId,
Expand All @@ -159,6 +162,8 @@ return (
content: data[1],
isOpen: props.isOpen,
winners: props.winners,
daoId: props.daoId,
councilMember: isUserInCouncil,
isClosed: props.isClosed,
contestId: props.contestId,
}}
Expand Down
16 changes: 12 additions & 4 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Single.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ const contest = Near.view("fund-v2.genadrop.near", "get_contest_detail", {
subscribe: true,
});

console.log(contest)

const contestArts = Near.view("fund-v2.genadrop.near", "get_contest_arts", {
contest_id: Number(contestId),
Expand Down Expand Up @@ -301,6 +300,13 @@ const getUsdValue = (price) => {
}
};

const policy = Near.view(contest?.dao_id, "get_policy");
const councilMembers = policy &&
policy?.roles?.filter(
(data) => data?.name === "council" || data?.name === "Council"
)[0]?.kind?.Group;



return (
<Container>
Expand Down Expand Up @@ -350,14 +356,14 @@ return (
</div>
</div>
<div className="amountSec">
<span>Prize per winner</span>
<span>Prize per Place</span>
<div className="amount">
<img
src="https://ipfs.near.social/ipfs/bafkreierjvmroeb6tnfu3ckrfmet7wpx7k3ubjnc6gcdzauwqkxobnu57e"
alt=""
/>
<p className="first-span">1000</p>
<span className="last-span">$1686.01</span>
<p className="first-span">{contest?.places ? contest?.prize / contest.places ?? 0 : 0}</p>
<span className="last-span">{getUsdValue(contest?.places ? contest?.prize / contest.places ?? 0: 0)}</span>
</div>
</div>
<div className="amountSec">
Expand Down Expand Up @@ -394,7 +400,9 @@ return (
usersArts: contestArts,
isOpen,
winners: contest.winners,
daoId: contest.dao_id,
isClosed,
councilMembers: councilMembers,
userSubmitted,
contestId,
}}
Expand Down
13 changes: 7 additions & 6 deletions build/BosGenaDrop/src/CPlanet/DAO/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,6 @@ const NotDAO = styled.div`
`

const profile = Social.get(`${daoId}/profile/**`, "final");
console.log(profile)
if(!profile) {
return (
<NotDAO className="">This is Not a Valid DAO</NotDAO>
)
}


const accounts = [daoId];
Expand All @@ -295,6 +289,13 @@ policy &&
members = [...new Set(members)];
// --

if(!members.length) {
return (
<NotDAO className="">This is Not a Valid DAO</NotDAO>
)
}


function makeAccountIdShorter(accountId) {
if (accountId.length > shortenLength) {
return accountId.slice(0, shortenLength) + "...";
Expand Down
19 changes: 15 additions & 4 deletions build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const Root = styled.div`
flex-wrap: wrap;
height: 100%;
}
.cardContent {
width: 70%;
@media (max-width: 500px) {
width: 100%;
}
}
`;

const Image = styled.div`
Expand Down Expand Up @@ -139,7 +145,7 @@ const CardBody = styled.div`
}
@media (max-width: 500px) {
.desc {
min-width: 100%;
min-width: inherit;
}
}
`;
Expand Down Expand Up @@ -240,7 +246,7 @@ const StartedButton = styled.div`
border-radius: 32px;
text-transform: uppercase;
font-family: Helvetica Neue;
margin-bottom: 40px;
margin-bottom: 10px;
}
.disabled:hover {
background: none;
Expand Down Expand Up @@ -363,7 +369,6 @@ function makeDescriptionShorter(desc) {
}



return (
<Root
selected={
Expand Down Expand Up @@ -431,7 +436,13 @@ return (
{props.isOpen ? "Not Started" : "Contest Ended"}
</button>
)}
<button className="proposal">VIEW PROPOSAL</button>
{
props.isClosed && props?.councilMember && (
<a href={`https://app.astrodao.com/dao/${props.daoId}/proposals`} target="_blank">
<button className="proposal">CREATE PROPOSAL</button>
</a>
)
}
{props?.owner !== nftData?.owner ? (
<div className="bannedUser">
{redFlag}
Expand Down
5 changes: 5 additions & 0 deletions build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const searchInputHandler = (e) => {
setFilteredValue(searched)
};

const isUserInCouncil = props?.councilMembers?.includes(context?.accountId)

return (
<>
Expand All @@ -145,6 +146,8 @@ return (
owner: data[0],
content: data[1],
isOpen: props.isOpen,
daoId: props.daoId,
councilMember: isUserInCouncil,
winners: props.winners,
isClosed: props.isClosed,
contestId: props.contestId,
Expand All @@ -159,6 +162,8 @@ return (
content: data[1],
isOpen: props.isOpen,
winners: props.winners,
daoId: props.daoId,
councilMember: isUserInCouncil,
isClosed: props.isClosed,
contestId: props.contestId,
}}
Expand Down
16 changes: 12 additions & 4 deletions build/BosGenaDrop/src/CPlanet/DropsFund/Contest/Single.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ const contest = Near.view("fund-v2.genadrop.near", "get_contest_detail", {
subscribe: true,
});

console.log(contest)

const contestArts = Near.view("fund-v2.genadrop.near", "get_contest_arts", {
contest_id: Number(contestId),
Expand Down Expand Up @@ -301,6 +300,13 @@ const getUsdValue = (price) => {
}
};

const policy = Near.view(contest?.dao_id, "get_policy");
const councilMembers = policy &&
policy?.roles?.filter(
(data) => data?.name === "council" || data?.name === "Council"
)[0]?.kind?.Group;



return (
<Container>
Expand Down Expand Up @@ -350,14 +356,14 @@ return (
</div>
</div>
<div className="amountSec">
<span>Prize per winner</span>
<span>Prize per Place</span>
<div className="amount">
<img
src="https://ipfs.near.social/ipfs/bafkreierjvmroeb6tnfu3ckrfmet7wpx7k3ubjnc6gcdzauwqkxobnu57e"
alt=""
/>
<p className="first-span">1000</p>
<span className="last-span">$1686.01</span>
<p className="first-span">{contest?.places ? contest?.prize / contest.places ?? 0 : 0}</p>
<span className="last-span">{getUsdValue(contest?.places ? contest?.prize / contest.places ?? 0: 0)}</span>
</div>
</div>
<div className="amountSec">
Expand Down Expand Up @@ -394,7 +400,9 @@ return (
usersArts: contestArts,
isOpen,
winners: contest.winners,
daoId: contest.dao_id,
isClosed,
councilMembers: councilMembers,
userSubmitted,
contestId,
}}
Expand Down

0 comments on commit a6c03af

Please sign in to comment.