-
Notifications
You must be signed in to change notification settings - Fork 32
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 #1900 from BaseAdresseNationale/feat/adresse-v2-ca…
…rto-ban-step3 Feat/adresse v2 - carto ban step3
- Loading branch information
Showing
67 changed files
with
1,515 additions
and
819 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
47 changes: 47 additions & 0 deletions
47
src/app/carte-base-adresse-nationale/components/Aside/AsideFooter.tsx
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,47 @@ | ||
import { useMemo } from 'react' | ||
|
||
import Button, { ButtonProps } from '@codegouvfr/react-dsfr/Button' | ||
|
||
import { | ||
AsideFooterWrapper, | ||
ActionWrapper, | ||
ActionList, | ||
} from './AsideFooter.styles' | ||
|
||
interface AsideFooterAddressProps { | ||
children?: React.ReactNode | ||
actions?: { | ||
label: ButtonProps['children'] | ||
onClick: ButtonProps['onClick'] | ||
iconId: ButtonProps['iconId'] | ||
priority?: ButtonProps['priority'] | ||
}[] | ||
} | ||
|
||
function AsideFooterDistrict({ children, actions }: AsideFooterAddressProps) { | ||
const actionsButtons = useMemo(() => actions?.map(({ label, ...props }, index) => ( | ||
<ActionList key={index}> | ||
<Button | ||
{...props as ButtonProps} | ||
> | ||
{label} | ||
</Button> | ||
</ActionList> | ||
) | ||
), [actions]) | ||
|
||
return ( | ||
<AsideFooterWrapper> | ||
{children} | ||
{actions && actions.length > 0 && ( | ||
<ActionWrapper> | ||
<ActionList> | ||
{actionsButtons} | ||
</ActionList> | ||
</ActionWrapper> | ||
)} | ||
</AsideFooterWrapper> | ||
) | ||
} | ||
|
||
export default AsideFooterDistrict |
73 changes: 73 additions & 0 deletions
73
src/app/carte-base-adresse-nationale/components/Aside/AsideHeader.styles.tsx
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,73 @@ | ||
'use client' | ||
|
||
import styled from 'styled-components' | ||
|
||
export const AsideHeader = styled.div` | ||
position: absolute; | ||
display: flex; | ||
flex-direction: column-reverse; | ||
overflow: hidden; | ||
width: 100%; | ||
padding: 0 1rem 1rem; | ||
font-size: 1rem; | ||
transform: translateY(-100%); | ||
scroll-snap-align: start; | ||
scroll-snap-stop: always; | ||
@media (min-width: ${({ theme }) => theme.breakpoints.md}) { | ||
position: static; | ||
padding: 8rem 1rem 1rem; | ||
background: var(--background-default-grey); | ||
margin: 0; | ||
transform: none; | ||
} | ||
& * { | ||
pointer-events: auto; | ||
} | ||
&::after { | ||
content: ''; | ||
position: absolute; | ||
z-index: -1; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-image: linear-gradient(0deg, var(--background-default-grey) 0%, rgba(0, 0, 0, 0) 100%); | ||
background-repeat: no-repeat; | ||
background-size: 100% 100%; | ||
background-position: 100% center; | ||
pointer-events: auto; | ||
transform: translateY(0); | ||
transition: transform 0.5s ease; | ||
@media (min-width: ${({ theme }) => theme.breakpoints.md}) { | ||
content: none; | ||
} | ||
} | ||
` | ||
|
||
export const AsideHeaderContent = styled.div` | ||
position: relative; | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
gap: 1.25rem; | ||
padding: 1rem; | ||
margin-bottom: 1rem; | ||
border-bottom: 4px solid var(--border-active-blue-france); | ||
background-color: var(--background-default-grey); | ||
@media (min-width: ${({ theme }) => theme.breakpoints.md}) { | ||
padding: 1rem 0; | ||
} | ||
` | ||
|
||
export const AsideHeaderCloseButtonWrapper = styled.div` | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
z-index: 1; | ||
pointer-events: auto; | ||
` |
40 changes: 40 additions & 0 deletions
40
src/app/carte-base-adresse-nationale/components/Aside/AsideHeader.tsx
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,40 @@ | ||
import Button from '@codegouvfr/react-dsfr/Button' | ||
|
||
import MapBreadcrumb from '../MapBreadcrumb' | ||
import type { MapBreadcrumbPath } from '../MapBreadcrumb' | ||
|
||
import { | ||
AsideHeader as AsideHeaderStyle, | ||
AsideHeaderContent, | ||
AsideHeaderCloseButtonWrapper, | ||
} from './AsideHeader.styles' | ||
|
||
interface AsideHeaderProps { | ||
path?: MapBreadcrumbPath | ||
children?: React.ReactNode | ||
onClose?: () => void | ||
} | ||
|
||
function AsideHeader({ path, children, onClose }: AsideHeaderProps) { | ||
return ( | ||
<AsideHeaderStyle> | ||
{path && <MapBreadcrumb path={path} />} | ||
<AsideHeaderContent> | ||
{onClose && ( | ||
<AsideHeaderCloseButtonWrapper> | ||
<Button | ||
iconId="ri-close-line" | ||
priority="tertiary no outline" | ||
size="small" | ||
onClick={onClose} | ||
title="Fermer" | ||
/> | ||
</AsideHeaderCloseButtonWrapper> | ||
)} | ||
{children} | ||
</AsideHeaderContent> | ||
</AsideHeaderStyle> | ||
) | ||
} | ||
|
||
export default AsideHeader |
Oops, something went wrong.