Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
MaGOs92 committed Jun 4, 2024
1 parent 071008f commit f002958
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
17 changes: 11 additions & 6 deletions components/evenement/event-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import theme from '@/styles/theme'

import {formatTag} from '@/lib/tag'
import {dateWithDay} from '@/lib/date'
import {removeAccents} from '@/lib/format-strings'

import ButtonLink from '@/components/button-link'
import SectionText from '@/components/section-text'
Expand Down Expand Up @@ -35,13 +36,13 @@ function EventModal({event, isPassed, onClose}) {
return (
<div className='modal-wrapper'>
<div className='modal' ref={modalRef}>
<div className={`header ${type}-backg`}>
<div className={`header ${removeAccents(type)}-backg`}>
<ActionButtonNeutral label='Fermer la fenêtre'>
<XCircle onClick={onClose} color={theme.colors.white} />
</ActionButtonNeutral>

<div className='presentation'>
<Image src={`/images/icons/event-${type}.svg`} height={150} width={170} alt='' aria-hidden='true' />
<div className='presentation-wrapper'>
<Image src={`/images/icons/event-${removeAccents(type)}.svg`} height={150} width={170} alt='' aria-hidden='true' />
<div className='header-infos'>
<div className='title-container'>
<h5>{title}</h5>
Expand Down Expand Up @@ -87,7 +88,7 @@ function EventModal({event, isPassed, onClose}) {
align-items: center;
}
.modal, .header-infos, .presentation, .target, .tags {
.modal, .header-infos, .presentation-wrapper, .target, .tags {
display: flex;
}
Expand Down Expand Up @@ -127,7 +128,7 @@ function EventModal({event, isPassed, onClose}) {
opacity: 70%;
}
.presentation {
.presentation-wrapper {
gap: 2em;
justify-content: space-between;
margin-top: .5em;
Expand Down Expand Up @@ -184,6 +185,10 @@ function EventModal({event, isPassed, onClose}) {
background: ${theme.colors.blue};
}
.presentation-backg {
background: rgb(26, 168, 255);
}
.adresse-region-backg {
background: ${theme.colors.purple};
}
Expand All @@ -205,7 +210,7 @@ function EventModal({event, isPassed, onClose}) {
}
@media (max-width: 624px) {
.presentation {
.presentation-wrapper {
flex-wrap: wrap;
justify-content: flex-end;
}
Expand Down
11 changes: 6 additions & 5 deletions components/evenement/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
import Image from 'next/legacy/image'

import {dateWithDay} from '@/lib/date'
import {removeAccents} from '@/lib/format-strings'

import theme from '@/styles/theme'

Expand All @@ -17,9 +18,9 @@ function Event({event, background, isPassed}) {

return (
<div className='event-container'>
<div className={`header ${type}`}>
<div className='presentation'>
<Image src={`/images/icons/event-${type}.svg`} height={50} width={50} alt='' aria-hidden='true' />
<div className={`header ${removeAccents(type)}`}>
<div className='presentation-wrapper'>
<Image src={`/images/icons/event-${removeAccents(type)}.svg`} height={50} width={50} alt='' aria-hidden='true' />
<div className='title-container'>
<h5>{title}</h5>
<div>{subtitle}</div>
Expand Down Expand Up @@ -70,7 +71,7 @@ function Event({event, background, isPassed}) {
gap: 1em;
}
.presentation {
.presentation-wrapper {
display: flex;
flex-direction: column;
align-items: center;
Expand Down Expand Up @@ -119,7 +120,7 @@ function Event({event, background, isPassed}) {
background: ${theme.colors.green};
}
.présentation {
.presentation {
background: rgb(26, 168, 255);
}
Expand Down
1 change: 1 addition & 0 deletions lib/format-strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const removeAccents = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '') // eslint-disable-line unicorn/escape-case
File renamed without changes

0 comments on commit f002958

Please sign in to comment.