forked from stakwork/sphinx-tribes-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
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 stakwork#834 from aliraza556/feature/bounty-landin…
…g-page-enhancements ✨ Add How to Earn Steps and Featured Bounties to Landing Page 🎯
- Loading branch information
Showing
13 changed files
with
242 additions
and
20 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,70 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { colors } from '../../config/colors'; | ||
|
||
const StepsContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2px; | ||
margin: 20px 0; | ||
`; | ||
|
||
const StepItem = styled.div` | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 4px; | ||
font-size: 16px; | ||
margin-left: 2%; | ||
color: ${colors.light.text1}; | ||
`; | ||
|
||
const StepLabel = styled.span` | ||
font-weight: 800; | ||
font-size: 18px; | ||
`; | ||
|
||
const StepText = styled.span` | ||
font-weight: 500; | ||
`; | ||
|
||
const StepTitle = styled.h6` | ||
font-size: 20px; | ||
font-family: 'Barlow'; | ||
font-weight: 800; | ||
color: ${colors.light.text1}; | ||
margin-bottom: 20px; | ||
`; | ||
|
||
interface Step { | ||
text: string; | ||
} | ||
|
||
const steps: Step[] = [ | ||
{ | ||
text: 'Sign up for a Sphinx by clicking the Get Sphinx button!' | ||
}, | ||
{ | ||
text: 'Check out the open bounties, by clicking bounties!' | ||
}, | ||
{ | ||
text: 'Reach out to the bounty provider by clicking "I can help!"' | ||
}, | ||
{ | ||
text: 'Introduce yourself and get assigned' | ||
}, | ||
{ | ||
text: 'Compelte the work and get paid directly to your Sphinx Wallet!' | ||
} | ||
]; | ||
|
||
export const BountySteps: React.FC = () => ( | ||
<StepsContainer> | ||
<StepTitle>If you want to earn bounties</StepTitle> | ||
{steps.map((step: Step, index: number) => ( | ||
<StepItem key={index}> | ||
<StepLabel>{`Step ${index + 1}:`}</StepLabel> | ||
<StepText>{step.text}</StepText> | ||
</StepItem> | ||
))} | ||
</StepsContainer> | ||
); |
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,92 @@ | ||
import React, { useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import { observer } from 'mobx-react-lite'; | ||
import { DisplayBounties } from '../../people/widgetViews/workspace/style'; | ||
import { colors } from '../../config/colors'; | ||
import { bountyStore } from '../../store/bountyStore'; | ||
import WidgetSwitchViewer from '../../people/widgetViews/WidgetSwitchViewer'; | ||
|
||
const FeaturedContainer = styled.div` | ||
margin: 20px 0; | ||
`; | ||
|
||
const FeaturedHeader = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
margin-bottom: 16px; | ||
h2 { | ||
font-size: 18px; | ||
font-weight: 600; | ||
color: ${colors.light.text1}; | ||
margin: 0; | ||
} | ||
`; | ||
|
||
export const FeaturedBounties: React.FC = observer(() => { | ||
const featuredBounty = bountyStore.getFeaturedBounty(); | ||
const [currentItems, setCurrentItems] = useState<number>(1); | ||
const [page, setPage] = useState<number>(1); | ||
|
||
const widgetViewerProps = { | ||
onPanelClick: (activeWorkspace?: string, bounty?: any) => { | ||
if (bounty?.id) { | ||
window.location.href = featuredBounty?.url || ''; | ||
} | ||
}, | ||
checkboxIdToSelectedMap: {}, | ||
checkboxIdToSelectedMapLanguage: {}, | ||
fromBountyPage: true, | ||
selectedWidget: 'bounties', | ||
isBountyLandingPage: true, | ||
loading: false, | ||
currentItems, | ||
setCurrentItems: (items: number) => setCurrentItems(items), | ||
page, | ||
setPage: (newPage: number) => setPage(newPage), | ||
languageString: '', | ||
|
||
bounties: featuredBounty | ||
? [ | ||
{ | ||
body: { | ||
id: featuredBounty.bountyId | ||
}, | ||
person: { | ||
wanteds: [] | ||
} | ||
} | ||
] | ||
: [] | ||
}; | ||
|
||
return ( | ||
<FeaturedContainer> | ||
<FeaturedHeader> | ||
<h2>Featured Bounties</h2> | ||
</FeaturedHeader> | ||
|
||
<DisplayBounties> | ||
<div | ||
style={{ | ||
width: 'auto', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
height: '50%', | ||
overflowY: 'auto' | ||
}} | ||
> | ||
{featuredBounty ? ( | ||
<WidgetSwitchViewer {...widgetViewerProps} /> | ||
) : ( | ||
<div style={{ color: colors.light.text2, textAlign: 'center', padding: '20px' }}> | ||
No featured bounties at the moment | ||
</div> | ||
)} | ||
</div> | ||
</DisplayBounties> | ||
</FeaturedContainer> | ||
); | ||
}); |
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,10 @@ | ||
import React from 'react'; | ||
import { BountySteps } from './BountySteps'; | ||
import { FeaturedBounties } from './FeaturedBounties'; | ||
|
||
export const BountyComponents = () => ( | ||
<> | ||
<BountySteps /> | ||
<FeaturedBounties /> | ||
</> | ||
); |
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
Oops, something went wrong.