Skip to content

Commit

Permalink
Merge pull request #83 from GenaDrop/stagging
Browse files Browse the repository at this point in the history
Stagging to main
  • Loading branch information
Ebube111 authored Jan 16, 2024
2 parents 99dc294 + 07446c5 commit 181e369
Show file tree
Hide file tree
Showing 13 changed files with 1,437 additions and 565 deletions.
27 changes: 24 additions & 3 deletions apps/BosGenaDrop/widget/CPlanet/DAO/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const RightProfile = styled.div`
width: 250px;
width: 315px;
padding: 0 20px;
.title {
color: #000;
font-family: Helvetica Neue;
Expand All @@ -55,7 +56,7 @@ const RightProfile = styled.div`
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 148%; /* 23.68px */
line-height: 148%;
}
.description {
color: #000;
Expand All @@ -64,7 +65,7 @@ const RightProfile = styled.div`
font-style: normal;
margin-top: 7px;
font-weight: 400;
line-height: 148%; /* 23.68px */
line-height: 148%;
}
.buttons {
.follow {
Expand Down Expand Up @@ -97,6 +98,14 @@ const RightProfile = styled.div`
}
}
@media(max-width: 900px) {
width: 100%;
margin-bottom: 40px;
margin-left: 15px;
.title {
font-size: 20px;
}
}
`;

const AmountSec = styled.div`
Expand Down Expand Up @@ -212,11 +221,14 @@ const Tabs = styled.div`
background: #f8f9fa;
border-top: 1px solid #eceef0;
margin: 0 -12px 26px;
> * {
flex: 1;
}
}
@media (max-width: 800px) {
width: 100% !important;
overflow: scroll;
}
`;

const TabsButton = styled.a`
Expand Down Expand Up @@ -249,6 +261,9 @@ const TabsButton = styled.a`
height: 3px;
background: black;
}
@media (max-width: 800px) {
font-size: 12px;
}
`;

State.init({
Expand All @@ -266,10 +281,16 @@ const Contents = styled.div`
margin-left: auto;
align-items: flex-start;
max-width: 1400px;
@media (max-width: 900px) {
flex-direction: column;
}
`;

const MiddleContent = styled.div`
width: 900px;
@media (max-width: 900px) {
width: 100%;
}
`;

const MembersGroup = styled.div`
Expand Down
3 changes: 3 additions & 0 deletions apps/BosGenaDrop/widget/CPlanet/DAO/Members/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ const Root = styled.div`
align-items center;
flex-wrap: wrap;
gap: 30px;
@media (max-width: 800px) {
justify-content: center;
}
`;

return (
Expand Down
15 changes: 8 additions & 7 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ const [isAccountConnected, setIsAccountConnected] = useState(!context.accountId)
const [winnerProposalId, setWinnerProposalId] = useState(null)
const [openModal, setOpenModal] = useState(false)
const [nftData, setNftData] = useState({})
const [isProposalPending, setIsProposalPending] = useState(false);

const formatTime = (time) => {
const timestamp = time * 1000; // Convert seconds to milliseconds
Expand Down Expand Up @@ -498,13 +499,14 @@ const amountInYocto = Big(winnerDetails?.amount ?? 0)
const lastProposalId = Near.view(props?.daoId, "get_last_proposal_id", {subscribe: true})

function handleCreateProposal() {
Near.call([
Near.call([
{
contractName: props.daoId,
methodName: "add_proposal",
args: {
proposal: {
description: state.description ?? "Transfer proposal",
description: state.description ?? `Transfer proposal for ${props?.owner}, who has secured ${winnerDetails?.amount} as one of the winners of the ${props?.contestName}.`
,
kind: {
Transfer: {
token_id: "",
Expand All @@ -527,8 +529,7 @@ function handleCreateProposal() {
},
gas: "300000000000000",
}
]);

])
}

const notOwner = props?.owner !== nftData?.owner
Expand Down Expand Up @@ -597,19 +598,19 @@ return (
</button>
</OverlayTrigger>
) : props.winners?.some((data) => data === props.owner) ? (
<button className="won">
<p className="won">
<img
src="https://ipfs.near.social/ipfs/bafkreiawfm4tx4xxmqyzify4lmp45mfbqqxn4jkfwqdkg3zzkvlek5fjoi"
alt=""
/>
{winnerDetails?.amount} Won
</button>
</p>
) : (
<button className="disabled">
{props.isOpen ? "Not Started" : "Contest Ended"}
</button>
)}
{
{isProposalPending ?<button className="proposal">CREATING PROPOSAL...</button> :
props.isClosed && props?.councilMember && !winnerDetails?.proposal_id && winnerDetails && (
<>
<button onClick={handleCreateProposal} className="proposal">CREATE PROPOSAL</button>
Expand Down
6 changes: 4 additions & 2 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ return (
<Input value={searchValue} placeholder="Search Submitted Arts" onChange={searchInputHandler} />
{searchSvg}
</Search>
<Filter>
{/* <Filter>
<span>Filter</span>
<img src="https://ipfs.near.social/ipfs/bafkreieqdxxr3fxbtsew2tnzi3m5kixh5s55oyn6ylkw4ozfiroegyc7ui" />
</Filter>
</Filter> */}
</Root>
<Cards>
{searchValue === '' ? userArts?.map((data, index) => (
Expand All @@ -147,6 +147,7 @@ return (
isOpen: props.isOpen,
daoId: props.daoId,
councilMember: isUserInCouncil,
contestName: props?.contestName,
winners: props.winners,
isClosed: props.isClosed,
contestId: props.contestId,
Expand All @@ -162,6 +163,7 @@ return (
isOpen: props.isOpen,
winners: props.winners,
daoId: props.daoId,
contestName: props?.contestName,
councilMember: isUserInCouncil,
isClosed: props.isClosed,
contestId: props.contestId,
Expand Down
3 changes: 2 additions & 1 deletion apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Single.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ return (
{formatTime(contest?.submission_start_time)} -{" "}
{formatTime(contest?.voting_end_time)}
</span>
<h1>{contest.title ?? "Lorem Ipsum Contest"}</h1>
<h1>{contest.title ?? "No Title"}</h1>
</div>
<Status>
<p className={isClosed ? "closed" : "submission"}>
Expand Down Expand Up @@ -398,6 +398,7 @@ return (
props={{
usersArts: contestArts,
isOpen,
contestName: contest?.title,
winners: contest.winners,
daoId: contest.dao_id,
isClosed,
Expand Down
Loading

0 comments on commit 181e369

Please sign in to comment.