Skip to content

Commit 47b7c2d

Browse files
TSOND-652 | Compass Redesign and ADA compliance updates
1 parent 7b1b752 commit 47b7c2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1623
-1722
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.11.0
1+
v22.14.0

MainLayout/MainLayout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import React, { useEffect, useState } from 'react'
44
import { Footer, Header } from '@/components'
55
import { App } from '@/types'
66

7-
import { onEntryChange } from '@/config'
87
import useRouterHook from '@/hooks/useRouterHook'
98
import { LocaleContext, usePersonalization } from '@/context'
109
import { footerJsonRtePathIncludes, footerReferenceIncludes, getEntries, navigationReferenceIncludes } from '@/services'
10+
import { onEntryChange } from '@/config'
1111

1212
const MainLayout: React.FC<App.MainLayout> = (
1313
props: React.PropsWithChildren<App.MainLayout>
@@ -43,7 +43,7 @@ const MainLayout: React.FC<App.MainLayout> = (
4343
console.error('Main Layout failed to load,\n', err)
4444
}
4545
}
46-
46+
4747
useEffect(() => {
4848
onEntryChange(fetchAppConfig)
4949
}, [])

app/[locale]/[...slug]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { NotFoundComponent, PageWrapper } from '@/components'
99
import { onEntryChange } from '@/config'
1010
import useRouterHook from '@/hooks/useRouterHook'
1111
import { setDataForChromeExtension } from '@/utils'
12-
import { imageCardsReferenceIncludes, teaserReferenceIncludes, textAndImageReferenceIncludes, textJSONRtePaths } from '@/services/helper'
12+
import { heroReferenceIncludes, imageCardsReferenceIncludes, teaserReferenceIncludes, textAndImageReferenceIncludes, textJSONRtePaths } from '@/services/helper'
1313
import { getEntryByUrl } from '@/services'
1414
import { usePersonalization } from '@/context'
1515

@@ -50,6 +50,7 @@ export default function LandingPage () {
5050
const fetchData = async () => {
5151
try {
5252
const refUids = [
53+
...heroReferenceIncludes,
5354
...textAndImageReferenceIncludes,
5455
...teaserReferenceIncludes,
5556
...imageCardsReferenceIncludes
@@ -78,6 +79,7 @@ export default function LandingPage () {
7879
? <PageWrapper {...data}>
7980
{data?.components
8081
? <RenderComponents $={data?.$}
82+
hero={data?.hero && Array.isArray(data.hero) ? data.hero[0] : data.hero}
8183
components={data?.components}
8284
isABEnabled={isABTestEnabled}
8385
/> : ''}

app/[locale]/article/[...slug]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { getEntries, getEntryByUrl } from '@/services'
2121
*
2222
* @returns {JSX.Element}
2323
*/
24+
2425
export default function Article () {
2526
const { personalizationSDK, personalizeConfig } = usePersonalization()
2627
const [data, setData] = useState<Page.ArticlePage['entry'] | null>(null)
@@ -156,11 +157,11 @@ export default function Article () {
156157
return (
157158
data ? <>
158159
<PageWrapper {...data}>
159-
<ArticleCover
160-
title={title}
160+
<ArticleCover title={title}
161161
summary={summary}
162162
cover_image={cover_image}
163163
$={$}
164+
_content_type_uid={'article'}
164165
/>
165166
<Text
166167
content={content}

app/[locale]/articles/[...slug]/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default function Article () {
5656
&& <CardCollection
5757
cards={articlesList}
5858
count={cards?.length}
59+
className='mb-25'
5960
/> }
6061
</>
6162
)
@@ -148,19 +149,19 @@ export default function Article () {
148149

149150
return (<>
150151
{data && <PageWrapper {...data}>
151-
{data?.title && <div className='pt-16 px-8 mb-16 bg-background-primary dark:bg-white text-center max-w-7xl mx-auto'>
152-
<h1 className='mx-auto text-black' {...data?.$?.title}>{data?.title}</h1>
152+
{data?.title && <div className='my-25 mx-[2.25rem] md:mx-[5.25rem] bg-background-primary dark:bg-white'>
153+
<h1 className='text-stone max-w-max' {...data?.$?.title}>{data?.title}</h1>
153154
</div>}
154-
{data?.components ? (
155+
{(data?.components?.length > 0) ? (
155156
<RenderComponents $={data?.$}
156157
components={data?.components}
157158
/>
158159
) : <></>}
159160
</PageWrapper>}
160-
<div className='card-collection mt-16' id='pagination-scroll-anchor'>
161+
<div className='card-collection mx-[2.25rem] md:mx-[5.25rem]' id='pagination-scroll-anchor'>
161162
<RenderCardCollection />
162163
{ // Pagination component
163-
cards?.length > 12 && <div className='py-8 px-8 xl:px-0 bg-background-primary dark:bg-transparent text-center max-w-7xl mx-auto'>
164+
cards?.length > 12 && <div className='my-25 bg-background-primary dark:bg-transparent text-center'>
164165
<Pagination
165166
length={cards?.length}
166167
dataPerPage={articlesPerPage}

app/[locale]/articles/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default function ArticleListing () {
4949
id='articles-card-collection'
5050
cards={articlesList}
5151
count={cards?.length}
52+
className='mb-25'
5253
/> }
5354
</>
5455
)
@@ -122,19 +123,19 @@ export default function ArticleListing () {
122123

123124
return ( <>
124125
{data && <PageWrapper {...data}>
125-
{data?.title && <div className='pt-16 px-8 mb-16 bg-background-primary dark:bg-white text-center max-w-7xl mx-auto'>
126-
<h1 data-id='h1' className='mx-auto text-black' {...data?.$?.title}>{data?.title}</h1>
126+
{data?.title && <div className='my-25 md:max-w-[45.635%] mx-[2.25rem] md:mx-[5.25rem] bg-background-primary dark:bg-white'>
127+
<h1 data-id='h1' className='text-stone max-w-max' {...data?.$?.title}>{data?.title}</h1>
127128
</div>}
128-
{data?.components ? (
129+
{(data?.components?.length > 0) ? (
129130
<RenderComponents $={data?.$}
130131
components={data?.components}
131132
/>
132133
) : <></>}
133134
</PageWrapper>}
134-
<div className='card-collection mt-16' id='pagination-scroll-anchor'>
135+
<div className='card-collection mx-[2.25rem] md:mx-[5.25rem]' id='pagination-scroll-anchor'>
135136
<RenderCardCollection />
136137
{ // Paginaion component
137-
cards?.length > 12 && <div className='py-8 px-8 xl:px-0 bg-background-primary dark:bg-transparent text-center max-w-7xl mx-auto'>
138+
cards?.length > 12 && <div className='my-25 bg-background-primary dark:bg-transparent text-center'>
138139
<Pagination
139140
length={cards?.length}
140141
dataPerPage={articlesPerPage}

app/[locale]/layout.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import type { Metadata } from 'next'
2-
import { Inter } from 'next/font/google'
2+
import { Inter, Roboto_Condensed } from 'next/font/google'
33

44
import { MainLayout } from '@/MainLayout'
55
import 'slick-carousel/slick/slick.css'
66
import 'slick-carousel/slick/slick-theme.css'
77
import '../globals.css'
88
import '/node_modules/flag-icons/css/flag-icons.min.css'
9-
import {PersonalizationProvider} from '@/context'
9+
import { PersonalizationProvider } from '@/context'
1010

1111
const inter = Inter({ subsets: ['latin'] })
1212

13+
/* https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap */
14+
const robotoCondensed = Roboto_Condensed({
15+
subsets: ['latin'],
16+
weight: ['200', '300', '400', '500', '600', '700'],
17+
style: ['normal', 'italic']
18+
})
19+
1320
export const metadata: Metadata = {
1421
title: 'Compass starter',
1522
description: 'Provided by Contentstack'
@@ -24,12 +31,14 @@ export const metadata: Metadata = {
2431
export default async function RootLayout ({
2532
children
2633
}: Readonly<{
27-
children: React.ReactNode;
34+
children: React.ReactNode;
2835
}>) {
2936

3037
return (
3138
<html lang='en'>
32-
<body className={inter.className}>
39+
<body
40+
className={`${robotoCondensed.className} ${inter.className}`}
41+
>
3342
<PersonalizationProvider>
3443
<MainLayout>
3544
{children}

app/[locale]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { NotFoundComponent, PageWrapper } from '@/components'
66
import { onEntryChange } from '@/config'
77
import useRouterHook from '@/hooks/useRouterHook'
88
import { isDataInLiveEdit, setDataForChromeExtension } from '@/utils'
9-
import { featuredArticlesReferenceIncludes, imageCardsReferenceIncludes, teaserReferenceIncludes, textAndImageReferenceIncludes, textJSONRtePaths } from '@/services/helper'
9+
import { featuredArticlesReferenceIncludes, heroReferenceIncludes, imageCardsReferenceIncludes, teaserReferenceIncludes, textAndImageReferenceIncludes, textJSONRtePaths } from '@/services/helper'
1010
import { getEntryByUrl } from '@/services'
1111
import { usePersonalization } from '@/context'
1212

@@ -35,6 +35,7 @@ export default function Home () {
3535
const fetchData = async () => {
3636
try {
3737
const refUids = [
38+
...heroReferenceIncludes,
3839
...textAndImageReferenceIncludes,
3940
...teaserReferenceIncludes,
4041
...imageCardsReferenceIncludes,
@@ -68,6 +69,7 @@ export default function Home () {
6869
? <PageWrapper {...data}>
6970
{data?.components
7071
? <RenderComponents $={data?.$}
72+
hero={data?.hero && Array.isArray(data.hero) ? data.hero[0] : data.hero}
7173
components={[
7274
// eslint-disable-next-line no-unsafe-optional-chaining
7375
...data?.components

app/favicon.ico

3.51 KB
Binary file not shown.

0 commit comments

Comments
 (0)