-
Notifications
You must be signed in to change notification settings - Fork 2
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
4ff7f60
commit 4651390
Showing
13 changed files
with
247 additions
and
21 deletions.
There are no files selected for viewing
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.
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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
|
||
export function pickupPoint() { | ||
export function pickupPointHours() { | ||
const buttons = document.querySelectorAll('.PickupPoint-hours'); | ||
|
||
buttons.forEach((button) => { | ||
button.addEventListener('click', function () { | ||
const parent = this.closest(".PickupPoint"); | ||
const parent = this.closest('.PickupPoint'); | ||
const hoursListing = parent.querySelector('.PickupPoint-hoursListing'); | ||
hoursListing.classList.toggle("md:hidden"); | ||
hoursListing.classList.toggle('md:hidden'); | ||
}); | ||
}); | ||
} | ||
export function pickupPoint() { | ||
const inputs = document.querySelectorAll('.PickupPoint input[type="radio"]'); | ||
|
||
inputs.forEach((input) => { | ||
input.addEventListener('change', function () { | ||
const allPickupPoints = document.querySelectorAll('.PickupPoint'); | ||
allPickupPoints.forEach((pickupPoint) => { | ||
pickupPoint.classList.remove('selected'); | ||
}); | ||
const parent = this.closest('.PickupPoint'); | ||
parent.classList.toggle('selected', input.checked); | ||
}); | ||
}); | ||
} |
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
74 changes: 74 additions & 0 deletions
74
components/Organisms/Modules/PickupPointModule/PickupPointModule.stories.js
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,74 @@ | ||
import PickupPointModule from './PickupPointModule.twig'; | ||
import { | ||
pickupPoint, | ||
pickupPointHours | ||
} from '../../Card/PickupPoint/PickupPoint'; | ||
|
||
export default { | ||
title: 'Design System/Organisms/Modules/PickupPoint' | ||
}; | ||
|
||
const address = { | ||
address1: 'Adresse première ligne', | ||
address2: 'Complément d’adresse', | ||
zipCode: '00000', | ||
city: 'Clermont-Ferrand', | ||
country: 'Ville-Sur-Fleuve' | ||
}; | ||
const hours = [ | ||
{ day: 'lundi', hours: '14h - 19h' }, | ||
{ day: 'mardi', hours: '14h - 20h' }, | ||
{ day: 'Mercredi', hours: '14h - 20h' }, | ||
{ day: 'Jeudi', hours: '14h - 20h' }, | ||
{ day: 'Vendredi', hours: '14h - 20h' }, | ||
{ day: 'Samedi', hours: '14h - 20h' }, | ||
{ day: 'Dimanche', hours: 'Fermé' } | ||
]; | ||
|
||
export const Base = { | ||
render: (args) => PickupPointModule(args), | ||
play: () => { | ||
pickupPointHours(); | ||
pickupPoint(); | ||
}, | ||
args: { | ||
selected: false, | ||
title: 'Retrait en point relais', | ||
price: '7,80€', | ||
carbone: '0.12kg CO2', | ||
pickupServices: [ | ||
{ | ||
name: 'Mondial relais', | ||
value: 'mondial_relais', | ||
img: '/images/mondialRelay.svg' | ||
}, | ||
{ | ||
name: 'Relais colis', | ||
value: 'relais_colis' | ||
} | ||
], | ||
pickups: [ | ||
{ | ||
selected: false, | ||
closed: false, | ||
title: 'Nom du point relais', | ||
date: 'JJ/MM', | ||
address, | ||
price: '7,80€', | ||
img: { alt: 'Logo Mondial Relay', src: '/images/mondialRelay.svg' }, | ||
hours | ||
}, | ||
{ | ||
selected: false, | ||
closed: true, | ||
title: 'Nom du point relais', | ||
date: 'JJ/MM', | ||
address, | ||
price: '7,80€', | ||
img: { alt: 'Logo Mondial Relay', src: '/images/mondialRelay.svg' }, | ||
hours | ||
} | ||
] | ||
}, | ||
argTypes: {} | ||
}; |
55 changes: 55 additions & 0 deletions
55
components/Organisms/Modules/PickupPointModule/PickupPointModule.twig
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,55 @@ | ||
<div class='PickupPointModule {% if selected %}selected{% endif %}'> | ||
<label class='PickupPointModule-content'> | ||
{% include '../../../Atoms/Form/Radio.twig' with {type:"span", name:"PickupPoint", value:1, checked:selected} %} | ||
<span> | ||
<span class='PickupPointModule-top'> | ||
<span> | ||
<span class='PickupPointModule-title'>{{ title }}</span> | ||
<span class='PickupPointModule-description'>Livraison estimée le {{ date }}</span> | ||
</span> | ||
<span class="w-12 h-12 text-theme-medium"> | ||
{{ source("/icons/reinsurance-pickup.svg") }} | ||
</span> | ||
</span> | ||
<div class='flex items-center justify-between mt-6'> | ||
<span class='PickupPointModule-price'>{{ price }}</span> | ||
{% include '../../../Molecules/Tag/Tag.twig' with { icon: "carbone", customText: carbone } %} | ||
</div> | ||
</span> | ||
</label> | ||
<div class='PickupPointModule-searchZone'> | ||
<div> | ||
{% include '../../../Molecules/Fields/FieldInput/FieldInput.twig' with { label: "Rechercher un lieu de livraison", placeholder: "Ex : Ville, Code postal", iconButton: "search" } %} | ||
</div> | ||
<div> | ||
<button class='underline-with-icon text-black' type='button'>{{ source("/icons/pin-circle.svg") }}Sélectionner sur la carte</button> | ||
</div> | ||
<div class='flex gap-1 md:gap-5'> | ||
{% include '../../../Molecules/Button/Button.twig' with {classes: 'PickupPointModule-buttonView', text: 'Vue carte', sharp:true, icon_left: 'list', variant: 'secondary'} %} | ||
{% include '../../../Molecules/Button/Button.twig' with {classes: 'PickupPointModule-buttonView', text: 'Vue carte', sharp:true, icon_left: 'pin-circle'} %} | ||
</div> | ||
<div class='paragraph-6 mt-5'>3 points relais trouvés</div> | ||
<div class='mt-3 text-black xl:flex gap-10'> | ||
{% for pickupService in pickupServices %} | ||
<label class="Checkbox"> | ||
<input type="checkbox" | ||
name='pickup' | ||
value='{{ pickupService.value }}' | ||
> | ||
<div class="checkmark"> | ||
<span>{{ source("/icons/checkbox.svg") }}</span> | ||
</div> | ||
<span>{{ pickupService.name }}</span> | ||
{% if pickupService.img %} | ||
<span><img src='{{ pickupService.img }}' alt='Logo {{ pickupService.name }}'></span> | ||
{% endif %} | ||
</label> | ||
{% endfor %} | ||
</div> | ||
<div class='mt-6 flex flex-col gap-2'> | ||
{% for pickup in pickups %} | ||
{% include '../../Card/PickupPoint/PickupPoint.twig' with pickup %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> |
76 changes: 76 additions & 0 deletions
76
components/Organisms/Modules/PickupPointModule/pickupPointModule.css
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,76 @@ | ||
.PickupPointModule { | ||
max-width: rem-convert(340px); | ||
@screen md { | ||
max-width: rem-convert(444px); | ||
} | ||
@screen xl { | ||
max-width: rem-convert(540px); | ||
} | ||
background: var(--theme-lightest); | ||
border: 1px solid var(--theme-lightest); | ||
border-radius: rem-convert(8px); | ||
|
||
&-searchZone { | ||
display: none; | ||
} | ||
&.selected { | ||
border: 1px solid var(--theme-medium); | ||
.PickupPointModule-content { | ||
background: var(--theme-lighter); | ||
border-top-left-radius: rem-convert(8px); | ||
border-top-right-radius: rem-convert(8px); | ||
} | ||
.PickupPointModule-searchZone { | ||
display: block; | ||
padding: rem-convert(16px); | ||
padding-top: rem-convert(30px); | ||
@screen md { | ||
padding: rem-convert(40px); | ||
|
||
} | ||
} | ||
} | ||
|
||
&-content { | ||
display: flex; | ||
align-items: flex-start; | ||
padding: rem-convert(16px); | ||
& > span:last-child { | ||
flex-grow: 1; | ||
} | ||
.Radio { | ||
margin-top: 4px; | ||
margin-right: 8px; | ||
} | ||
span:not(.PickupPointModule-top):not(.Tag) { | ||
display: block; | ||
} | ||
.PickupPointModule-top { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
} | ||
|
||
&-title { | ||
@apply paragraph-1; | ||
font-weight: 600; | ||
color: var(--black); | ||
} | ||
|
||
&-description { | ||
@apply paragraph-6; | ||
color: var(--grey); | ||
margin-top: rem-convert(4px); | ||
} | ||
|
||
&-price { | ||
@apply paragraph-4; | ||
font-weight: 600; | ||
color: var(--black); | ||
} | ||
&-buttonView { | ||
@screen maxMd { | ||
@apply Button--small Button--fill; | ||
} | ||
} | ||
} |
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