Skip to content

Commit

Permalink
Updated CMS queries; Improved main layout
Browse files Browse the repository at this point in the history
  • Loading branch information
rlebre committed Oct 27, 2022
1 parent 2d73aa8 commit 428df9d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 69 deletions.
46 changes: 21 additions & 25 deletions components/cookies-consent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,27 @@ const CookiesConsentBanner = () => {
[setChose]
);

return (
<>
{chose === 'NA' && (
<div className={styles.cookies__consent}>
<span className='font-medium w-7/8'>
This website uses cookies to ensure to gather anonymous data for statistical purposes. If you decline we
will stop to track your session.
</span>
<div className='flex flex-wrap gap-2 justify-end'>
<button
className={styles.cookies__accept}
onClick={() => {
cookiesAccepted('ACCEPTED');
}}
>
Accept
</button>
<button className={styles.cookies__decline} onClick={() => cookiesAccepted('DECLINED')}>
Decline
</button>
</div>
</div>
)}
</>
);
return chose === 'NA' ? (
<div className={styles.cookies__consent}>
<span className='font-medium w-7/8'>
This website uses cookies to ensure to gather anonymous data for statistical purposes. If you decline we will
stop to track your session.
</span>
<div className='flex flex-wrap gap-2 justify-end'>
<button
className={styles.cookies__accept}
onClick={() => {
cookiesAccepted('ACCEPTED');
}}
>
Accept
</button>
<button className={styles.cookies__decline} onClick={() => cookiesAccepted('DECLINED')}>
Decline
</button>
</div>
</div>
) : null;
};

export const CookieConsentProvider = ({ children }: { children: React.ReactNode }) => {
Expand Down
78 changes: 37 additions & 41 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,52 +37,48 @@ const Home: NextPage<HomeProps> = ({ about, applications, features, resources, c
))}
</Carousel>

<div className='container'>
<main className={styles.main}>
<FlatSection title='About' subtitle1={about.subtitle1} subtitle2={about.subtitle2}>
<div className='flex items-center'>{about.about}</div>
</FlatSection>
<main className={styles.main}>
<FlatSection title='About' subtitle1={about.subtitle1} subtitle2={about.subtitle2}>
<div className='flex items-center'>{about.about}</div>
</FlatSection>

<GridSection title='Applications'>
{applications.map(({ attributes }) => (
<HomeCard key={`application-${attributes.title}`} {...attributes}></HomeCard>
))}
</GridSection>
<GridSection title='Applications'>
{applications.map(({ attributes }) => (
<HomeCard key={`application-${attributes.title}`} {...attributes}></HomeCard>
))}
</GridSection>

<GridSection title='Features'>
{features.map(({ attributes }) => (
<HomeCard key={`feature-${attributes.title}`} {...attributes}></HomeCard>
))}
</GridSection>
<GridSection title='Features'>
{features.map(({ attributes }) => (
<HomeCard key={`feature-${attributes.title}`} {...attributes}></HomeCard>
))}
</GridSection>

<GridSection title='Resources'>
<>
<div className='w-full'>
<p>Dicoogle is a free and open source software.</p>
<p>The code is available and you can freely contribute to its development.</p>
<GridSection title='Resources'>
<div className='w-full'>
<p>Dicoogle is a free and open source software.</p>
<p>The code is available and you can freely contribute to its development.</p>

<p>
Dicoogle source code is under{' '}
<Link href='http://www.gnu.org/copyleft/gpl.en.html'>
<a rel='nofollow noreferrer' target='_blank' className='font-semibold'>
GNU General Public License v3.0.
</a>
</Link>
</p>
</div>
<p>
Dicoogle source code is under{' '}
<Link href='http://www.gnu.org/copyleft/gpl.en.html'>
<a rel='nofollow noreferrer' target='_blank' className='font-semibold'>
GNU General Public License v3.0.
</a>
</Link>
</p>
</div>

{resources.map(({ attributes }) => (
<Button
key={`resource-${attributes.title}`}
href={attributes.link}
label={attributes.title}
style='button2'
/>
))}
</>
</GridSection>
</main>
</div>
{resources.map(({ attributes }) => (
<Button
key={`resource-${attributes.title}`}
href={attributes.link}
label={attributes.title}
style='button2'
/>
))}
</GridSection>
</main>
</>
);
};
Expand Down
3 changes: 3 additions & 0 deletions services/cookie.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const getCookieNotice = () => {
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/cookie-notice`).then((res) => res.json());
};
2 changes: 1 addition & 1 deletion services/documentation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const getDocumentation = () => {
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/documentations?populate=*`)
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/cards?filters[type][$eq]=documentation&populate=*`)
.then((res) => res.json())
.then((res) => res.data);
};
8 changes: 6 additions & 2 deletions services/index-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ export const getAbout = () => {
};

export const getApplications = () => {
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/home-applications?populate=image`).then((res) => res.json());
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/cards?filters[type][$eq]=application&populate=*`).then((res) =>
res.json()
);
};

export const getFeatures = () => {
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/home-features?populate=image`).then((res) => res.json());
return fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/cards?filters[type][$eq]=feature&populate=*`).then((res) =>
res.json()
);
};

export const getResources = () => {
Expand Down
1 change: 1 addition & 0 deletions styles/Home.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
justify-content: center;
align-items: center;
@apply md:mt-24;
@apply container;
}

.footer {
Expand Down

0 comments on commit 428df9d

Please sign in to comment.