Merge branch 'feature/optimization' into develop

develop
Näser 3 years ago
commit 851973d740

@ -35,17 +35,20 @@ export function CardBlogDetails({item = {}}: CardBlogDetailsProps) {
</h2> </h2>
<section className="flex items-center justify-between"> <section className="flex items-center justify-between">
<div className="flex"> <div className="flex">
<a href="#" <span className="flex items-center">
className="flex items-center">
<img <img
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=731&amp;q=80" src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=731&amp;q=80"
alt="avatar" alt="avatar"
width="auto"
height="auto"
className="mr-4 w-10 h-10 object-cover rounded-full hidden sm:block" /> className="mr-4 w-10 h-10 object-cover rounded-full hidden sm:block" />
<h3 className="text-gray-700 text-normal font-bold hover:underline text-slate-400">Par Alex John</h3> <h3 className="text-gray-700 text-normal font-bold hover:underline text-slate-400">Par Alex John</h3>
</a> </span>
</div> </div>
<div className="flex flex-col"> <div className="flex flex-col">
<a href={getCategoryUrl(item)} <a href={getCategoryUrl(item)}
title={"Accédez à la catégorie " + delve(item, 'category.data.attributes.name', 'N/A')}
aria-label={"Accédez à la catégorie " + delve(item, 'category.data.attributes.name', 'N/A')}
className="px-2 py-1 text-sm bg-gray-600 text-gray-100 font-bold rounded hover:bg-gray-500"> className="px-2 py-1 text-sm bg-gray-600 text-gray-100 font-bold rounded hover:bg-gray-500">
{delve(item, 'category.data.attributes.name', 'N/A')} {delve(item, 'category.data.attributes.name', 'N/A')}
</a> </a>
@ -81,8 +84,7 @@ export function CardBlogDetails({item = {}}: CardBlogDetailsProps) {
<FacebookMessengerShareButton <FacebookMessengerShareButton
url={shareUrl} url={shareUrl}
appId="521270401588372" appId="521270401588372"
className="Demo__some-network__share-button" className="Demo__some-network__share-button">
>
<FacebookMessengerIcon size={32} <FacebookMessengerIcon size={32}
round /> round />
</FacebookMessengerShareButton> </FacebookMessengerShareButton>

@ -27,6 +27,8 @@ export function CardBlog({item}: CardBlogProps) {
text-gray-600 text-gray-600
dark:text-gray-300">{format(new Date(delve(item, 'attributes.publishedAt', 'Jun 1, 2020')), 'dd/MM/yyyy')}</span> dark:text-gray-300">{format(new Date(delve(item, 'attributes.publishedAt', 'Jun 1, 2020')), 'dd/MM/yyyy')}</span>
<a href={getCategoryUrl(item)} <a href={getCategoryUrl(item)}
title={"Accédez à la catégorie " + delve(item, 'attributes.category.data.attributes.name', 'N/A')}
aria-label={"Accédez à la catégorie " + delve(item, 'attributes.category.data.attributes.name', 'N/A')}
className="px-2 py-1 text-sm font-bold rounded className="px-2 py-1 text-sm font-bold rounded
bg-gray-600 text-gray-100 bg-gray-600 text-gray-100
hover:bg-gray-500"> hover:bg-gray-500">
@ -35,6 +37,8 @@ export function CardBlog({item}: CardBlogProps) {
</div> </div>
<div className="mt-2"> <div className="mt-2">
<a <a
title={"Lire l'article " + delve(item, 'attributes.title', 'N/A')}
aria-label={"Lire l'article " + delve(item, 'attributes.title', 'N/A')}
href={getPostUrl(item)} href={getPostUrl(item)}
className="text-xl font-bold hover:underline className="text-xl font-bold hover:underline
text-gray-700 text-gray-700
@ -47,18 +51,21 @@ export function CardBlog({item}: CardBlogProps) {
</div> </div>
<div className="flex justify-between items-center mt-4"> <div className="flex justify-between items-center mt-4">
<a href={getPostUrl(item)} <a href={getPostUrl(item)}
title={"Lire l'article " + delve(item, 'attributes.title', 'N/A')}
aria-label={"Lire l'article " + delve(item, 'attributes.title', 'N/A')}
className="text-blue-500 text-sm hover:underline">Lire l'article</a> className="text-blue-500 text-sm hover:underline">Lire l'article</a>
<div> <div>
<a href="#" <span className="flex items-center">
className="flex items-center">
<img <img
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=731&amp;q=80" src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=731&amp;q=80"
alt="avatar" alt="avatar"
width="auto"
height="auto"
className="mx-4 w-10 h-10 object-cover rounded-full hidden sm:block" /> className="mx-4 w-10 h-10 object-cover rounded-full hidden sm:block" />
<h3 className="text-normal font-bold hover:underline <h3 className="text-normal font-bold hover:underline
text-gray-700 text-gray-700
dark:text-gray-300">Alex John</h3> dark:text-gray-300">Alex John</h3>
</a> </span>
</div> </div>
</div> </div>
</div> </div>

@ -6,8 +6,13 @@ export function Footer({items = []}) {
const value = delve(item, 'attributes', {}); const value = delve(item, 'attributes', {});
return ( return (
<li key={value.title + index} className="my-1"> <li key={value.title + index}
<a href={value.url} target={value.target} className="mr-4 hover:underline md:mr-6 "> className="my-1 h-10 flex align-middle items-center md:h-auto">
<a href={value.url}
target={value.target}
title={"Accédez à la page " + value.title}
aria-label={"Accédez à la page " + value.title}
className="mr-4 hover:underline md:mr-6 ">
{value.title} {value.title}
</a> </a>
</li> </li>
@ -17,17 +22,27 @@ export function Footer({items = []}) {
return ( return (
<footer className="p-4 bg-white md:px-6 md:py-8 dark:bg-gray-900"> <footer className="p-4 bg-white md:px-6 md:py-8 dark:bg-gray-900">
<div className="sm:flex sm:items-center sm:justify-between"> <div className="sm:flex sm:items-center sm:justify-between">
<a href="/" className="flex items-center mb-4 sm:mb-0"> <a href="/"
<img src="https://flowbite.com/docs/images/logo.svg" className="h-8 mr-3" alt="Flowbite Logo"/> aria-label="Page d'accueil MeCP"
title="Page d'accueil MeCP"
className="flex items-center mb-4 sm:mb-0">
<img src="https://flowbite.com/docs/images/logo.svg"
className="h-8 mr-3"
height="auto"
width="auto"
alt="Flowbite Logo" />
<span className="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">MeCP</span> <span className="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">MeCP</span>
</a> </a>
<ul className="flex flex-wrap items-center mb-6 text-sm text-gray-500 sm:mb-0 dark:text-gray-400"> <ul className="flex flex-wrap items-center justify-end mb-6 text-sm text-gray-500 sm:mb-0 dark:text-gray-400">
{items.map((item, index: number) => generateItem(item, index))} {items.map((item, index: number) => generateItem(item, index))}
</ul> </ul>
</div> </div>
<hr className="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" /> <hr className="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" />
<span className="block text-sm text-gray-500 sm:text-center dark:text-gray-400">© 3 <a <span className="block text-sm text-gray-500 sm:text-center dark:text-gray-400">©2023
href="https://flowbite.com/" className="hover:underline">Flowbite</a>. All Rights Reserved. <a href="/"
aria-label="Page d'accueil MeCP"
title="Page d'accueil MeCP"
className="hover:underline"> MeCP</a>. All Rights Reserved.
</span> </span>
</footer> </footer>
); );

@ -50,6 +50,8 @@ export function Header({items = []}) {
return ( return (
<a href={item.url} <a href={item.url}
target={item.target} target={item.target}
title={"Accédez à la page " + item.title}
aria-label={"Accédez à la page " + item.title}
className={"text-gray-900 hover:text-blue-600 dark:text-gray-400 dark:hover:bg-transparent dark:hover:text-gray-500 " + (isActive ? 'text-blue-600 dark:text-gray-500' : '') + " block py-2 pl-3 pr-4 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:p-0"} className={"text-gray-900 hover:text-blue-600 dark:text-gray-400 dark:hover:bg-transparent dark:hover:text-gray-500 " + (isActive ? 'text-blue-600 dark:text-gray-500' : '') + " block py-2 pl-3 pr-4 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:p-0"}
aria-current="page">{item.title}</a> aria-current="page">{item.title}</a>
) )
@ -60,6 +62,8 @@ export function Header({items = []}) {
return ( return (
<li key={value.title + index}> <li key={value.title + index}>
<a href={value.url} <a href={value.url}
title={"Accédez à la page " + value.title}
aria-label={"Accédez à la page " + value.title}
className="text-gray-900 dark:text-gray-400 hover:text-blue-600 dark:hover:text-gray-500"> className="text-gray-900 dark:text-gray-400 hover:text-blue-600 dark:hover:text-gray-500">
{value.title} {value.title}
</a> </a>
@ -86,7 +90,8 @@ export function Header({items = []}) {
<div id="menu-dropdown" <div id="menu-dropdown"
className="absolute z-10 grid hidden w-auto text-sm bg-white border border-gray-100 rounded-lg shadow-md dark:border-gray-700 dark:bg-gray-700"> className="absolute z-10 grid hidden w-auto text-sm bg-white border border-gray-100 rounded-lg shadow-md dark:border-gray-700 dark:bg-gray-700">
<div className="p-4 pb-0 text-gray-900 md:pb-4 dark:text-white"> <div className="p-4 pb-0 text-gray-900 md:pb-4 dark:text-white">
<ul className="space-y-4" aria-labelledby="mega-menu-dropdown-button"> <ul className="space-y-4"
aria-labelledby="mega-menu-dropdown-button">
{item.children.data.map((children, index) => renderRegularDropdownItem(children, index))} {item.children.data.map((children, index) => renderRegularDropdownItem(children, index))}
</ul> </ul>
</div> </div>
@ -99,6 +104,8 @@ export function Header({items = []}) {
return ( return (
<> <>
<a href="/sign-in" <a href="/sign-in"
title="Page de connexion"
aria-label="Page de connexion"
className="text-gray-800 dark:text-white hover:bg-gray-50 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-4 py-2 md:px-5 md:py-2.5 mr-1 md:mr-2 dark:hover:bg-gray-700 focus:outline-none dark:focus:ring-gray-800"> className="text-gray-800 dark:text-white hover:bg-gray-50 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-4 py-2 md:px-5 md:py-2.5 mr-1 md:mr-2 dark:hover:bg-gray-700 focus:outline-none dark:focus:ring-gray-800">
<span className="hidden lg:block">Connexion</span> <span className="hidden lg:block">Connexion</span>
<span className="block lg:hidden"> <span className="block lg:hidden">
@ -106,6 +113,8 @@ export function Header({items = []}) {
</span> </span>
</a> </a>
<a href="/sign-up" <a href="/sign-up"
title="Page d'inscription"
aria-label="Page d'inscription"
className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 md:px-5 md:py-2.5 mr-1 md:mr-2 dark:bg-dark-600 dark:hover:bg-dark-500 focus:outline-none dark:focus:ring-blue-800"> className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 md:px-5 md:py-2.5 mr-1 md:mr-2 dark:bg-dark-600 dark:hover:bg-dark-500 focus:outline-none dark:focus:ring-blue-800">
<span className="hidden lg:block">Inscription</span> <span className="hidden lg:block">Inscription</span>
<span className="block lg:hidden"> <span className="block lg:hidden">
@ -120,11 +129,13 @@ export function Header({items = []}) {
return ( return (
<> <>
<button type="button" <button type="button"
role="button"
className="flex mr-3 text-sm bg-gray-800 rounded-full md:mr-0 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600" className="flex mr-3 text-sm bg-gray-800 rounded-full md:mr-0 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600"
id="user-menu-button" id="user-menu-button"
aria-label="Options de l'utilisateur"
aria-expanded="false" aria-expanded="false"
data-dropdown-placement="bottom"> data-dropdown-placement="bottom">
<span className="sr-only">Open user menu</span> <span className="sr-only">Options de l'utilisateur</span>
<img className="w-8 h-8 rounded-full" <img className="w-8 h-8 rounded-full"
src={hasAvatar((session.user as any)) ? getBackendImg((session.user as any).avatar.formats.thumbnail.url) : siteConfig.defaultUserAvatar} src={hasAvatar((session.user as any)) ? getBackendImg((session.user as any).avatar.formats.thumbnail.url) : siteConfig.defaultUserAvatar}
alt="user photo" /> alt="user photo" />
@ -137,31 +148,40 @@ export function Header({items = []}) {
<span <span
className="block text-sm font-medium text-gray-500 truncate dark:text-gray-400">{session.user.email}</span> className="block text-sm font-medium text-gray-500 truncate dark:text-gray-400">{session.user.email}</span>
</div> </div>
<ul className="py-1" aria-labelledby="user-menu-button"> <ul className="py-1"
aria-labelledby="user-menu-button">
<li> <li>
<a href="#" <a href="#"
aria-label="Profile"
title="Profile"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"> className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
Dashboard Profile
</a> </a>
</li> </li>
<li> <li>
<a href="#" <a href="#"
aria-label="Paramètres"
title="Paramètres"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"> className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
Settings Paramètres
</a> </a>
</li> </li>
<li> <li>
<a href="#" <a href="#"
aria-label="Mes cours"
title="Mes cours"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"> className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
Earnings Mes cours
</a> </a>
</li> </li>
<li> <li>
<a href="#" <a href="#"
title="Dconnexion"
aria-label="Dconnexion"
// @ts-ignore // @ts-ignore
onClick={signOut} onClick={signOut}
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"> className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
Sign out Déconnexion
</a> </a>
</li> </li>
</ul> </ul>
@ -179,12 +199,24 @@ export function Header({items = []}) {
className="bg-white dark:bg-gray-800 w-full md:w-auto p-2 md:p-4" className="bg-white dark:bg-gray-800 w-full md:w-auto p-2 md:p-4"
id="navbar-default"> id="navbar-default">
<div className="container max-w-screen-xl flex flex-wrap items-center justify-between mx-auto"> <div className="container max-w-screen-xl flex flex-wrap items-center justify-between mx-auto">
<a href="/" className="flex items-center"> <a href="/"
<img src="https://flowbite.com/docs/images/logo.svg" className="h-6 mr-3 sm:h-9" alt="Flowbite Logo"/> aria-label="Page d'accueil MeCP"
title="Page d'accueil MeCP"
className="flex items-center">
<img src="https://flowbite.com/docs/images/logo.svg"
className="h-6 mr-3 sm:h-9"
height="auto"
width="auto"
alt="Flowbite Logo" />
<span className="self-center text-xl font-semibold whitespace-nowrap dark:text-white">MeCP</span> <span className="self-center text-xl font-semibold whitespace-nowrap dark:text-white">MeCP</span>
</a> </a>
<div className="flex items-center"> <div className="flex items-center">
<button <button
id="shop-panel-button"
name="shop-panel-button"
aria-label="Accéder au panier d'achat"
role="button"
type="button"
className="text-gray-700 border border-transparent hover:bg-gray-200 hover:text-white focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm p-2.5 text-center inline-flex items-center mr-2 dark:text-blue-500 dark:hover:text-white dark:focus:ring-blue-800"> className="text-gray-700 border border-transparent hover:bg-gray-200 hover:text-white focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm p-2.5 text-center inline-flex items-center mr-2 dark:text-blue-500 dark:hover:text-white dark:focus:ring-blue-800">
<FontAwesomeIcon icon={faBagShopping} /> <FontAwesomeIcon icon={faBagShopping} />
</button> </button>
@ -193,11 +225,16 @@ export function Header({items = []}) {
<button id="menu-button" <button id="menu-button"
type="button" type="button"
role="navigation"
className="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" className="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
aria-label="Déplier le menu"
aria-controls="navbar-dropdown" aria-controls="navbar-dropdown"
aria-expanded="false"> aria-expanded="false">
<span className="sr-only">Open main menu</span> <span className="sr-only">Open main menu</span>
<svg className="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" <svg className="w-6 h-6"
aria-hidden="true"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"> xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" <path fillRule="evenodd"
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
@ -208,7 +245,8 @@ export function Header({items = []}) {
</div> </div>
</section> </section>
<hr className="border-gray-100 dark:border-gray-700 container max-w-screen-xl mx-auto" /> <hr className="border-gray-100 dark:border-gray-700 container max-w-screen-xl mx-auto" />
<section className="hidden w-full md:block md:w-auto" id="navbar-dropdown"> <section className="hidden w-full md:block md:w-auto"
id="navbar-dropdown">
<div className="container max-w-screen-xl mx-auto"> <div className="container max-w-screen-xl mx-auto">
<ul className="flex flex-col md:p-4 font-medium md:flex-row md:space-x-8 md:mt-0"> <ul className="flex flex-col md:p-4 font-medium md:flex-row md:space-x-8 md:mt-0">
{items.map((item, index: number) => renderGenerateItem(item, index))} {items.map((item, index: number) => renderGenerateItem(item, index))}

@ -23,6 +23,8 @@ export function HomeSectionBlogUne({item}: HomeSectionBlogUneProps) {
</div> </div>
<div className="flex justify-between items-center absolute right-5 top-5"> <div className="flex justify-between items-center absolute right-5 top-5">
<a href={getCategoryUrl(item)} <a href={getCategoryUrl(item)}
title={"Accédez à la catégorie " + delve(item, 'attributes.category.data.attributes.name', 'N/A')}
aria-label={"Accédez à la catégorie " + delve(item, 'attributes.category.data.attributes.name', 'N/A')}
className="px-2 py-1 text-sm bg-gray-600 text-gray-100 font-bold rounded hover:bg-gray-500"> className="px-2 py-1 text-sm bg-gray-600 text-gray-100 font-bold rounded hover:bg-gray-500">
{delve(item, 'attributes.category.data.attributes.name', 'N/A')} {delve(item, 'attributes.category.data.attributes.name', 'N/A')}
</a> </a>
@ -40,6 +42,8 @@ export function HomeSectionBlogUne({item}: HomeSectionBlogUneProps) {
<div className="mt-2"> <div className="mt-2">
<a <a
href={getPostUrl(item)} href={getPostUrl(item)}
title={"Accédez à l'article " + delve(item, 'attributes.title', 'N/A')}
aria-label={"Accédez à l'article " + delve(item, 'attributes.title', 'N/A')}
className="text-xl font-bold hover:underline className="text-xl font-bold hover:underline
text-gray-700 text-gray-700
dark:text-gray-200"> dark:text-gray-200">
@ -52,18 +56,22 @@ export function HomeSectionBlogUne({item}: HomeSectionBlogUneProps) {
<div className="flex justify-between items-center mt-4"> <div className="flex justify-between items-center mt-4">
<a href={getPostUrl(item)} <a href={getPostUrl(item)}
title={"Accédez à l'article " + delve(item, 'attributes.title', 'N/A')}
aria-label={"Accédez à l'article " + delve(item, 'attributes.title', 'N/A')}
className="text-blue-500 text-sm hover:underline">Lire l'article</a> className="text-blue-500 text-sm hover:underline">Lire l'article</a>
<div> <div>
<a href="#" <span
className="flex items-center"> className="flex items-center">
<img <img
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=731&amp;q=80" src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=731&amp;q=80"
alt="avatar" alt="avatar"
width="auto"
height="auto"
className="mx-4 w-10 h-10 object-cover rounded-full hidden sm:block" /> className="mx-4 w-10 h-10 object-cover rounded-full hidden sm:block" />
<h3 className="text-normal font-bold hover:underline <h3 className="text-normal font-bold hover:underline
text-gray-700 text-gray-700
dark:text-gray-300">Alex John</h3> dark:text-gray-300">Alex John</h3>
</a> </span>
</div> </div>
</div> </div>
</main> </main>

@ -1,7 +1,12 @@
import styles from './home-section-video.module.scss'; import dynamic from "next/dynamic";
import {environment} from "../../environments/environment";
const ReactPlayer = dynamic(() => import("react-player"), { ssr: false });
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface HomeSectionVideoProps {} export interface HomeSectionVideoProps {
}
export function HomeSectionVideo(props: HomeSectionVideoProps) { export function HomeSectionVideo(props: HomeSectionVideoProps) {
return ( return (
@ -12,12 +17,12 @@ export function HomeSectionVideo(props: HomeSectionVideoProps) {
</h2> </h2>
<p className="text-lg text-gray-500 mb-10 text-center px-4 md:px-0">Rien ne vaut une démonstration pour convaincre !</p> <p className="text-lg text-gray-500 mb-10 text-center px-4 md:px-0">Rien ne vaut une démonstration pour convaincre !</p>
<iframe src="https://embed.api.video/vod/vi2JpEFEClejM7A4hhn6i7fU" <div className="player-wrapper max-w-[640px] mx-auto">
width="90%" <ReactPlayer width="100%"
frameBorder="0" height="100%"
scrolling="no" controls={true}
className="mx-auto" url={environment.strapiUrl + "/uploads/record_player_011_c87b14fd49.mp4"} />
allowFullScreen={true}></iframe> </div>
</section> </section>
</> </>

@ -50,6 +50,24 @@ const getPageMetadata = async (path) => {
} }
} }
const getCategoryMetadata = async (categorySlug) => {
try {
return await axios.get(`${environment.strapiApiUrl}/categories?filters[slug]=${categorySlug}&populate=deep`);
} catch (e) {
console.error(e);
return Promise.resolve({});
}
}
const getPostMetadata = async (postSlug) => {
try {
return await axios.get(`${environment.strapiApiUrl}/articles?filters[slug]=${postSlug}&populate=deep`);
} catch (e) {
console.error(e);
return Promise.resolve({});
}
}
const CustomApp = ({Component, pageProps: {session, ...pageProps}, menuFooter, menuHeader, seo}: CustomAppProps) => { const CustomApp = ({Component, pageProps: {session, ...pageProps}, menuFooter, menuHeader, seo}: CustomAppProps) => {
pageProps = {...pageProps, menuFooter, menuHeader, seo}; pageProps = {...pageProps, menuFooter, menuHeader, seo};
@ -68,7 +86,18 @@ CustomApp.getInitialProps = async (context) => {
const path = context.router.pathname; const path = context.router.pathname;
const menuHeader = await axios.get(`${environment.strapiApiUrl}/menus/1?nested&populate=deep`); const menuHeader = await axios.get(`${environment.strapiApiUrl}/menus/1?nested&populate=deep`);
const menuFooter = await axios.get(`${environment.strapiApiUrl}/menus/2?nested&populate=deep`); const menuFooter = await axios.get(`${environment.strapiApiUrl}/menus/2?nested&populate=deep`);
const page = await getPageMetadata(path); let page = null;
console.log(context.ctx.query);
if (context.ctx.query.category_slug && !context.ctx.query.post_slug) {
page = await getCategoryMetadata(context.ctx.query.category_slug);
} else if (context.ctx.query.category_slug && context.ctx.query.post_slug) {
page = await getPostMetadata(context.ctx.query.post_slug);
} else if (Object.keys(context.ctx.query).length === 0) {
page = await getPageMetadata(path);
}
console.log(page);
return { return {
...appProps, ...appProps,

@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/

@ -0,0 +1,22 @@
import SeoConfig from "../../components/seo-config/seo-config";
import Layout from "../../components/layout/layout";
import styles from './index.module.scss';
export function AboutUs({menuHeader, menuFooter, seo}) {
return (
<>
<SeoConfig {...seo} />
<Layout menuHeader={menuHeader}
menuFooter={menuFooter}>
<main className={styles['blog-container'] + " w-full"}>
<div className="container max-w-screen-xl px-6 py-4 md:py-12 h-full mx-auto">
<p>Contenu a venir</p>
</div>
</main>
</Layout>
</>
);
}
export default AboutUs;

@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/

@ -0,0 +1,25 @@
import styles from './index.module.scss';
import SeoConfig from "../../components/seo-config/seo-config";
import Layout from "../../components/layout/layout";
/* eslint-disable-next-line */
export interface ContactUsProps {
}
export function ContactUs({menuHeader, menuFooter, seo}) {
return (
<>
<SeoConfig {...seo} />
<Layout menuHeader={menuHeader}
menuFooter={menuFooter}>
<main className={styles['blog-container'] + " w-full"}>
<div className="container max-w-screen-xl px-6 py-4 md:py-12 h-full mx-auto">
<p>Contenu a venir</p>
</div>
</main>
</Layout>
</>
);
}
export default ContactUs;

@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/

@ -0,0 +1,21 @@
import styles from './index.module.scss';
import SeoConfig from "../../components/seo-config/seo-config";
import Layout from "../../components/layout/layout";
export function Pricing({menuHeader, menuFooter, seo}) {
return (
<>
<SeoConfig {...seo} />
<Layout menuHeader={menuHeader}
menuFooter={menuFooter}>
<main className={styles['blog-container'] + " w-full"}>
<div className="container max-w-screen-xl px-6 py-4 md:py-12 h-full mx-auto">
<p>Contenu a venir</p>
</div>
</main>
</Layout>
</>
);
}
export default Pricing;

@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/

@ -0,0 +1,22 @@
import SeoConfig from "../../components/seo-config/seo-config";
import Layout from "../../components/layout/layout";
import styles from './index.module.scss';
export function SchoolProgramm({menuHeader, menuFooter, seo}) {
return (
<>
<SeoConfig {...seo} />
<Layout menuHeader={menuHeader}
menuFooter={menuFooter}>
<main className={styles['blog-container'] + " w-full"}>
<div className="container max-w-screen-xl px-6 py-4 md:py-12 h-full mx-auto">
<p>Contenu a venir</p>
</div>
</main>
</Layout>
</>
);
}
export default SchoolProgramm;

@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/

@ -0,0 +1,22 @@
import SeoConfig from "../../components/seo-config/seo-config";
import Layout from "../../components/layout/layout";
import styles from './index.module.scss';
export function Teachers({menuHeader, menuFooter, seo}) {
return (
<>
<SeoConfig {...seo} />
<Layout menuHeader={menuHeader}
menuFooter={menuFooter}>
<main className={styles['blog-container'] + " w-full"}>
<div className="container max-w-screen-xl px-6 py-4 md:py-12 h-full mx-auto">
<p>Contenu a venir</p>
</div>
</main>
</Layout>
</>
);
}
export default Teachers;

29
package-lock.json generated

@ -9708,6 +9708,11 @@
"wrap-ansi": "^7.0.0" "wrap-ansi": "^7.0.0"
} }
}, },
"load-script": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz",
"integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA=="
},
"loader-runner": { "loader-runner": {
"version": "4.3.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz",
@ -9907,6 +9912,11 @@
"fs-monkey": "^1.0.3" "fs-monkey": "^1.0.3"
} }
}, },
"memoize-one": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz",
"integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="
},
"merge-descriptors": { "merge-descriptors": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@ -11364,6 +11374,25 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
}, },
"react-player": {
"version": "2.11.2",
"resolved": "https://registry.npmjs.org/react-player/-/react-player-2.11.2.tgz",
"integrity": "sha512-V5bf3g6lIpOjfKPUw18Og+qfizmlv6PQfJojlFiGpkfn/e21w5U4nSXE8vSIrFkfllgCrLM35nNGR1/jYQ8KIw==",
"requires": {
"deepmerge": "^4.0.0",
"load-script": "^1.0.0",
"memoize-one": "^5.1.1",
"prop-types": "^15.7.2",
"react-fast-compare": "^3.0.1"
},
"dependencies": {
"react-fast-compare": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz",
"integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA=="
}
}
},
"react-redux": { "react-redux": {
"version": "8.0.5", "version": "8.0.5",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz",

@ -32,6 +32,7 @@
"react-dom": "18.2.0", "react-dom": "18.2.0",
"react-helmet": "6.0.0", "react-helmet": "6.0.0",
"react-hook-form": "7.42.1", "react-hook-form": "7.42.1",
"react-player": "^2.11.2",
"react-redux": "^8.0.5", "react-redux": "^8.0.5",
"react-share": "^4.4.1", "react-share": "^4.4.1",
"rxjs": "7.8.0", "rxjs": "7.8.0",

Loading…
Cancel
Save