-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b0efc9
commit a792b44
Showing
5 changed files
with
152 additions
and
22 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
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 |
---|---|---|
@@ -0,0 +1,139 @@ | ||
const { | ||
nearDevGovGigsWidgetsAccountId, | ||
nearDevGovGigsContractAccountId, | ||
author, | ||
recency, | ||
tag, | ||
} = props; | ||
|
||
const { getFeaturedCommunities } = VM.require( | ||
`${nearDevGovGigsWidgetsAccountId}/widget/DevHub.modules.contract-sdk` | ||
); | ||
|
||
const { href } = VM.require( | ||
`${nearDevGovGigsWidgetsAccountId}/widget/DevHub.modules.utils` | ||
); | ||
|
||
if (!getFeaturedCommunities || !href) { | ||
return <p>Loading modules...</p>; | ||
} | ||
|
||
const Gradient = styled.div` | ||
{ | ||
height: 250px; | ||
text-align: center; | ||
background: radial-gradient( | ||
circle, | ||
rgba(29, 55, 57, 1) 30%, | ||
rgba(24, 24, 24, 1) 80% | ||
); | ||
font-family: Arial, sans-serif; | ||
} | ||
.text-primary-gradient { | ||
color: #53fdca; | ||
-webkit-text-fill-color: transparent; | ||
background-image: linear-gradient(#8e76ba, #1ed2f0); | ||
-webkit-background-clip: text; | ||
background-clip: text; | ||
} | ||
.subtitle-above { | ||
font-size: 18px; | ||
letter-spacing: 1px; | ||
font-family: Courier, monospace; | ||
} | ||
.subtitle-below { | ||
font-size: 16px; | ||
} | ||
.slogan { | ||
font-weight: 600; | ||
font-size: 60px; | ||
} | ||
`; | ||
|
||
const featuredCommunities = | ||
getFeaturedCommunities(nearDevGovGigsContractAccountId) || []; | ||
|
||
function Banner() { | ||
return ( | ||
<div className="d-flex flex-column"> | ||
<Gradient className="d-flex flex-column justify-content-center"> | ||
<div className="subtitle-above text-white opacity-75 mb-2"> | ||
A decentralized community of | ||
</div> | ||
|
||
<h1 className="mb-3 text-white slogan"> | ||
<span className="text-primary-gradient">NEAR </span>Developers | ||
</h1> | ||
|
||
<div className="subtitle-below text-white opacity-75"> | ||
Share your ideas, match solutions, and access support and funding. | ||
</div> | ||
</Gradient> | ||
|
||
<div className="d-flex flex-column gap-4 py-4"> | ||
<div className="d-flex justify-content-between"> | ||
<h5 className="h5 m-0">Featured Communities</h5> | ||
</div> | ||
<div className="d-flex gap-4 justify-content-between"> | ||
{featuredCommunities.map((community) => ( | ||
<Widget | ||
src={`${nearDevGovGigsWidgetsAccountId}/widget/DevHub.entity.community.card`} | ||
props={{ metadata: community, format: "medium" }} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
|
||
<div className="h5 pb-4">Activity</div> | ||
</div> | ||
); | ||
} | ||
|
||
const [searchTag, setSearchTag] = useState(tag || ""); | ||
const [searchAuthor, setSearchAthor] = useState(author || ""); | ||
|
||
const onTagSearch = (tag) => { | ||
setSearchTag(tag); | ||
}; | ||
|
||
const onAuthorSearch = (author) => { | ||
setSearchAthor(author); | ||
}; | ||
return ( | ||
<div className="w-100"> | ||
<Banner /> | ||
<Widget | ||
src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.feature.post-search.panel`} | ||
props={{ | ||
author: searchAuthor, | ||
authorQuery: { author: searchAuthor }, | ||
children: ( | ||
<Widget | ||
src={`${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.components.layout.Controls`} | ||
props={{ | ||
title: "Post", | ||
href: href({ | ||
widgetSrc: `${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.Create`, | ||
}), | ||
nearDevGovGigsContractAccountId: nearDevGovGigsContractAccountId, | ||
nearDevGovGigsWidgetsAccountId: nearDevGovGigsWidgetsAccountId, | ||
}} | ||
/> | ||
), | ||
onAuthorSearch, | ||
onTagSearch, | ||
recency, | ||
tag: searchTag, | ||
tagQuery: { tag: searchTag }, | ||
transactionHashes: props.transactionHashes, | ||
nearDevGovGigsContractAccountId: nearDevGovGigsContractAccountId, | ||
nearDevGovGigsWidgetsAccountId: nearDevGovGigsWidgetsAccountId, | ||
}} | ||
/> | ||
</div> | ||
); |