File tree Expand file tree Collapse file tree
impact-carbone-hiver-station-ski
semaine-mobilite-simulateur-transport-ademe Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const NewSite = async () => {
2121
2222 return (
2323 < >
24- < Notion title = { title } recordMap = { recordMap } />
24+ < Notion title = { title } recordMap = { recordMap } noTitle />
2525 < Suggestion fromLabel = { title } simulatorName = 'des ressources de sensibilisation' />
2626 </ >
2727 )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const NewSite = async () => {
2020
2121 return (
2222 < >
23- < Notion title = { title } recordMap = { recordMap } />
23+ < Notion title = { title } recordMap = { recordMap } noTitle />
2424 < Suggestion fromLabel = { title } simulatorName = "de l'étiquette carbone" />
2525 </ >
2626 )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const SkiPage = async () => {
2121
2222 return (
2323 < >
24- < Notion title = { title } recordMap = { recordMap } />
24+ < Notion title = { title } recordMap = { recordMap } noTitle />
2525 < Suggestion fromLabel = { title } simulatorName = 'de ce contenu' />
2626 </ >
2727 )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const NewSite = async () => {
2020
2121 return (
2222 < >
23- < Notion title = { title } recordMap = { recordMap } />
23+ < Notion title = { title } recordMap = { recordMap } noTitle />
2424 < Suggestion fromLabel = { title } simulatorName = 'du nouveau site' />
2525 </ >
2626 )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const QuizCarbone = async () => {
2121
2222 return (
2323 < >
24- < Notion title = { title } recordMap = { recordMap } />
24+ < Notion title = { title } recordMap = { recordMap } noTitle />
2525 < Suggestion fromLabel = { title } simulatorName = 'du quiz carbone' />
2626 </ >
2727 )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const NewSite = async () => {
2121
2222 return (
2323 < >
24- < Notion title = { title } recordMap = { recordMap } />
24+ < Notion title = { title } recordMap = { recordMap } noTitle />
2525 < Suggestion fromLabel = { title } simulatorName = 'de la semaine de la mobilité' />
2626 </ >
2727 )
Original file line number Diff line number Diff line change @@ -22,18 +22,20 @@ const Notion = ({
2222 description,
2323 recordMap,
2424 previous,
25+ noTitle,
2526} : {
2627 title : string
2728 description ?: string
2829 recordMap : ExtendedRecordMap | undefined
2930 previous ?: { link : string ; label : string }
31+ noTitle ?: boolean
3032} ) => {
3133 const ref = useRef < HTMLDivElement > ( null )
3234 useEffect ( ( ) => {
3335 if ( ref . current ) {
34- improveAccessibility ( ref . current )
36+ improveAccessibility ( ref . current , noTitle )
3537 }
36- } , [ ref ] )
38+ } , [ ref , noTitle ] )
3739
3840 return (
3941 < >
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export const getNotionContentProps = unstable_cache(
1717 { revalidate : getRevalidate ( process . env . NOTION_TABLE_REVALIDATE ) }
1818)
1919
20- export const improveAccessibility = ( ref : HTMLDivElement ) => {
20+ export const improveAccessibility = ( ref : HTMLDivElement , noTitle ?: boolean ) => {
2121 const elements = ref . getElementsByTagName ( 'svg' )
2222 for ( const element of elements ) {
2323 element . setAttribute ( 'alt' , '' )
@@ -54,4 +54,11 @@ export const improveAccessibility = (ref: HTMLDivElement) => {
5454 for ( const fastLink of fastLinks ) {
5555 fastLink . remove ( )
5656 }
57+
58+ if ( noTitle ) {
59+ const headers = ref . getElementsByTagName ( 'h1' )
60+ for ( const header of headers ) {
61+ header . remove ( )
62+ }
63+ }
5764}
You can’t perform that action at this time.
0 commit comments