-
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.
feat: adding tabs module / references module / get user insight module
- Loading branch information
Showing
8 changed files
with
291 additions
and
5 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,35 @@ | ||
import { fr } from '@codegouvfr/react-dsfr'; | ||
import Button from '@codegouvfr/react-dsfr/Button'; | ||
import { text } from 'stream/consumers'; | ||
import { tss } from 'tss-react/dsfr'; | ||
|
||
const HomeActionButton = () => { | ||
const { cx, classes } = useStyles(); | ||
|
||
return ( | ||
<section className={fr.cx('fr-container', 'fr-py-16v')}> | ||
<div className={cx(classes.container)}> | ||
<h2>Prêt à recueillir les avis des usagers</h2> | ||
<Button className={fr.cx('fr-my-2v')}>Commencer</Button> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
|
||
const useStyles = tss | ||
.withName(HomeActionButton.name) | ||
.withParams() | ||
.create(() => ({ | ||
container: { | ||
h2: { | ||
color: fr.colors.decisions.text.title.blueFrance.default, | ||
textAlign: 'center' | ||
}, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'column' | ||
} | ||
})); | ||
|
||
export default HomeActionButton; |
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,88 @@ | ||
import { Pill } from '@/pages'; | ||
import { fr } from '@codegouvfr/react-dsfr'; | ||
import { tss } from 'tss-react/dsfr'; | ||
|
||
interface HomePillsProps { | ||
pills: Pill[]; | ||
} | ||
|
||
const HomePills = (props: HomePillsProps) => { | ||
const { cx, classes } = useStyles(); | ||
|
||
return ( | ||
<section className={fr.cx('fr-container')}> | ||
<div | ||
className={fr.cx( | ||
'fr-grid-row', | ||
'fr-grid-row--gutters', | ||
'fr-grid-row--center', | ||
'fr-py-12w' | ||
)} | ||
> | ||
{props.pills.map((pill, index) => ( | ||
<div | ||
key={index} | ||
className={cx(fr.cx('fr-col', 'fr-col-12', 'fr-col-md-4'))} | ||
> | ||
<div className={cx(classes.badge)}> | ||
<h2 className={cx(classes.title)}>{pill.title}</h2> | ||
<div className={cx(classes.badgeIcon)}> | ||
<i className="ri-check-line"></i> | ||
</div> | ||
</div> | ||
<div className={cx(classes.paragraph)}> | ||
<p>{pill.description}</p> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
}; | ||
|
||
const useStyles = tss | ||
.withName(HomePills.name) | ||
.withParams() | ||
.create(() => ({ | ||
badge: { | ||
...fr.spacing('margin', { | ||
rightLeft: '5w' | ||
}), | ||
position: 'relative', | ||
...fr.spacing('padding', { | ||
rightLeft: '3w' | ||
}) | ||
}, | ||
title: { | ||
color: fr.colors.decisions.text.title.blueFrance.default, | ||
textAlign: 'center', | ||
backgroundColor: fr.colors.decisions.background.alt.blueEcume.default, | ||
...fr.spacing('padding', { | ||
topBottom: '1v' | ||
}), | ||
borderRadius: fr.spacing('3w') | ||
}, | ||
badgeIcon: { | ||
position: 'absolute', | ||
top: '0', | ||
right: '0', | ||
transform: 'translate(-50%, -50%)', | ||
color: '#FFF', | ||
backgroundColor: | ||
fr.colors.decisions.background.actionHigh.success.default, | ||
borderRadius: '50%', | ||
...fr.spacing('padding', { | ||
topBottom: '1v', | ||
rightLeft: '1v' | ||
}) | ||
}, | ||
paragraph: { | ||
...fr.spacing('padding', { | ||
rightLeft: '4w' | ||
}), | ||
textAlign: 'center', | ||
fontWeight: fr.typography[0].style.fontWeight | ||
} | ||
})); | ||
|
||
export default HomePills; |
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,91 @@ | ||
import { Reference } from '@/pages'; | ||
import Image from 'next/image'; | ||
import { tss } from 'tss-react/dsfr'; | ||
import { fr } from '@codegouvfr/react-dsfr'; | ||
|
||
interface HomeReferencesProps { | ||
references: Reference[]; | ||
} | ||
|
||
const HomeReferences = (props: HomeReferencesProps) => { | ||
const { cx, classes } = useStyles(); | ||
|
||
return ( | ||
<section className={cx(fr.cx('fr-container'), classes.root)}> | ||
<h2>Elles recommandent</h2> | ||
{props.references.map((reference, index) => ( | ||
<div | ||
key={index} | ||
className={fr.cx('fr-grid-row', 'fr-grid-row--gutters', 'fr-pb-6w')} | ||
> | ||
<div | ||
className={cx( | ||
fr.cx('fr-col', 'fr-col-12', 'fr-col-md-3'), | ||
classes.imageContainer | ||
)} | ||
> | ||
<Image | ||
src={reference.image_path} | ||
alt={reference.author} | ||
width={180} | ||
height={180} | ||
className={cx(classes.image)} | ||
/> | ||
</div> | ||
<div className={fr.cx('fr-col', 'fr-col-12', 'fr-col-md-9')}> | ||
<div className={cx(classes.textContainer)}> | ||
<i className={cx(fr.cx('fr-icon-quote-line'), classes.icon)} /> | ||
<h6>{reference.description}</h6> | ||
<div> | ||
<p className={cx(classes.underInfos, classes.bold)}> | ||
{reference.author} | ||
</p> | ||
<p className={cx(classes.underInfos, classes.italic)}> | ||
{reference.job_title} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</section> | ||
); | ||
}; | ||
|
||
const useStyles = tss.withName(HomeReferences.name).create(() => ({ | ||
root: { | ||
h2: { | ||
color: fr.colors.decisions.text.title.blueFrance.default | ||
} | ||
}, | ||
imageContainer: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
borderRight: '1px solid #e5e5e5', | ||
paddingRight: 0 | ||
}, | ||
image: { | ||
borderRadius: '50%' | ||
}, | ||
icon: { | ||
color: fr.colors.decisions.text.actionHigh.blueFrance.default | ||
}, | ||
textContainer: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'space-between', | ||
height: '100%' | ||
}, | ||
underInfos: { | ||
marginBottom: 0 | ||
}, | ||
bold: { | ||
fontWeight: 'bold' | ||
}, | ||
italic: { | ||
fontStyle: 'italic', | ||
color: fr.colors.decisions.text.mention.grey.default | ||
} | ||
})); | ||
|
||
export default HomeReferences; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.