-
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.
- Loading branch information
Showing
21 changed files
with
411 additions
and
257 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
49 changes: 49 additions & 0 deletions
49
src/app/carte-base-adresse-nationale/components/DistrictLink/DistrictLink.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,49 @@ | ||
'use client' | ||
|
||
import styled from 'styled-components' | ||
import Link from 'next/link' | ||
|
||
export const DistrictLinkWrapper = styled.span` | ||
position: relative; | ||
font-size: 1em; | ||
display: inline-flex; | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: flex-start; | ||
line-height: 1.5; | ||
text-decoration: none; | ||
cursor: pointer; | ||
` | ||
|
||
export const DistrictName = styled.span` | ||
font-size: 1em; | ||
` | ||
|
||
export const DistrictLinkLabel = styled(Link).attrs({ | ||
className: 'fr-link fr-link--icon-right fr-icon-arrow-right-line --force-DSFR-overload', | ||
})` | ||
&[class]:is(.--force-DSFR-overload) { | ||
font-size: 1em; | ||
line-height: inherit; | ||
position: relative; | ||
z-index: 2; | ||
display: inline-block; | ||
overflow: hidden; | ||
max-height: 0; | ||
opacity: 0; | ||
will-change: max-height, opacity; | ||
transition: max-height .3s ease, | ||
opacity .3s ease; | ||
${DistrictLinkWrapper}:hover &, | ||
${DistrictLinkWrapper}:focus-within & { | ||
--underline-hover-width: var(--underline-max-width); /* --force-DSFR-hover-link-style */ | ||
max-height: 2em; | ||
opacity: 1; | ||
} | ||
a { | ||
font-size: 1em; | ||
} | ||
} | ||
` |
36 changes: 36 additions & 0 deletions
36
src/app/carte-base-adresse-nationale/components/DistrictLink/DistrictLink.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,36 @@ | ||
import { | ||
DistrictLinkWrapper, | ||
DistrictName, | ||
DistrictLinkLabel, | ||
} from './DistrictLink.styles' | ||
|
||
interface District { | ||
nom: string | ||
code: string | ||
} | ||
|
||
interface DistrictLinkProps { | ||
children?: React.ReactNode | ||
district: District | ||
} | ||
|
||
function DistrictLink({ children, district }: DistrictLinkProps) { | ||
const href = `./commune/${district.code}` | ||
const titleLink = `Voir la page de la commune de ${district.nom} (COG ${district.code})` | ||
|
||
return ( | ||
<DistrictLinkWrapper> | ||
<DistrictName>{children || district.nom}</DistrictName> | ||
|
||
<DistrictLinkLabel | ||
href={href} | ||
target="_test" | ||
title={titleLink} | ||
> | ||
Voir la page de la commune | ||
</DistrictLinkLabel> | ||
</DistrictLinkWrapper> | ||
) | ||
} | ||
|
||
export default DistrictLink |
1 change: 1 addition & 0 deletions
1
src/app/carte-base-adresse-nationale/components/DistrictLink/index.ts
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 @@ | ||
export { default } from './DistrictLink' |
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
58 changes: 13 additions & 45 deletions
58
src/app/carte-base-adresse-nationale/components/PanelAddress/PanelAddressHeader.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 |
---|---|---|
@@ -1,56 +1,24 @@ | ||
'use client' | ||
|
||
import styled from 'styled-components' | ||
import Image from 'next/image' | ||
import styled, { css } from 'styled-components' | ||
|
||
export const AddressLabelWrapper = styled.div` | ||
font-size: 1.5rem; | ||
font-size: 1rem; | ||
` | ||
|
||
export const AddressPostCode = styled.span` | ||
display: block; | ||
font-size: .7em; | ||
line-height: 1.5; | ||
` | ||
|
||
export const AddressNumberAndMicroTopoLabel = styled.span` | ||
display: block; | ||
font-size: 1.5rem; | ||
font-size: 1em; | ||
line-height: 1.25; | ||
font-weight: 700; | ||
margin-bottom: 0.5rem; | ||
` | ||
|
||
export const AddressMicroTopoLabelAlt = styled.span` | ||
display: block; | ||
font-size: 0.95rem; | ||
export const AddressNumber = styled.span` | ||
font-size: 1.75em; | ||
font-style: italic; | ||
line-height: 1; | ||
font-weight: 700; | ||
margin-bottom: 0.5rem; | ||
font-weight: 300; | ||
` | ||
|
||
export const AddressMicroTopoLabelFlag = styled(Image).attrs({ | ||
width: 24, | ||
height: 24, | ||
})` | ||
width: 1em; | ||
height: 1em; | ||
border-radius: 50%; | ||
vertical-align: -0.1em; | ||
export const AddressNumberSuffix = styled.span` | ||
font-size: 0.75em; | ||
vertical-align: top; | ||
margin-left: 0.15em; | ||
` | ||
|
||
export const AddressDistrictLabelPrefix = styled.span` | ||
display: block; | ||
font-size: .6em; | ||
line-height: 1; | ||
margin-bottom: 0.25rem; | ||
` | ||
|
||
export const AddressDistrictLabel = styled.span<{ $historique?: boolean }>` | ||
display: block; | ||
font-size: 0.7em; | ||
line-height: 1.25; | ||
font-weight: ${({ $historique }) => $historique ? '400' : '700'}; | ||
margin-bottom: 0rem; | ||
export const AddressMicroTopoLabel = styled.span<{ $isOnNewLine: boolean }>` | ||
font-size: 1em; | ||
${({ $isOnNewLine }) => $isOnNewLine && css`display: block;`} | ||
` |
Oops, something went wrong.