Skip to content

Commit

Permalink
Merge pull request #56 from GenaDrop/admin-fix
Browse files Browse the repository at this point in the history
admin fix
  • Loading branch information
Ebube111 authored Jan 3, 2024
2 parents d1a1176 + 7ef7de7 commit ae1ee16
Show file tree
Hide file tree
Showing 6 changed files with 1,292 additions and 12 deletions.
95 changes: 95 additions & 0 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Admin/Payout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

const Root = styled.div`
margin-left: auto;
margin-right: auto;
max-width: 700px;
width: 100%;
padding: 40px;
.header {
display: flex;
align-items: center;
flex-direction: column;
h1 {
font-size: 38px;
font-weight: 700;
}
span {
color: #b0b0b0;
text-align: center;
}
}
.field {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}
.date-field {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.form {
display: flex;
flex-direction: column;
width: 100%;
margin-top: 40px;
}
.button {
width: 100%;
button {
background: #000;
border: 1px solid #000;
width: 100%;
margin-top: 30px;
}
}
`
const [winner, setWinner] = useState("")
const [contestId, setContestId] = useState(0)
const [proposalId, setProposalId] = useState(0)

const handleSubmit = () => {
Near.call("fund-v2.genadrop.near",
"set_payout_proposal_id",
{
contest_id: contestId,
proposal_id: proposalId,
winner: winner,
},
"300000000000000",
"10000000000000000000000"
)
}



return (
<Root>
<div className="header">
<h1>Update Winner Information</h1>
<span>Update the Winner information with the proposal Id</span>
</div>
<div className="form">
<div className="field">
<label>Winner Account ID</label>
<input placeholder="genadrop.near" value={winner} onChange={e => setWinner(e.target.value)} required />
</div>
<div className="field">
<label>Contest ID</label>
<input value={contestId} onChange={e => setContestId(e.target.value)} type="number" required />
</div>
<div className="field">
<label>Proposal ID (The ID of the Proposal that was created to Payout this User)</label>
<input value={proposalId} onChange={e => setProposalId(e.target.value)} type="number" required />
</div>
<div className="button">
<button onClick={handleSubmit}>Update</button>
</div>
</div>
</Root>
)
29 changes: 23 additions & 6 deletions apps/BosGenaDrop/widget/CPlanet/DropsFund/Contest/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,28 @@ const nearGreen = (
</svg>
);

const Container = styled.div`
border: 1px solid ${(p) => (p.selected ? "#3BD07F" : p.notOwner ? "#F777" : "#eaeaea")};
margin-bottom: 20px;
@media (max-width: 500px) {
width: 90%;
margin-left: auto;
margin-right: auto;
}
`

const Root = styled.div`
height: 186px;
height: max-height;
max-width: 1000px;
display: flex;
padding: 16px;
border-bottom: 1px solid ${(p) => (p.selected ? "#3BD07F" : p.notOwner ? "#F777" : "#eaeaea")};
background: ${(p) => (p.selected ? "#E4FFF0" : p.notOwner ? "#FFF8F8" : "#fff")};
border: 1px solid ${(p) => (p.selected ? "#3BD07F" : p.notOwner ? "#F777" : "#eaeaea")};
@media (max-width: 500px) {
width: 90% !important;
max-width: 90% !important;
width: 100% !important;
max-width: 100% !important;
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
flex-wrap: wrap;
height: 100%;
}
Expand Down Expand Up @@ -370,6 +379,12 @@ function makeDescriptionShorter(desc) {


return (
<Container
selected={
props.winners ? props.winners?.some((data) => data === props.owner) : ""
}
notOwner={props?.owner === nftData?.owner ? false: true}
>
<Root
selected={
props.winners ? props.winners?.some((data) => data === props.owner) : ""
Expand Down Expand Up @@ -439,7 +454,7 @@ return (
{
props.isClosed && props?.councilMember && (
<a href={`https://app.astrodao.com/dao/${props.daoId}/proposals`} target="_blank">
<button className="proposal">CREATE PROPOSAL</button>
<button className="proposal">VIEW PROPOSAL</button>
</a>
)
}
Expand All @@ -452,4 +467,6 @@ return (
<p>{props?.content?.votes} Vote(s)</p>
</StartedButton>
</Root>
<Widget src="bos.genadrop.near/widget/CPlanet.DropsFund.Contest.Proposal" props={{daoId: props.daoId, proposalId: winnerDetails?.proposal_id }} />
</Container>
);
Loading

0 comments on commit ae1ee16

Please sign in to comment.