-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from itexpert120/homepage
Fix Homepage Issues
- Loading branch information
Showing
12 changed files
with
364 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
const daoId = "build.sputnik-dao.near"; | ||
const accountId = context.accountId; | ||
|
||
// get DAO policy, deposit, and group | ||
const policy = Near.view(daoId, "get_policy"); | ||
|
||
if (policy === null) { | ||
return ""; | ||
} | ||
|
||
const deposit = policy.proposal_bond; | ||
const roleId = "community"; | ||
const group = policy.roles | ||
.filter((role) => role.name === roleId) | ||
.map((role) => role.kind.Group); | ||
|
||
const proposalId = Near.view(daoId, "get_last_proposal_id") - 1; | ||
|
||
// get data from last proposal | ||
const proposal = Near.view(daoId, "get_proposal", { | ||
id: proposalId, | ||
}); | ||
|
||
if (proposal === null) { | ||
return ""; | ||
} | ||
|
||
// check if the potential member submitted last proposal | ||
const canJoin = accountId && accountId !== proposal.proposer; | ||
|
||
const Button = styled.a` | ||
width: max-content; | ||
all: unset; | ||
display: flex; | ||
padding: 10px 20px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 4px; | ||
&:hover { | ||
text-decoration: none; | ||
color: #000 !important; | ||
cursor: pointer; | ||
background: var(--Yellow, #ffaf51); | ||
} | ||
border-radius: 8px; | ||
background: var(--Yellow, #ffaf51); | ||
color: var(--black-100, #000); | ||
/* Other/Button_text */ | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: normal; | ||
@media screen and (max-width: 768px) { | ||
flex: 1 1 0; | ||
} | ||
`; | ||
|
||
const Container = styled.div` | ||
width: max-content; | ||
margin-left: auto; | ||
@media screen and (max-width: 768px) { | ||
margin: 0; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
`; | ||
|
||
return ( | ||
<Container> | ||
{canJoin ? <Button href={"/join"}>Join Now</Button> : props.children} | ||
</Container> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
body { | ||
overflow-y: scroll; | ||
background-color: #0b0c14; | ||
} | ||
|
||
body, html { | ||
|
Oops, something went wrong.