Skip to content

Commit 3d7016b

Browse files
authored
Feat/repositioning roles (#1425)
* presenting roles in the home page * revisited home page * landing pages for each role and home page redefined with new purpose * lint and format fixes
1 parent 72cb8a4 commit 3d7016b

25 files changed

Lines changed: 1051 additions & 115 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import OpenSourcePublicPage from 'design-library/pages/public-pages/open-source-public-page/open-source-public-page'
3+
4+
const OpenSourcePage = () => {
5+
return <OpenSourcePublicPage />
6+
}
7+
8+
export default OpenSourcePage
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import PrivateProjectsPublicPage from 'design-library/pages/public-pages/private-projects-public-page/private-projects-public-page'
3+
4+
const PrivateProjectsPage = () => {
5+
return <PrivateProjectsPublicPage />
6+
}
7+
8+
export default PrivateProjectsPage
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import ServicePaymentsPublicPage from 'design-library/pages/public-pages/service-payments-public-page/service-payments-public-page'
3+
4+
const ServicePaymentsPage = () => {
5+
return <ServicePaymentsPublicPage />
6+
}
7+
8+
export default ServicePaymentsPage

frontend/src/components/areas/public/pages/public-page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import TaskListUser from '../../../../containers/tasks/task-list-user'
1111
import useCommonActions from '../../../../hooks/use-common-actions'
1212
import ExplorePage from '../features/explore/pages/explore-page'
1313
import PricingPage from '../features/pricing/pages/pricing-page'
14+
import OpenSourcePage from '../features/welcome/pages/open-source-page'
15+
import PrivateProjectsPage from '../features/welcome/pages/private-projects-page'
16+
import ServicePaymentsPage from '../features/welcome/pages/service-payments-page'
1417

1518
const PublicPage = ({
1619
user,
@@ -43,6 +46,9 @@ const PublicPage = ({
4346
<Switch>
4447
<Route exact path="/" component={HomePage} />
4548
<Route exact path="/welcome" component={WelcomeContainer} />
49+
<Route exact path="/use-cases/open-source" component={OpenSourcePage} />
50+
<Route exact path="/use-cases/private-projects" component={PrivateProjectsPage} />
51+
<Route exact path="/use-cases/service-payments" component={ServicePaymentsPage} />
4652
<Route path="/pricing" component={PricingPage} />
4753
{/* Team page removed - unused legacy route */}
4854
<Route exact path="/task/:id" component={TaskContainer} />

frontend/src/components/design-library/molecules/heroes/call-to-action-hero/call-to-action-hero.styles.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ import Button, { ButtonProps } from '@mui/material/Button'
44
import ListItem from '@mui/material/ListItem'
55
import { DotLottieReact } from '@lottiefiles/dotlottie-react'
66

7-
export const CallToActionHeroStyled = styled('div')(({ theme }) => ({
7+
type CallToActionHeroStyledProps = {
8+
$withContrast?: boolean
9+
}
10+
11+
export const CallToActionHeroStyled = styled('div', {
12+
shouldForwardProp: (prop) => prop !== '$withContrast'
13+
})<CallToActionHeroStyledProps>(({ theme, $withContrast }) => ({
14+
backgroundColor: $withContrast ? theme.palette.primary.contrastText : 'transparent',
815
position: 'relative',
916
width: '100%',
1017
height: 500,

frontend/src/components/design-library/molecules/heroes/call-to-action-hero/call-to-action-hero.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@ import {
77
GutterTopButton
88
} from './call-to-action-hero.styles'
99

10-
const CallToActionHero = ({ title, actions }) => {
10+
type CallToActionHeroProps = {
11+
title: React.ReactNode
12+
actions: {
13+
label: React.ReactNode
14+
link: string
15+
variant?: 'text' | 'outlined' | 'contained'
16+
color?: 'primary' | 'secondary' | 'inherit' | 'success' | 'error' | 'info' | 'warning'
17+
size?: 'small' | 'medium' | 'large'
18+
}[]
19+
withContrast?: boolean
20+
}
21+
22+
const CallToActionHero = ({ title, actions, withContrast = true }: CallToActionHeroProps) => {
1123
return (
12-
<CallToActionHeroStyled>
24+
<CallToActionHeroStyled $withContrast={withContrast}>
1325
<DotLottieReactStyled src={'/lottie/developer-team.lottie'} loop autoplay />
1426
<BottomCTASection>
1527
<BottomCopy variant="h6" gutterBottom>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import type { Meta, StoryObj } from '@storybook/react'
2+
import { action } from '@storybook/addon-actions'
3+
import CardsHero from './cards-hero'
4+
import bountyImage from 'images/roles/bounty.png'
5+
import notificationsImage from 'images/roles/notifications.png'
6+
import paymentCycleImage from 'images/roles/payment-cycle.png'
7+
import sharingImage from 'images/roles/sharing.png'
8+
9+
const meta: Meta<typeof CardsHero> = {
10+
title: 'Design Library/Molecules/Heroes/CardsHero',
11+
component: CardsHero,
12+
argTypes: {
13+
title: { control: 'text' },
14+
description: { control: 'text' },
15+
cards: { control: 'object' }
16+
}
17+
}
18+
19+
export default meta
20+
type Story = StoryObj<typeof CardsHero>
21+
22+
export const Default: Story = {
23+
args: {
24+
title: 'Choose your role',
25+
description: 'Pick how you want to use Gitpay and start now.',
26+
cards: [
27+
{
28+
type: 'maintainer',
29+
title: 'Maintainer',
30+
description: 'Import issues, manage bounties, and grow your open-source project.',
31+
image: notificationsImage,
32+
actionLabel: 'Signup as maintainer',
33+
onAction: action('signup-maintainer')
34+
},
35+
{
36+
type: 'contributor',
37+
title: 'Contributor',
38+
description: 'Solve issues, submit pull requests, and receive payouts for your work.',
39+
image: bountyImage,
40+
actionLabel: 'Signup as contributor',
41+
onAction: action('signup-contributor')
42+
},
43+
{
44+
type: 'sponsor',
45+
title: 'Sponsor',
46+
description: 'Fund bounties and accelerate development in projects you care about.',
47+
image: sharingImage,
48+
actionLabel: 'Signup as sponsor',
49+
onAction: action('signup-sponsor')
50+
},
51+
{
52+
type: 'service-provider',
53+
title: 'Service Provider',
54+
description: 'Request and receive payments for delivered services through Gitpay.',
55+
image: paymentCycleImage,
56+
actionLabel: 'Signup as service provider',
57+
onAction: action('signup-service-provider')
58+
}
59+
]
60+
}
61+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { Button, Card, CardContent } from '@mui/material'
2+
import { styled } from '@mui/material/styles'
3+
4+
type SectionProps = {
5+
$withContrast?: boolean
6+
}
7+
8+
export const Section = styled('section', {
9+
shouldForwardProp: (prop) => prop !== '$withContrast'
10+
})<SectionProps>(({ theme, $withContrast }) => ({
11+
padding: '1rem',
12+
marginTop: 20,
13+
marginBottom: 20,
14+
backgroundColor: $withContrast ? theme.palette.primary.contrastText : 'transparent'
15+
}))
16+
17+
export const Header = styled('div')({
18+
textAlign: 'center',
19+
marginBottom: 28
20+
})
21+
22+
export const RoleCard = styled(Card)({
23+
height: '100%'
24+
})
25+
26+
export const RoleCardContent = styled(CardContent)({
27+
display: 'flex',
28+
flexDirection: 'column',
29+
alignItems: 'center',
30+
textAlign: 'center',
31+
height: '100%'
32+
})
33+
34+
export const RoleImage = styled('img')(({ theme }) => ({
35+
width: 112,
36+
height: 112,
37+
objectFit: 'contain',
38+
marginBottom: 14,
39+
[theme.breakpoints.down('sm')]: {
40+
width: 92,
41+
height: 92
42+
}
43+
}))
44+
45+
export const ActionButton = styled(Button)({
46+
marginTop: 'auto'
47+
})
48+
49+
export const DescriptionList = styled('ul')(({ theme }) => ({
50+
listStyle: 'none',
51+
margin: '20px 0 32px',
52+
padding: 0,
53+
width: '100%',
54+
textAlign: 'left',
55+
display: 'flex',
56+
flexDirection: 'column',
57+
gap: theme.spacing(1)
58+
}))
59+
60+
export const DescriptionListItem = styled('li')(({ theme }) => ({
61+
display: 'flex',
62+
alignItems: 'flex-start',
63+
gap: theme.spacing(1)
64+
}))
65+
66+
export const DescriptionListIcon = styled('span')(({ theme }) => ({
67+
color: theme.palette.primary.main,
68+
display: 'inline-flex',
69+
lineHeight: 1,
70+
marginTop: 2
71+
}))
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import React from 'react'
2+
import { Typography } from '@mui/material'
3+
import { Grid } from '@mui/system'
4+
import { FormattedMessage } from 'react-intl'
5+
import {
6+
Section,
7+
Header,
8+
RoleCard,
9+
RoleCardContent,
10+
RoleImage,
11+
ActionButton,
12+
DescriptionList,
13+
DescriptionListItem,
14+
DescriptionListIcon
15+
} from './cards-hero.styles'
16+
17+
type CardDescriptionItem = {
18+
id: string
19+
defaultMessage: string
20+
icon?: React.ReactNode
21+
}
22+
23+
type RoleCardItem = {
24+
type: string
25+
title: React.ReactNode
26+
description?: React.ReactNode
27+
descriptionList?: CardDescriptionItem[]
28+
descriptionListIcon?: React.ReactNode
29+
image: string
30+
actionLabel: React.ReactNode
31+
onAction?: () => void
32+
}
33+
34+
type CardsHeroProps = {
35+
title: React.ReactNode
36+
description?: React.ReactNode
37+
cards: RoleCardItem[]
38+
withContrast?: boolean
39+
}
40+
41+
const CardsHero = ({ title, description, cards, withContrast = false }: CardsHeroProps) => {
42+
return (
43+
<Section $withContrast={withContrast}>
44+
<Header>
45+
<Typography variant="h4" gutterBottom>
46+
{title}
47+
</Typography>
48+
{description && (
49+
<Typography variant="h6" color="textSecondary">
50+
{description}
51+
</Typography>
52+
)}
53+
</Header>
54+
<Grid container spacing={3} justifyContent="center">
55+
{cards.map((card) => (
56+
<Grid key={card.type} size={{ xs: 12, sm: 6, md: 3 }}>
57+
<RoleCard>
58+
<RoleCardContent>
59+
<RoleImage src={card.image} alt={card.type} />
60+
<Typography variant="h6" gutterBottom>
61+
{card.title}
62+
</Typography>
63+
{card.descriptionList?.length ? (
64+
<DescriptionList>
65+
{card.descriptionList.map((item) => (
66+
<DescriptionListItem key={item.id}>
67+
{(item.icon || card.descriptionListIcon) && (
68+
<DescriptionListIcon>
69+
{item.icon || card.descriptionListIcon}
70+
</DescriptionListIcon>
71+
)}
72+
<Typography variant="body2" color="textSecondary">
73+
<FormattedMessage id={item.id} defaultMessage={item.defaultMessage} />
74+
</Typography>
75+
</DescriptionListItem>
76+
))}
77+
</DescriptionList>
78+
) : (
79+
<Typography variant="body2" color="textSecondary" paragraph>
80+
{card.description}
81+
</Typography>
82+
)}
83+
<ActionButton
84+
size="small"
85+
variant="outlined"
86+
color="primary"
87+
onClick={card.onAction}
88+
>
89+
{card.actionLabel}
90+
</ActionButton>
91+
</RoleCardContent>
92+
</RoleCard>
93+
</Grid>
94+
))}
95+
</Grid>
96+
</Section>
97+
)
98+
}
99+
100+
export default CardsHero

frontend/src/components/design-library/molecules/heroes/main-hero/main-hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const MainHero = ({ mainTitle, description, actions, image, animation }: MainHer
3535
</Grid>
3636
<Grid size={{ xs: 12, sm: 7 }}>
3737
<HeroTitle>
38-
<Typography variant="h3" gutterBottom align="left">
38+
<Typography variant="h4" gutterBottom align="left">
3939
{mainTitle}
4040
</Typography>
4141
</HeroTitle>

0 commit comments

Comments
 (0)