Compare commits
No commits in common. 'feature/homepage' and 'main' have entirely different histories.
feature/ho
...
main
@ -1,20 +0,0 @@
|
|||||||
services:
|
|
||||||
|
|
||||||
sonarqube-server:
|
|
||||||
image: sonarqube:lts-community
|
|
||||||
hostname: sonarqube
|
|
||||||
container_name: sonarqube
|
|
||||||
environment:
|
|
||||||
SONAR_JDBC_URL: jdbc:postgresql://192.168.1.33:5433/sonar
|
|
||||||
SONAR_JDBC_USERNAME: sonar
|
|
||||||
SONAR_JDBC_PASSWORD: sonarpwd
|
|
||||||
SONAR_SEARCH_JAVAADDITIONALOPTS: "-Dbootstrap.system_call_filter=false"
|
|
||||||
volumes:
|
|
||||||
- ./extensions:/opt/sonarqube/extensions
|
|
||||||
- ./logs:/opt/sonarqube/logs
|
|
||||||
ports:
|
|
||||||
- "9000:9000"
|
|
||||||
|
|
||||||
networks:
|
|
||||||
soanrqube-networks:
|
|
||||||
driver: bridge
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
services:
|
|
||||||
|
|
||||||
sonarqube-server:
|
|
||||||
image: sonarqube:lts-community
|
|
||||||
hostname: sonarqube
|
|
||||||
container_name: sonarqube
|
|
||||||
environment:
|
|
||||||
SONAR_JDBC_URL: jdbc:postgresql://192.168.1.33:5433/sonar
|
|
||||||
SONAR_JDBC_USERNAME: sonar
|
|
||||||
SONAR_JDBC_PASSWORD: sonarpwd
|
|
||||||
SONAR_SEARCH_JAVAADDITIONALOPTS: "-Dbootstrap.system_call_filter=false"
|
|
||||||
volumes:
|
|
||||||
- ./data:/opt/sonarqube/data
|
|
||||||
- ./extensions:/opt/sonarqube/extensions
|
|
||||||
- ./logs:/opt/sonarqube/logs
|
|
||||||
ports:
|
|
||||||
- "9000:9000"
|
|
||||||
|
|
||||||
networks:
|
|
||||||
soanrqube-networks:
|
|
||||||
driver: bridge
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
services:
|
|
||||||
|
|
||||||
sonarqube-server:
|
|
||||||
image: docker.io/bitnami/sonarqube:9
|
|
||||||
hostname: sonarqube
|
|
||||||
container_name: sonarqube
|
|
||||||
environment:
|
|
||||||
SONARQUBE_DATABASE_HOST: 192.168.1.33
|
|
||||||
SONARQUBE_DATABASE_PORT_NUMBER: 5433
|
|
||||||
SONARQUBE_DATABASE_USER: sonar
|
|
||||||
SONARQUBE_DATABASE_NAME: sonar
|
|
||||||
SONARQUBE_DATABASE_PASSWORD: sonarpwd
|
|
||||||
SONAR_SEARCH_JAVAADDITIONALOPTS: "-Dbootstrap.system_call_filter=false"
|
|
||||||
volumes:
|
|
||||||
- ./data:/bitnami/sonarqube/data
|
|
||||||
- ./extensions:/bitnami/sonarqube/extensions
|
|
||||||
- ./logsé:/bitnami/sonarqube/logs
|
|
||||||
ports:
|
|
||||||
- "9000:9000"
|
|
||||||
|
|
||||||
networks:
|
|
||||||
soanrqube-networks:
|
|
||||||
driver: bridge
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
services:
|
|
||||||
|
|
||||||
teamcity-server:
|
|
||||||
image: jetbrains/teamcity-server
|
|
||||||
container_name: teamcity-server-instance
|
|
||||||
user: root
|
|
||||||
ports:
|
|
||||||
- 8111:8111
|
|
||||||
networks:
|
|
||||||
- teamcity-networks
|
|
||||||
volumes:
|
|
||||||
- ./server/datadir:/data/teamcity_server/datadir
|
|
||||||
- ./server/logs:/opt/teamcity/logs
|
|
||||||
|
|
||||||
teamcity-agent-1:
|
|
||||||
image: jacobpeddk/teamcity-agent-nodejs
|
|
||||||
container_name: teamcity-agent-nodejs1
|
|
||||||
user: root
|
|
||||||
privileged: true
|
|
||||||
networks:
|
|
||||||
- teamcity-networks
|
|
||||||
volumes:
|
|
||||||
- ./agents/agent-1/conf:/data/teamcity_agent/conf
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
environment:
|
|
||||||
- SERVER_URL=http://teamcity-server:8111
|
|
||||||
- DOCKER_IN_DOCKER=start
|
|
||||||
|
|
||||||
teamcity-agent-2:
|
|
||||||
image: jacobpeddk/teamcity-agent-nodejs
|
|
||||||
container_name: teamcity-agent-nodejs2
|
|
||||||
user: root
|
|
||||||
privileged: true
|
|
||||||
networks:
|
|
||||||
- teamcity-networks
|
|
||||||
volumes:
|
|
||||||
- ./agents/agent-2/conf:/data/teamcity_agent/conf
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
environment:
|
|
||||||
- SERVER_URL=http://teamcity-server:8111
|
|
||||||
- DOCKER_IN_DOCKER=start
|
|
||||||
|
|
||||||
networks:
|
|
||||||
teamcity-networks:
|
|
||||||
driver: bridge
|
|
||||||
@ -1,15 +1,21 @@
|
|||||||
# NxGuitarSchool
|
# NxGuitarSchool
|
||||||
|
|
||||||
### Comptes
|
<a href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
|
||||||
|
|
||||||
#### FTP
|
✨ **This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)** ✨
|
||||||
|
|
||||||
Username : superadmin@naserloud.fr
|
## Development server
|
||||||
mot de passe : =H*S9g**=S$s*(.S5g
|
|
||||||
host : node143-eu.n0c.com
|
|
||||||
|
|
||||||
### SSH
|
Run `nx serve client` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
|
||||||
command : ssh dpxtrufj@node143-eu.n0c.com -port 5502
|
|
||||||
mdp : xVarAG3bsEJe8T
|
|
||||||
|
|
||||||
|
## Understand this workspace
|
||||||
|
|
||||||
|
Run `nx graph` to see a diagram of the dependencies of the projects.
|
||||||
|
|
||||||
|
## Remote caching
|
||||||
|
|
||||||
|
Run `npx nx connect-to-nx-cloud` to enable [remote caching](https://nx.app) and make CI faster.
|
||||||
|
|
||||||
|
## Further help
|
||||||
|
|
||||||
|
Visit the [Nx Documentation](https://nx.dev) to learn more.
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
apt install wget
|
|
||||||
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip
|
|
||||||
unzip sonar-scanner-cli-4.8.0.2856-linux.zip
|
|
||||||
ls -la
|
|
||||||
mv ./sonar-scanner-4.8.0.2856-linux ./sonarscanner
|
|
||||||
cd apps
|
|
||||||
../sonarscanner/bin/sonar-scanner -X -Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287
|
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
export default {
|
||||||
|
displayName: 'client',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
transform: {
|
||||||
|
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
||||||
|
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
|
||||||
|
},
|
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
|
coverageDirectory: '../../coverage/apps/client',
|
||||||
|
};
|
||||||
@ -1,23 +1,16 @@
|
|||||||
//@ts-check
|
//@ts-check
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const {withNx} = require('./with-nx.js');
|
const { withNx } = require('@nrwl/next/plugins/with-nx');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
||||||
**/
|
**/
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
|
||||||
poweredByHeader: false,
|
|
||||||
output: 'standalone',
|
|
||||||
nx: {
|
nx: {
|
||||||
// Set this to true if you would like to to use SVGR
|
// Set this to true if you would like to to use SVGR
|
||||||
// See: https://github.com/gregberge/svgr
|
// See: https://github.com/gregberge/svgr
|
||||||
svgr: false
|
svgr: false,
|
||||||
},
|
|
||||||
images: {
|
|
||||||
loader: "default",
|
|
||||||
domains: ["localhost", "127.0.0.1"],
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
import { AppProps } from 'next/app';
|
||||||
|
import Head from 'next/head';
|
||||||
|
import './styles.css';
|
||||||
|
|
||||||
|
function CustomApp({ Component, pageProps }: AppProps) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
<title>Welcome to client!</title>
|
||||||
|
</Head>
|
||||||
|
<main className="app">
|
||||||
|
<Component {...pageProps} />
|
||||||
|
</main>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CustomApp;
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
.page {
|
||||||
|
}
|
||||||
@ -0,0 +1,415 @@
|
|||||||
|
import styles from './index.module.scss';
|
||||||
|
|
||||||
|
export function Index() {
|
||||||
|
/*
|
||||||
|
* Replace the elements below with your own.
|
||||||
|
*
|
||||||
|
* Note: The corresponding styles are in the ./index.scss file.
|
||||||
|
*/
|
||||||
|
return (
|
||||||
|
<div className={styles.page}>
|
||||||
|
<div className="wrapper">
|
||||||
|
<div className="container">
|
||||||
|
<div id="welcome">
|
||||||
|
<h1>
|
||||||
|
<span> Hello there, </span>
|
||||||
|
Welcome client 👋
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="hero" className="rounded">
|
||||||
|
<div className="text-container">
|
||||||
|
<h2>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span>You're up and running</span>
|
||||||
|
</h2>
|
||||||
|
<a href="#commands"> What's next? </a>
|
||||||
|
</div>
|
||||||
|
<div className="logo-container">
|
||||||
|
<svg
|
||||||
|
fill="currentColor"
|
||||||
|
role="img"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path d="M11.987 14.138l-3.132 4.923-5.193-8.427-.012 8.822H0V4.544h3.691l5.247 8.833.005-3.998 3.044 4.759zm.601-5.761c.024-.048 0-3.784.008-3.833h-3.65c.002.059-.005 3.776-.003 3.833h3.645zm5.634 4.134a2.061 2.061 0 0 0-1.969 1.336 1.963 1.963 0 0 1 2.343-.739c.396.161.917.422 1.33.283a2.1 2.1 0 0 0-1.704-.88zm3.39 1.061c-.375-.13-.8-.277-1.109-.681-.06-.08-.116-.17-.176-.265a2.143 2.143 0 0 0-.533-.642c-.294-.216-.68-.322-1.18-.322a2.482 2.482 0 0 0-2.294 1.536 2.325 2.325 0 0 1 4.002.388.75.75 0 0 0 .836.334c.493-.105.46.36 1.203.518v-.133c-.003-.446-.246-.55-.75-.733zm2.024 1.266a.723.723 0 0 0 .347-.638c-.01-2.957-2.41-5.487-5.37-5.487a5.364 5.364 0 0 0-4.487 2.418c-.01-.026-1.522-2.39-1.538-2.418H8.943l3.463 5.423-3.379 5.32h3.54l1.54-2.366 1.568 2.366h3.541l-3.21-5.052a.7.7 0 0 1-.084-.32 2.69 2.69 0 0 1 2.69-2.691h.001c1.488 0 1.736.89 2.057 1.308.634.826 1.9.464 1.9 1.541a.707.707 0 0 0 1.066.596zm.35.133c-.173.372-.56.338-.755.639-.176.271.114.412.114.412s.337.156.538-.311c.104-.231.14-.488.103-.74z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="middle-content">
|
||||||
|
<div id="learning-materials" className="rounded shadow">
|
||||||
|
<h2>Learning materials</h2>
|
||||||
|
<a
|
||||||
|
href="https://nx.dev/getting-started/intro?utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="list-item-link"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
Documentation
|
||||||
|
<span> Everything is in there </span>
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M9 5l7 7-7 7"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://blog.nrwl.io/?utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="list-item-link"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
Blog
|
||||||
|
<span> Changelog, features & events </span>
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M9 5l7 7-7 7"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://www.youtube.com/c/Nrwl_io/videos?utm_source=nx-project&sub_confirmation=1"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="list-item-link"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
role="img"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="currentColor"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<title>YouTube</title>
|
||||||
|
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
YouTube channel
|
||||||
|
<span> Nx Show, talks & tutorials </span>
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M9 5l7 7-7 7"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://nx.dev/react-tutorial/1-code-generation?utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="list-item-link"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
Interactive tutorials
|
||||||
|
<span> Create an app, step-by-step </span>
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M9 5l7 7-7 7"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://nxplaybook.com/?utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="list-item-link"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path d="M12 14l9-5-9-5-9 5 9 5z" />
|
||||||
|
<path d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z" />
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
Video courses
|
||||||
|
<span> Nx custom courses </span>
|
||||||
|
</span>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M9 5l7 7-7 7"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div id="other-links">
|
||||||
|
<a
|
||||||
|
id="nx-console"
|
||||||
|
className="button-pill rounded shadow"
|
||||||
|
href="https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console&utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="currentColor"
|
||||||
|
role="img"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<title>Visual Studio Code</title>
|
||||||
|
<path d="M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z" />
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
Install Nx Console
|
||||||
|
<span>Plugin for VSCode</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<div id="nx-cloud" className="rounded shadow">
|
||||||
|
<div>
|
||||||
|
<svg
|
||||||
|
viewBox="0 0 120 120"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M120 15V30C103.44 30 90 43.44 90 60C90 76.56 76.56 90 60 90C43.44 90 30 103.44 30 120H15C6.72 120 0 113.28 0 105V15C0 6.72 6.72 0 15 0H105C113.28 0 120 6.72 120 15Z"
|
||||||
|
fill="#0E2039"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M120 30V105C120 113.28 113.28 120 105 120H30C30 103.44 43.44 90 60 90C76.56 90 90 76.56 90 60C90 43.44 103.44 30 120 30Z"
|
||||||
|
fill="white"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<h2>
|
||||||
|
NxCloud
|
||||||
|
<span>Enable faster CI & better DX</span>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
You can activate distributed tasks executions and caching by
|
||||||
|
running:
|
||||||
|
</p>
|
||||||
|
<pre>nx connect-to-nx-cloud</pre>
|
||||||
|
<a
|
||||||
|
href="https://nx.app/?utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
{' '}
|
||||||
|
What is Nx Cloud?{' '}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<a
|
||||||
|
id="nx-repo"
|
||||||
|
className="button-pill rounded shadow"
|
||||||
|
href="https://github.com/nrwl/nx?utm_source=nx-project"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
fill="currentColor"
|
||||||
|
role="img"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
|
||||||
|
</svg>
|
||||||
|
<span>
|
||||||
|
Nx is open source
|
||||||
|
<span> Love Nx? Give us a star! </span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="commands" className="rounded shadow">
|
||||||
|
<h2>Next steps</h2>
|
||||||
|
<p>Here are some things you can do with Nx:</p>
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
Add UI library
|
||||||
|
</summary>
|
||||||
|
<pre>
|
||||||
|
<span># Generate UI lib</span>
|
||||||
|
nx g @nrwl/next:library ui
|
||||||
|
<span># Add a component</span>
|
||||||
|
nx g @nrwl/next:component button --project=ui
|
||||||
|
</pre>
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
View interactive project graph
|
||||||
|
</summary>
|
||||||
|
<pre>nx graph</pre>
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
<svg
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
Run affected commands
|
||||||
|
</summary>
|
||||||
|
<pre>
|
||||||
|
<span># see what's been affected by changes</span>
|
||||||
|
nx affected:graph
|
||||||
|
<span># run tests for current changes</span>
|
||||||
|
nx affected:test
|
||||||
|
<span># run e2e tests for current changes</span>
|
||||||
|
nx affected:e2e
|
||||||
|
</pre>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p id="love">
|
||||||
|
Carefully crafted with
|
||||||
|
<svg
|
||||||
|
fill="currentColor"
|
||||||
|
stroke="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth="2"
|
||||||
|
d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Index;
|
||||||
@ -0,0 +1,400 @@
|
|||||||
|
html {
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
||||||
|
Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif,
|
||||||
|
Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
||||||
|
line-height: 1.5;
|
||||||
|
tab-size: 4;
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
font-family: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
p,
|
||||||
|
pre {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
*,
|
||||||
|
::before,
|
||||||
|
::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-width: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: currentColor;
|
||||||
|
}
|
||||||
|
h1,
|
||||||
|
h2 {
|
||||||
|
font-size: inherit;
|
||||||
|
font-weight: inherit;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: inherit;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
||||||
|
Liberation Mono, Courier New, monospace;
|
||||||
|
}
|
||||||
|
svg {
|
||||||
|
display: block;
|
||||||
|
vertical-align: middle;
|
||||||
|
shape-rendering: auto;
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
background-color: rgba(55, 65, 81, 1);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
color: rgba(229, 231, 235, 1);
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
||||||
|
Liberation Mono, Courier New, monospace;
|
||||||
|
overflow: scroll;
|
||||||
|
padding: 0.5rem 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
box-shadow: 0 0 #0000, 0 0 #0000, 0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
||||||
|
0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
.rounded {
|
||||||
|
border-radius: 1.5rem;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
max-width: 768px;
|
||||||
|
padding-bottom: 3rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
color: rgba(55, 65, 81, 1);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#welcome {
|
||||||
|
margin-top: 2.5rem;
|
||||||
|
}
|
||||||
|
#welcome h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
#welcome span {
|
||||||
|
display: block;
|
||||||
|
font-size: 1.875rem;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 2.25rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
#hero {
|
||||||
|
align-items: center;
|
||||||
|
background-color: hsla(214, 62%, 21%, 1);
|
||||||
|
border: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: rgba(55, 65, 81, 1);
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
margin-top: 3.5rem;
|
||||||
|
}
|
||||||
|
#hero .text-container {
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
padding: 3rem 2rem;
|
||||||
|
}
|
||||||
|
#hero .text-container h2 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
line-height: 2rem;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#hero .text-container h2 svg {
|
||||||
|
color: hsla(162, 47%, 50%, 1);
|
||||||
|
height: 2rem;
|
||||||
|
left: -0.25rem;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 2rem;
|
||||||
|
}
|
||||||
|
#hero .text-container h2 span {
|
||||||
|
margin-left: 2.5rem;
|
||||||
|
}
|
||||||
|
#hero .text-container a {
|
||||||
|
background-color: rgba(255, 255, 255, 1);
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
color: rgba(55, 65, 81, 1);
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
padding: 1rem 2rem;
|
||||||
|
text-decoration: inherit;
|
||||||
|
}
|
||||||
|
#hero .logo-container {
|
||||||
|
display: none;
|
||||||
|
justify-content: center;
|
||||||
|
padding-left: 2rem;
|
||||||
|
padding-right: 2rem;
|
||||||
|
}
|
||||||
|
#hero .logo-container svg {
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
width: 66.666667%;
|
||||||
|
}
|
||||||
|
#middle-content {
|
||||||
|
align-items: flex-start;
|
||||||
|
display: grid;
|
||||||
|
gap: 4rem;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
margin-top: 3.5rem;
|
||||||
|
}
|
||||||
|
#learning-materials {
|
||||||
|
padding: 2.5rem 2rem;
|
||||||
|
}
|
||||||
|
#learning-materials h2 {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
line-height: 1.75rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
.list-item-link {
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 0.75rem;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.list-item-link svg:first-child {
|
||||||
|
margin-right: 1rem;
|
||||||
|
height: 1.5rem;
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
width: 1.5rem;
|
||||||
|
}
|
||||||
|
.list-item-link > span {
|
||||||
|
flex-grow: 1;
|
||||||
|
font-weight: 400;
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
|
.list-item-link > span > span {
|
||||||
|
color: rgba(107, 114, 128, 1);
|
||||||
|
display: block;
|
||||||
|
flex-grow: 1;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1rem;
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
|
.list-item-link svg:last-child {
|
||||||
|
height: 1rem;
|
||||||
|
transition-property: all;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
width: 1rem;
|
||||||
|
}
|
||||||
|
.list-item-link:hover {
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
background-color: hsla(162, 47%, 50%, 1);
|
||||||
|
}
|
||||||
|
.list-item-link:hover > span {
|
||||||
|
}
|
||||||
|
.list-item-link:hover > span > span {
|
||||||
|
color: rgba(243, 244, 246, 1);
|
||||||
|
}
|
||||||
|
.list-item-link:hover svg:last-child {
|
||||||
|
transform: translateX(0.25rem);
|
||||||
|
}
|
||||||
|
#other-links {
|
||||||
|
}
|
||||||
|
.button-pill {
|
||||||
|
padding: 1.5rem 2rem;
|
||||||
|
transition-duration: 300ms;
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.button-pill svg {
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 3rem;
|
||||||
|
}
|
||||||
|
.button-pill > span {
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 1.125rem;
|
||||||
|
line-height: 1.75rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
.button-pill span span {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
}
|
||||||
|
.button-pill:hover svg,
|
||||||
|
.button-pill:hover {
|
||||||
|
color: rgba(255, 255, 255, 1) !important;
|
||||||
|
}
|
||||||
|
#nx-console:hover {
|
||||||
|
background-color: rgba(0, 122, 204, 1);
|
||||||
|
}
|
||||||
|
#nx-console svg {
|
||||||
|
color: rgba(0, 122, 204, 1);
|
||||||
|
}
|
||||||
|
#nx-repo:hover {
|
||||||
|
background-color: rgba(24, 23, 23, 1);
|
||||||
|
}
|
||||||
|
#nx-repo svg {
|
||||||
|
color: rgba(24, 23, 23, 1);
|
||||||
|
}
|
||||||
|
#nx-cloud {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
margin-top: 2rem;
|
||||||
|
padding: 2.5rem 2rem;
|
||||||
|
}
|
||||||
|
#nx-cloud > div {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
#nx-cloud > div svg {
|
||||||
|
border-radius: 0.375rem;
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 3rem;
|
||||||
|
}
|
||||||
|
#nx-cloud > div h2 {
|
||||||
|
font-size: 1.125rem;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
line-height: 1.75rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
#nx-cloud > div h2 span {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
}
|
||||||
|
#nx-cloud p {
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
#nx-cloud pre {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
#nx-cloud a {
|
||||||
|
color: rgba(107, 114, 128, 1);
|
||||||
|
display: block;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
#nx-cloud a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
#commands {
|
||||||
|
padding: 2.5rem 2rem;
|
||||||
|
margin-top: 3.5rem;
|
||||||
|
}
|
||||||
|
#commands h2 {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
line-height: 1.75rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
#commands p {
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 300;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
details {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
details pre > span {
|
||||||
|
color: rgba(181, 181, 181, 1);
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
summary {
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
display: flex;
|
||||||
|
font-weight: 400;
|
||||||
|
padding: 0.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition-property: background-color, border-color, color, fill, stroke,
|
||||||
|
opacity, box-shadow, transform, filter, backdrop-filter,
|
||||||
|
-webkit-backdrop-filter;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
|
summary:hover {
|
||||||
|
background-color: rgba(243, 244, 246, 1);
|
||||||
|
}
|
||||||
|
summary svg {
|
||||||
|
height: 1.5rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
width: 1.5rem;
|
||||||
|
}
|
||||||
|
#love {
|
||||||
|
color: rgba(107, 114, 128, 1);
|
||||||
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
margin-top: 3.5rem;
|
||||||
|
opacity: 0.6;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#love svg {
|
||||||
|
color: rgba(252, 165, 165, 1);
|
||||||
|
width: 1.25rem;
|
||||||
|
height: 1.25rem;
|
||||||
|
display: inline;
|
||||||
|
margin-top: -0.25rem;
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
#hero {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
#hero .logo-container {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
#middle-content {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"name": "client",
|
||||||
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"sourceRoot": "apps/client",
|
||||||
|
"projectType": "application",
|
||||||
|
"targets": {
|
||||||
|
"build": {
|
||||||
|
"executor": "@nrwl/next:build",
|
||||||
|
"outputs": ["{options.outputPath}"],
|
||||||
|
"defaultConfiguration": "production",
|
||||||
|
"options": {
|
||||||
|
"root": "apps/client",
|
||||||
|
"outputPath": "dist/apps/client"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"development": {
|
||||||
|
"outputPath": "apps/client"
|
||||||
|
},
|
||||||
|
"production": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"executor": "@nrwl/next:server",
|
||||||
|
"defaultConfiguration": "development",
|
||||||
|
"options": {
|
||||||
|
"buildTarget": "client:build",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "client:build:development",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "client:build:production",
|
||||||
|
"dev": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"export": {
|
||||||
|
"executor": "@nrwl/next:export",
|
||||||
|
"options": {
|
||||||
|
"buildTarget": "client:build:production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"executor": "@nrwl/jest:jest",
|
||||||
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "apps/client/jest.config.ts",
|
||||||
|
"passWithNoTests": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nrwl/linter:eslint",
|
||||||
|
"outputs": ["{options.outputFile}"],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": ["apps/client/**/*.{ts,tsx,js,jsx}"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
}
|
||||||
@ -1,10 +1,11 @@
|
|||||||
|
import React from 'react';
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
|
|
||||||
import Categories from './categories';
|
import Index from '../pages/index';
|
||||||
|
|
||||||
describe('Categories', () => {
|
describe('Index', () => {
|
||||||
it('should render successfully', () => {
|
it('should render successfully', () => {
|
||||||
const { baseElement } = render(<Categories />);
|
const { baseElement } = render(<Index />);
|
||||||
expect(baseElement).toBeTruthy();
|
expect(baseElement).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1,34 +0,0 @@
|
|||||||
sonar.host.url=https://sonarqube.naser.fr/
|
|
||||||
sonar.projectKey=david:guitar-apps
|
|
||||||
sonar.projectName=Apps Guitar School
|
|
||||||
sonar.projectVersion=0.1.0-SNAPSHOT
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# Meta-data for the project
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
sonar.links.homepage=https://gitea.naser.fr/sebsn86/nx-guitar-school
|
|
||||||
sonar.links.ci=https://teamcity.naser.fr/buildConfiguration/NxGuitarSchool_GuitarSchool?mode=builds#all-projects
|
|
||||||
sonar.links.issues=https://gitea.naser.fr/sebsn86/nx-guitar-school/issues
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# Definition of the modules
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
sonar.modules=website
|
|
||||||
|
|
||||||
website.sonar.projectName=NextJS Guitar School
|
|
||||||
|
|
||||||
# =====================================================
|
|
||||||
# Properties that will be shared amongst all modules
|
|
||||||
# =====================================================
|
|
||||||
|
|
||||||
# Website properties
|
|
||||||
website.sonar.projectBaseDir=./website
|
|
||||||
website.sonar.sources=./
|
|
||||||
website.sonar.exclusions=**/.next/**/.coverage/,**/.eslintrc.json,**/index.d.ts,**/jest.config.ts,**/next.config.js,**/postcss.config.js,**/tailwind.config.js,**/with-nx.js,**/*.css,**/*.scss,**/*.spec.ts,**/*.spec.tsx
|
|
||||||
website.sonar.coverage.exclusions=**/.next/**/.coverage,**/.eslintrc.json,**/index.d.ts,**/jest.**/config.ts,**/next.config.js,**/postcss.config.js,**/tailwind.config.js,**/with-nx.js,**/*.css,**/*.scss
|
|
||||||
website.sonar.language=ts
|
|
||||||
website.sonar.tests=./tests
|
|
||||||
website.sonar.javascript.lcov.reportPaths=./coverage/lcov.info
|
|
||||||
website.sonar.sourceEncoding=UTF-8
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
NX_STRAPI_URL_API=http://localhost:1337/api
|
|
||||||
NX_STRAPI_URL=http://localhost:1337
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import {render} from '@testing-library/react';
|
|
||||||
|
|
||||||
import BlogPagination from './blog-pagination';
|
|
||||||
|
|
||||||
jest.mock("next/router", () => ({
|
|
||||||
useRouter() {
|
|
||||||
return {
|
|
||||||
route: "/",
|
|
||||||
pathname: "",
|
|
||||||
query: "",
|
|
||||||
asPath: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
describe('BlogPagination', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const {baseElement} = render(<BlogPagination paginator={{pagination: {}}} />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
import styles from './blog-pagination.module.scss';
|
|
||||||
import {useRouter} from "next/router";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface BlogPaginationProps {
|
|
||||||
paginator: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function BlogPagination({paginator = {pagination: {}}}: BlogPaginationProps) {
|
|
||||||
const router = useRouter();
|
|
||||||
const {total, pageCount, page} = paginator.pagination;
|
|
||||||
const isOnlyOne = pageCount > 0 && pageCount === 1;
|
|
||||||
const isEmpty = total === 0;
|
|
||||||
const isFirst = page === 1;
|
|
||||||
const isLast = page === pageCount;
|
|
||||||
const goPrevious = async () => {
|
|
||||||
await router.push(`${window.location.origin}${window.location.pathname}?page=${page - 1}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const goNext = async () => {
|
|
||||||
await router.push(`${window.location.origin}${window.location.pathname}?page=${page + 1}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles['container']}>
|
|
||||||
<div className="flex flex-col items-center">
|
|
||||||
{isOnlyOne && !isEmpty && (
|
|
||||||
<span className="text-sm text-gray-700 dark:text-gray-400">{total} article(s)</span>)}
|
|
||||||
{!isOnlyOne && !isEmpty && (<span className="text-sm text-gray-700 dark:text-gray-400">
|
|
||||||
Articles <span className="font-semibold text-gray-900 dark:text-white">{page}</span> à <span
|
|
||||||
className="font-semibold text-gray-900 dark:text-white">{pageCount}</span> sur un total de <span
|
|
||||||
className="font-semibold text-gray-900 dark:text-white">{total}</span>
|
|
||||||
</span>)}
|
|
||||||
<div className="inline-flex mt-2 xs:mt-0">
|
|
||||||
<button
|
|
||||||
disabled={isOnlyOne || isFirst || isEmpty}
|
|
||||||
onClick={goPrevious}
|
|
||||||
className="
|
|
||||||
inline-flex items-center px-4 py-2 mr-2 text-sm font-medium rounded
|
|
||||||
text-white bg-gray-800
|
|
||||||
hover:bg-gray-900
|
|
||||||
disabled:bg-gray-500 disabled:hover:bg-gray-500
|
|
||||||
dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 mr-2"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fillRule="evenodd"
|
|
||||||
d="M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z"
|
|
||||||
clipRule="evenodd"></path>
|
|
||||||
</svg>
|
|
||||||
Prev
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
disabled={isOnlyOne || isLast || isEmpty}
|
|
||||||
onClick={goNext}
|
|
||||||
className="inline-flex items-center px-4 py-2 ml-2 text-sm font-medium rounded
|
|
||||||
text-white bg-gray-800
|
|
||||||
hover:bg-gray-900
|
|
||||||
disabled:bg-gray-500 disabled:hover:bg-gray-500
|
|
||||||
dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
|
||||||
Next
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 ml-2"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fillRule="evenodd"
|
|
||||||
d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
|
|
||||||
clipRule="evenodd"></path>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BlogPagination;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
import {render} from '@testing-library/react';
|
|
||||||
import configureStore from "redux-mock-store";
|
|
||||||
|
|
||||||
import BlogSearch from './blog-search';
|
|
||||||
import {Provider} from "react-redux";
|
|
||||||
|
|
||||||
jest.mock("next/router", () => ({
|
|
||||||
useRouter() {
|
|
||||||
return {
|
|
||||||
route: "/",
|
|
||||||
pathname: "",
|
|
||||||
query: "",
|
|
||||||
asPath: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
describe('BlogSearch', () => {
|
|
||||||
const initialState = {results: []};
|
|
||||||
const mockStore = configureStore();
|
|
||||||
let store;
|
|
||||||
|
|
||||||
it('should render successfully', () => {
|
|
||||||
store = mockStore(initialState);
|
|
||||||
const {baseElement} = render(
|
|
||||||
<Provider store={store}>
|
|
||||||
<BlogSearch />
|
|
||||||
</Provider>);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
import {useEffect, useState} from "react";
|
|
||||||
import {BehaviorSubject, catchError, debounceTime, delay, distinctUntilChanged, filter, map, of, switchMap} from "rxjs";
|
|
||||||
import {useRouter} from "next/router";
|
|
||||||
import {MeiliSearch} from "meilisearch";
|
|
||||||
import {useDispatch} from "react-redux";
|
|
||||||
|
|
||||||
import {environment} from "../../environments/environment";
|
|
||||||
|
|
||||||
import styles from './blog-search.module.scss';
|
|
||||||
import {setSearchState} from "../../store/searchSlice";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface BlogSearchProps {
|
|
||||||
}
|
|
||||||
|
|
||||||
export function BlogSearch(props: BlogSearchProps) {
|
|
||||||
const router = useRouter();
|
|
||||||
const [client, setClient] = useState(null);
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const [subject, setSubject] = useState(null);
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (subject === null) {
|
|
||||||
const sub = new BehaviorSubject('');
|
|
||||||
const client = new MeiliSearch({
|
|
||||||
host: environment.meiliUrl,
|
|
||||||
apiKey: environment.meiliApiKey
|
|
||||||
})
|
|
||||||
setSubject(sub);
|
|
||||||
setClient(client);
|
|
||||||
} else {
|
|
||||||
subject.pipe(
|
|
||||||
map((s: string) => s.trim()),
|
|
||||||
distinctUntilChanged(),
|
|
||||||
filter((s: string) => s.length >= 2),
|
|
||||||
debounceTime(200),
|
|
||||||
map((value) => {
|
|
||||||
setLoading(true);
|
|
||||||
return value;
|
|
||||||
}),
|
|
||||||
delay(2000),
|
|
||||||
switchMap(async (value: string) => {
|
|
||||||
const index = await client.getIndex('article');
|
|
||||||
const articles = await index.search(value);
|
|
||||||
setLoading(false);
|
|
||||||
await router.push('/search');
|
|
||||||
dispatch(setSearchState(articles.hits));
|
|
||||||
}),
|
|
||||||
catchError((err) => of(false))
|
|
||||||
).subscribe(() => setLoading(false));
|
|
||||||
}
|
|
||||||
}, [subject]);
|
|
||||||
|
|
||||||
const onSearchChange = (e) => subject.next(e.target.value);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles['container'] + " rounded-lg mx-2 lg:mx-0 mt-5 lg:mt-0 p-5 mb-5 shadow-sm" +
|
|
||||||
" bg-white" +
|
|
||||||
" dark:bg-gray-800"}>
|
|
||||||
<form>
|
|
||||||
<label htmlFor="default-search"
|
|
||||||
className="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Search</label>
|
|
||||||
<div className="relative">
|
|
||||||
<div className="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-gray-500 dark:text-gray-400"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
strokeWidth="2"
|
|
||||||
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<input type="search"
|
|
||||||
id="default-search"
|
|
||||||
onChange={onSearchChange}
|
|
||||||
className="block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
||||||
placeholder="Rechercher un article ..." />
|
|
||||||
{!loading && (<button type="submit"
|
|
||||||
className="text-white absolute right-2.5 bottom-2.5 font-medium rounded-lg text-sm px-4 py-2
|
|
||||||
bg-blue-700
|
|
||||||
hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
|
|
||||||
Search
|
|
||||||
</button>)}
|
|
||||||
{loading && (<button disabled
|
|
||||||
type="button"
|
|
||||||
className="absolute right-2.5 bottom-2 py-2 px-4 text-sm font-medium bg-white rounded-lg border
|
|
||||||
hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-blue-700 focus:text-blue-700
|
|
||||||
text-gray-900 border-gray-200
|
|
||||||
dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700
|
|
||||||
inline-flex items-center">
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
role="status"
|
|
||||||
className="inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600"
|
|
||||||
viewBox="0 0 100 101"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
|
||||||
fill="currentColor" />
|
|
||||||
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
|
||||||
fill="#1C64F2" />
|
|
||||||
</svg>
|
|
||||||
Chargement...
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BlogSearch;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import {render} from '@testing-library/react';
|
|
||||||
|
|
||||||
import CardBlogDetails from './card-blog-details';
|
|
||||||
|
|
||||||
describe('CardBlogDetails', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const {baseElement} = render(<CardBlogDetails item={{}} />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
import delve from 'dlv';
|
|
||||||
import NextImage from "next/image";
|
|
||||||
import {
|
|
||||||
FacebookIcon,
|
|
||||||
FacebookMessengerIcon,
|
|
||||||
FacebookMessengerShareButton,
|
|
||||||
FacebookShareButton,
|
|
||||||
LinkedinIcon,
|
|
||||||
LinkedinShareButton,
|
|
||||||
TwitterIcon,
|
|
||||||
TwitterShareButton,
|
|
||||||
WhatsappIcon,
|
|
||||||
WhatsappShareButton
|
|
||||||
} from "react-share";
|
|
||||||
|
|
||||||
import styles from './card-blog-details.module.scss';
|
|
||||||
import {getCategoryUrl, getPostUrl, getStrapiImage} from "../../libs/utils";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface CardBlogDetailsProps {
|
|
||||||
item: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function CardBlogDetails({item = {}}: CardBlogDetailsProps) {
|
|
||||||
const {width = 0, height = 0} = delve(item, 'image.data.attributes', {});
|
|
||||||
const {title} = item;
|
|
||||||
const shareUrl = getPostUrl(item);
|
|
||||||
return (
|
|
||||||
<div className={styles['container'] + " rounded-l p-8 overflow-hidden shadow-sm" +
|
|
||||||
" bg-white" +
|
|
||||||
" dark:bg-gray-800"}>
|
|
||||||
<header className="md:flex flex-col">
|
|
||||||
<h2 className="text-3xl mb-5 text-bold">
|
|
||||||
{delve(item, 'title', 'N/A')}
|
|
||||||
</h2>
|
|
||||||
<section className="flex items-center justify-between">
|
|
||||||
<div className="flex">
|
|
||||||
<a href="#"
|
|
||||||
className="flex items-center">
|
|
||||||
<img
|
|
||||||
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=731&q=80"
|
|
||||||
alt="avatar"
|
|
||||||
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>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<a href={getCategoryUrl(item)}
|
|
||||||
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')}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</header>
|
|
||||||
<hr className="border-gray-100 my-5 sm:mx-auto dark:border-gray-700 container mx-auto" />
|
|
||||||
<main>
|
|
||||||
<section>
|
|
||||||
<div className="whitespace-pre-wrap text-lg font-bold text-slate-500
|
|
||||||
text-gray-600
|
|
||||||
dark:text-gray-300"
|
|
||||||
dangerouslySetInnerHTML={{__html: delve(item, 'description', 'N/A')}} />
|
|
||||||
<NextImage
|
|
||||||
layout="responsive"
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
objectFit="contain"
|
|
||||||
className="rounded-lg my-5"
|
|
||||||
src={getStrapiImage(item, "default")}
|
|
||||||
alt={delve(item, 'title', 'N/A')} />
|
|
||||||
</section>
|
|
||||||
<section className="whitespace-pre-wrap text-lg text-slate-400"
|
|
||||||
dangerouslySetInnerHTML={{__html: delve(item, 'content', 'N/A')}} />
|
|
||||||
<hr className="border-gray-100 my-5 sm:mx-auto dark:border-gray-700 container mx-auto" />
|
|
||||||
<section className="flex justify-between">
|
|
||||||
<div>
|
|
||||||
<h4 className="font-bold text-lg text-gray-400 mb-2">Partager cet article</h4>
|
|
||||||
<div className="grid grid-cols-5 gap-2">
|
|
||||||
<FacebookShareButton url={shareUrl}>
|
|
||||||
<FacebookIcon size={32}
|
|
||||||
round />
|
|
||||||
</FacebookShareButton>
|
|
||||||
<FacebookMessengerShareButton
|
|
||||||
url={shareUrl}
|
|
||||||
appId="521270401588372"
|
|
||||||
className="Demo__some-network__share-button"
|
|
||||||
>
|
|
||||||
<FacebookMessengerIcon size={32}
|
|
||||||
round />
|
|
||||||
</FacebookMessengerShareButton>
|
|
||||||
<TwitterShareButton
|
|
||||||
url={shareUrl}
|
|
||||||
title={title}
|
|
||||||
className="Demo__some-network__share-button"
|
|
||||||
>
|
|
||||||
<TwitterIcon size={32}
|
|
||||||
round />
|
|
||||||
</TwitterShareButton>
|
|
||||||
<WhatsappShareButton
|
|
||||||
url={shareUrl}
|
|
||||||
title={title}
|
|
||||||
separator=":: "
|
|
||||||
className="Demo__some-network__share-button"
|
|
||||||
>
|
|
||||||
<WhatsappIcon size={32}
|
|
||||||
round />
|
|
||||||
</WhatsappShareButton>
|
|
||||||
<LinkedinShareButton url={shareUrl}
|
|
||||||
className="Demo__some-network__share-button">
|
|
||||||
<LinkedinIcon size={32}
|
|
||||||
round />
|
|
||||||
</LinkedinShareButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default CardBlogDetails;
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
.card-blog-container {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import CardBlog from './card-blog';
|
|
||||||
|
|
||||||
describe('CardBlog', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<CardBlog />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,72 +0,0 @@
|
|||||||
import delve from 'dlv';
|
|
||||||
import {format} from 'date-fns';
|
|
||||||
|
|
||||||
import styles from './card-blog.module.scss';
|
|
||||||
import {getCategoryUrl, getPostUrl, getStrapiImage} from "../../libs/utils";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface CardBlogProps {
|
|
||||||
item: object;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function CardBlog({item}: CardBlogProps) {
|
|
||||||
return (
|
|
||||||
<div className={styles['card-blog-container'] + " rounded-l overflow-hidden shadow-sm" +
|
|
||||||
" bg-white" +
|
|
||||||
" dark:bg-gray-800"}>
|
|
||||||
<div className="md:flex">
|
|
||||||
<div className="md:shrink-0">
|
|
||||||
<img className="h-48 w-full object-cover md:h-full md:w-48"
|
|
||||||
src={getStrapiImage(item, 'medium')}
|
|
||||||
alt="Modern building architecture" />
|
|
||||||
</div>
|
|
||||||
<div className="p-8 w-full">
|
|
||||||
<div className="flex justify-between items-center">
|
|
||||||
<span
|
|
||||||
className="font-light text-sm
|
|
||||||
text-gray-600
|
|
||||||
dark:text-gray-300">{format(new Date(delve(item, 'attributes.publishedAt', 'Jun 1, 2020')), 'dd/MM/yyyy')}</span>
|
|
||||||
<a href={getCategoryUrl(item)}
|
|
||||||
className="px-2 py-1 text-sm font-bold rounded
|
|
||||||
bg-gray-600 text-gray-100
|
|
||||||
hover:bg-gray-500">
|
|
||||||
{delve(item, 'attributes.category.data.attributes.name', 'N/A')}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="mt-2">
|
|
||||||
<a
|
|
||||||
href={getPostUrl(item)}
|
|
||||||
className="text-xl font-bold hover:underline
|
|
||||||
text-gray-700
|
|
||||||
dark:text-gray-200">
|
|
||||||
{delve(item, 'attributes.title', 'N/A')}
|
|
||||||
</a>
|
|
||||||
<p className="mt-2 font-light text-sm
|
|
||||||
text-gray-600
|
|
||||||
dark:text-gray-300">{delve(item, 'attributes.description', 'N/A')}</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between items-center mt-4">
|
|
||||||
<a href={getPostUrl(item)}
|
|
||||||
className="text-blue-500 text-sm hover:underline">Lire l'article</a>
|
|
||||||
<div>
|
|
||||||
<a href="#"
|
|
||||||
className="flex items-center">
|
|
||||||
<img
|
|
||||||
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=731&q=80"
|
|
||||||
alt="avatar"
|
|
||||||
className="mx-4 w-10 h-10 object-cover rounded-full hidden sm:block" />
|
|
||||||
<h3 className="text-normal font-bold hover:underline
|
|
||||||
text-gray-700
|
|
||||||
dark:text-gray-300">Alex John</h3>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default CardBlog;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import styles from './carousel.module.scss';
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface CarouselProps {}
|
|
||||||
|
|
||||||
export function Carousel(props: CarouselProps) {
|
|
||||||
return (
|
|
||||||
<div className={styles['container']}>
|
|
||||||
<h1>Welcome to Carousel!</h1>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Carousel;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
import delve from 'dlv';
|
|
||||||
|
|
||||||
import {environment} from "../../environments/environment";
|
|
||||||
|
|
||||||
import styles from './categories.module.scss';
|
|
||||||
import Link from "next/link";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface CategoriesProps {
|
|
||||||
items: object[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// <!-- pb-0 sm:pt-4 -->
|
|
||||||
|
|
||||||
export function Categories({items = []}: CategoriesProps) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={styles['container'] + " rounded-lg mx-2 lg:mx-0 mt-5 lg:mt-0 p-5 mb-5 shadow-sm" +
|
|
||||||
" bg-white" +
|
|
||||||
" dark:bg-gray-800"}>
|
|
||||||
<div className="flex items-center justify-between mb-4">
|
|
||||||
<h5 className="text-xl font-bold leading-none text-gray-900 dark:text-white">Catégories</h5>
|
|
||||||
</div>
|
|
||||||
<div className="flow-root">
|
|
||||||
<ul role="list" className="divide-y divide-gray-200 dark:divide-gray-700">
|
|
||||||
{items.map((item: any, index: number) => (<li key={'categories-' + item.slug + index} className="py-3 sm:py-4">
|
|
||||||
<div className="flex items-center space-x-4">
|
|
||||||
<div className="flex-shrink-0">
|
|
||||||
<img className="w-8 h-8 rounded-full"
|
|
||||||
src={environment.strapiUrl + delve(item, 'attributes.image.data.attributes.formats.thumbnail.url', '')}
|
|
||||||
alt="Neil image"/>
|
|
||||||
</div>
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<h4><Link href={"/blog/" + item.attributes.slug}>{delve(item, 'attributes.name', 'N/A')}</Link></h4>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>))
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Categories;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
import delve from "dlv";
|
|
||||||
|
|
||||||
export function Footer({items = []}) {
|
|
||||||
|
|
||||||
const generateItem = (item, index) => {
|
|
||||||
const value = delve(item, 'attributes', {});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<li key={value.title + index}>
|
|
||||||
<a href={value.url} target={value.target} className="mr-4 hover:underline md:mr-6 ">
|
|
||||||
{value.title}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<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">
|
|
||||||
<a href="/" className="flex items-center mb-4 sm:mb-0">
|
|
||||||
<img src="https://flowbite.com/docs/images/logo.svg" className="h-8 mr-3" alt="Flowbite Logo"/>
|
|
||||||
<span className="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">MeCP</span>
|
|
||||||
</a>
|
|
||||||
<ul className="flex flex-wrap items-center mb-6 text-sm text-gray-500 sm:mb-0 dark:text-gray-400">
|
|
||||||
{items.map((item, index: number) => generateItem(item, index))}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<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
|
|
||||||
href="https://flowbite.com/" className="hover:underline">Flowbite™</a>. All Rights Reserved.
|
|
||||||
</span>
|
|
||||||
</footer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Footer;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,225 +0,0 @@
|
|||||||
import {Collapse, Dropdown} from "flowbite";
|
|
||||||
import {useEffect} from "react";
|
|
||||||
import delve from "dlv";
|
|
||||||
import {signOut, useSession} from "next-auth/react";
|
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
|
|
||||||
|
|
||||||
import {getBackendImg, hasAvatar} from "../../libs/api";
|
|
||||||
import {faBagShopping, faRightToBracket, faUserPlus} from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import {siteConfig} from "../../config";
|
|
||||||
|
|
||||||
export function Header({items = []}) {
|
|
||||||
const {data: session} = useSession();
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (session == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}, [session]);
|
|
||||||
|
|
||||||
useEffect(function mount() {
|
|
||||||
const menuButton = document.getElementById('menu-dropdown-button');
|
|
||||||
const menuZone = document.getElementById('menu-dropdown');
|
|
||||||
if (menuButton && menuZone) {
|
|
||||||
new Dropdown(menuZone, menuButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
const userButton = document.getElementById('user-menu-button');
|
|
||||||
const userZone = document.getElementById('user-dropdown');
|
|
||||||
if (userButton && userZone) {
|
|
||||||
new Dropdown(userZone, userButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
const burgerButton = document.getElementById('menu-button');
|
|
||||||
const megaZone = document.getElementById('navbar-dropdown');
|
|
||||||
if (burgerButton && megaZone) {
|
|
||||||
new Collapse(megaZone, burgerButton);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const renderGenerateItem = (item, index, isActive = false) => {
|
|
||||||
const value = delve(item, 'attributes', {});
|
|
||||||
return (
|
|
||||||
<li key={value.title + index}>
|
|
||||||
{value.children.data.length > 0 ? renderDropdownItem(value, isActive) : renderRegularItem(value, isActive)}
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const renderRegularItem = (item, isActive = false) => {
|
|
||||||
return (
|
|
||||||
<a href={item.url}
|
|
||||||
target={item.target}
|
|
||||||
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>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const renderRegularDropdownItem = (item, index) => {
|
|
||||||
const value = delve(item, 'attributes', {});
|
|
||||||
return (
|
|
||||||
<li key={value.title + index}>
|
|
||||||
<a href={value.url}
|
|
||||||
className="text-gray-900 dark:text-gray-400 hover:text-blue-600 dark:hover:text-gray-500">
|
|
||||||
{value.title}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const renderDropdownItem = (item, isActive = false) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<button id="menu-dropdown-button"
|
|
||||||
className={"flex items-center justify-between w-full py-2 pl-3 pr-4 text-gray-900 dark:text-gray-400 " + (isActive ? 'text-blue-600 dark:text-gray-500' : '') + " font-medium border-b border-gray-100 md:w-auto hover:bg-gray-50 md:p-0 dark:border-transparent dark:hover:bg-transparent dark:hover:text-gray-500"}>
|
|
||||||
{item.title}
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 ml-1 md:w-4 md:h-4"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fillRule="evenodd"
|
|
||||||
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
||||||
clipRule="evenodd"></path>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
<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">
|
|
||||||
<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">
|
|
||||||
{item.children.data.map((children, index) => renderRegularDropdownItem(children, index))}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const renderAnonymousUser = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<a href="/sign-in"
|
|
||||||
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="block lg:hidden">
|
|
||||||
<FontAwesomeIcon icon={faRightToBracket}/>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
<a href="/sign-up"
|
|
||||||
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="block lg:hidden">
|
|
||||||
<FontAwesomeIcon icon={faUserPlus}/>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const renderConnectedUser = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<button type="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"
|
|
||||||
id="user-menu-button"
|
|
||||||
aria-expanded="false"
|
|
||||||
data-dropdown-placement="bottom">
|
|
||||||
<span className="sr-only">Open user menu</span>
|
|
||||||
<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}
|
|
||||||
alt="user photo"/>
|
|
||||||
</button>
|
|
||||||
<div
|
|
||||||
className="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:bg-gray-700 dark:divide-gray-600"
|
|
||||||
id="user-dropdown">
|
|
||||||
<div className="px-4 py-3">
|
|
||||||
<span className="block text-sm text-gray-900 dark:text-white">{(session.user as any).username}</span>
|
|
||||||
<span
|
|
||||||
className="block text-sm font-medium text-gray-500 truncate dark:text-gray-400">{session.user.email}</span>
|
|
||||||
</div>
|
|
||||||
<ul className="py-1" aria-labelledby="user-menu-button">
|
|
||||||
<li>
|
|
||||||
<a href="#"
|
|
||||||
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
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#"
|
|
||||||
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
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#"
|
|
||||||
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
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#"
|
|
||||||
// @ts-ignore
|
|
||||||
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">
|
|
||||||
Sign out
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<nav
|
|
||||||
className="bg-white fixed border-gray-200 dark:bg-gray-800 w-full z-10 border-b-gray-50 dark:border-b-gray-700">
|
|
||||||
<div className="flex mx-auto">
|
|
||||||
<main className="w-full">
|
|
||||||
<section
|
|
||||||
className="bg-white dark:bg-gray-800 w-full md:w-auto p-2 md:p-4"
|
|
||||||
id="navbar-default">
|
|
||||||
<div className="container max-w-screen-xl flex flex-wrap items-center justify-between mx-auto">
|
|
||||||
<a href="/" className="flex items-center">
|
|
||||||
<img src="https://flowbite.com/docs/images/logo.svg" className="h-6 mr-3 sm:h-9" alt="Flowbite Logo"/>
|
|
||||||
<span className="self-center text-xl font-semibold whitespace-nowrap dark:text-white">MeCP</span>
|
|
||||||
</a>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<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">
|
|
||||||
<FontAwesomeIcon icon={faBagShopping}/>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{session ? renderConnectedUser() : renderAnonymousUser()}
|
|
||||||
|
|
||||||
<button id="menu-button"
|
|
||||||
type="button"
|
|
||||||
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-controls="navbar-dropdown"
|
|
||||||
aria-expanded="false">
|
|
||||||
<span className="sr-only">Open main menu</span>
|
|
||||||
<svg className="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<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"
|
|
||||||
clipRule="evenodd"></path>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<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">
|
|
||||||
<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">
|
|
||||||
{items.map((item, index: number) => renderGenerateItem(item, index))}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<hr className="border-gray-100 sm:mx-auto dark:border-gray-700"/>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Header;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import HomeSectionBlog from './home-section-blog';
|
|
||||||
|
|
||||||
describe('HomeSectionBlog', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<HomeSectionBlog />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
/* eslint-disable-next-line */
|
|
||||||
import NextImage from "next/image";
|
|
||||||
import delve from 'dlv';
|
|
||||||
|
|
||||||
import {getCategoryUrl, getPostUrl, getStrapiImage, getStrapiImageSize} from "../../libs/utils";
|
|
||||||
import CardBlog from "../card-blog/card-blog";
|
|
||||||
import {format} from "date-fns";
|
|
||||||
|
|
||||||
export interface HomeSectionBlogProps {
|
|
||||||
posts: object[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function HomeSectionBlog({posts = []}: HomeSectionBlogProps) {
|
|
||||||
const firstArticle = posts.length > 0 ? posts.slice(0, 1) : [];
|
|
||||||
const otherArticles = posts.length > 0 ? posts.slice(1, posts.length) : [];
|
|
||||||
const [width, height] = getStrapiImageSize(firstArticle[0]);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<section className="container max-w-6xl relative mx-auto relative flex flex-col md:flex-row mb-10 h-auto">
|
|
||||||
<div className="w-12/12 md:w-6/12 px-4 mb-4 md:mb-0 md:px-0 md:pr-2">
|
|
||||||
<div className="block border rounded-lg shadow-sm h-full my-2 mx-2 sm:my-0 sm:mx-0 relative
|
|
||||||
bg-white border-gray-200
|
|
||||||
dark:bg-gray-800 dark:border-gray-800 dark:hover:bg-gray-800">
|
|
||||||
<div className="flex justify-between items-center absolute left-5 top-5">
|
|
||||||
<span
|
|
||||||
className="font-bold shadow text-white text-sm">{format(new Date(delve(firstArticle[0], 'attributes.publishedAt', 'Jun 1, 2020')), 'dd/MM/yyyy')}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between items-center absolute right-5 top-5">
|
|
||||||
<a href={getCategoryUrl(firstArticle[0])}
|
|
||||||
className="px-2 py-1 text-sm bg-gray-600 text-gray-100 font-bold rounded hover:bg-gray-500">
|
|
||||||
{delve(firstArticle[0], 'attributes.category.data.attributes.name', 'N/A')}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<NextImage
|
|
||||||
layout="responsive"
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
objectFit="contain"
|
|
||||||
className="rounded-t"
|
|
||||||
src={getStrapiImage(firstArticle[0])}
|
|
||||||
alt={delve(firstArticle, '0.title', 'N/A')} />
|
|
||||||
|
|
||||||
<main className="p-5">
|
|
||||||
<div className="mt-2">
|
|
||||||
<a
|
|
||||||
href={getPostUrl(firstArticle[0])}
|
|
||||||
className="text-xl font-bold hover:underline
|
|
||||||
text-gray-700
|
|
||||||
dark:text-gray-200">
|
|
||||||
{delve(firstArticle[0], 'attributes.title', 'N/A')}
|
|
||||||
</a>
|
|
||||||
<p className="mt-2 font-light text-sm
|
|
||||||
text-gray-600
|
|
||||||
dark:text-gray-300">{delve(firstArticle[0], 'attributes.description', 'N/A')}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex justify-between items-center mt-4">
|
|
||||||
<a href={getPostUrl(firstArticle[0])}
|
|
||||||
className="text-blue-500 text-sm hover:underline">Lire l'article</a>
|
|
||||||
<div>
|
|
||||||
<a href="#"
|
|
||||||
className="flex items-center">
|
|
||||||
<img
|
|
||||||
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=731&q=80"
|
|
||||||
alt="avatar"
|
|
||||||
className="mx-4 w-10 h-10 object-cover rounded-full hidden sm:block" />
|
|
||||||
<h3 className="text-normal font-bold hover:underline
|
|
||||||
text-gray-700
|
|
||||||
dark:text-gray-300">Alex John</h3>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="w-12/12 md:w-6/12 px-4 md:px-0 md:pl-2">
|
|
||||||
{otherArticles.map((item: object, index: number) => (<CardBlog key={"home-card-blog-" + index}
|
|
||||||
item={item} />))}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeSectionBlog;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import HomeSectionCardsHeader from './home-section-cards-header';
|
|
||||||
|
|
||||||
describe('HomeSectionCardsHeader', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<HomeSectionCardsHeader />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
import styles from './home-section-cards-header.module.scss';
|
|
||||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
|
||||||
import {
|
|
||||||
faChalkboardUser,
|
|
||||||
faGraduationCap, faGuitar,
|
|
||||||
faLinesLeaning, faScrewdriverWrench,
|
|
||||||
faTabletScreenButton
|
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface HomeSectionCardsHeaderProps {}
|
|
||||||
|
|
||||||
export function HomeSectionCardsHeader(props: HomeSectionCardsHeaderProps) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<main className="container relative max-w-screen-xl mx-auto relative flex flex-col mb-10">
|
|
||||||
<section className="relative max-w-6xl w-full mx-auto lg:h-[200px] sm:grid sm:grid-cols-3 sm:gap-4 sm:-top-10 sm:px-4 xl:px-0">
|
|
||||||
<div className="block p-6 border rounded-lg shadow-sm h-full my-2 mx-2 sm:my-0 sm:mx-0
|
|
||||||
bg-white border-gray-200
|
|
||||||
hover:bg-gray-100
|
|
||||||
dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">a
|
|
||||||
</div>
|
|
||||||
<div className="block p-6 border rounded-lg shadow-sm h-full my-2 mx-2 sm:my-0 sm:mx-0
|
|
||||||
bg-white border-gray-200
|
|
||||||
hover:bg-gray-100
|
|
||||||
dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">b
|
|
||||||
</div>
|
|
||||||
<div className="blocks p-6 border rounded-lg shadow-sm h-full my-2 mx-2 sm:my-0 sm:mx-0
|
|
||||||
bg-white border-gray-200
|
|
||||||
hover:bg-gray-100
|
|
||||||
dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">c
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section className="relative w-full">
|
|
||||||
<h2 className="font-bold w-full text-center my-5 text-2xl mx-auto text-teal-800">MeCP fournit tout les outils nécessaire pour un apprentissage de qualité</h2>
|
|
||||||
|
|
||||||
<div className="grid grid-cols-3 gap-2 md:gap-4 max-w-4xl mx-auto px-2 md:px-0">
|
|
||||||
<div className="text-center flex flex-col transition scale-75
|
|
||||||
text-gray-400
|
|
||||||
hover:scale-100 hover:text-lime-600">
|
|
||||||
<span className="text-5xl my-2 md:mx-10 md:my-5"><FontAwesomeIcon icon={faTabletScreenButton} /></span>
|
|
||||||
<span className="text-lg">Des formats adaptés</span>
|
|
||||||
</div>
|
|
||||||
<div className="text-center flex flex-col transition scale-75
|
|
||||||
text-gray-400
|
|
||||||
hover:scale-100 hover:text-violet-600">
|
|
||||||
<span className="text-5xl my-2 md:mx-10 md:my-5"><FontAwesomeIcon icon={faGraduationCap} /></span>
|
|
||||||
<span className="text-lg">Une organisation pédagogique</span>
|
|
||||||
</div>
|
|
||||||
<div className="text-center flex flex-col transition scale-75
|
|
||||||
text-gray-400
|
|
||||||
hover:scale-100 hover:text-yellow-600">
|
|
||||||
<span className="text-5xl my-2 md:mx-10 md:my-5"><FontAwesomeIcon icon={faChalkboardUser} /></span>
|
|
||||||
<span className="text-lg ">Un espace dédié à l'apprentissage</span>
|
|
||||||
</div>
|
|
||||||
<div className="text-center flex flex-col transition scale-75
|
|
||||||
text-gray-400
|
|
||||||
hover:scale-100 hover:text-orange-600">
|
|
||||||
<span className="text-5xl my-2 md:mx-10 md:my-5"><FontAwesomeIcon icon={faLinesLeaning} /></span>
|
|
||||||
<span className="text-lg">Des contenus adaptés et motivants</span>
|
|
||||||
</div>
|
|
||||||
<div className="text-center flex flex-col transition scale-75
|
|
||||||
text-gray-400
|
|
||||||
hover:scale-100 hover:text-teal-600">
|
|
||||||
<span className="text-5xl my-2 md:mx-10 md:my-5"><FontAwesomeIcon icon={faGuitar} /></span>
|
|
||||||
<span className="text-lg">Une méthode révolutionnaire</span>
|
|
||||||
</div>
|
|
||||||
<div className="text-center flex flex-col transition scale-75
|
|
||||||
text-gray-400
|
|
||||||
hover:scale-100 hover:text-pink-600">
|
|
||||||
<span className="text-5xl my-2 md:mx-10 md:my-5"><FontAwesomeIcon icon={faScrewdriverWrench} /></span>
|
|
||||||
<span className="text-lg">Des outils interactifs</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeSectionCardsHeader;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import HomeSectionComments from './home-section-comments';
|
|
||||||
|
|
||||||
describe('HomeSectionComments', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<HomeSectionComments />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,186 +0,0 @@
|
|||||||
/* eslint-disable-next-line */
|
|
||||||
export interface HomeSectionCommentsProps {
|
|
||||||
}
|
|
||||||
|
|
||||||
export function HomeSectionComments(props: HomeSectionCommentsProps) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<section className="w-full py-10 my-10
|
|
||||||
bg-white
|
|
||||||
dark:bg-gray-800">
|
|
||||||
<div className="container max-w-6xl relative mx-auto relative flex-col mb-10 h-auto">
|
|
||||||
<h3 className="w-full mb-10 text-xl text-center font-extrabold tracking-tight leading-none md:text-2xl xl:text-3xl dark:text-white">
|
|
||||||
Ce que nos étudiants en pense
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="w-full grid md:grid-cols-3 md:px-4 xl:px-0 gap-5">
|
|
||||||
<div className="rounded-lg p-7 mx-5 md:mx-0
|
|
||||||
bg-gray-100
|
|
||||||
dark:bg-gray-700">
|
|
||||||
<header>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>First star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Second star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Third star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Fourth star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-gray-300 dark:text-gray-500"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Fifth star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<section className="pt-3">
|
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec sodales nisi. Donec pretium varius purus quis porttitor. In et tempus massa, accumsan egestas orci. Aenean eros purus, consequat eget.</p>
|
|
||||||
</section>
|
|
||||||
<hr className="my-5" />
|
|
||||||
<footer className="flex items-center">
|
|
||||||
<img
|
|
||||||
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=731&q=80"
|
|
||||||
alt="avatar"
|
|
||||||
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>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
<div className="rounded-lg p-7 mx-5 md:mx-0
|
|
||||||
bg-gray-100
|
|
||||||
dark:bg-gray-700">
|
|
||||||
<header>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>First star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Second star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Third star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Fourth star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-gray-300 dark:text-gray-500"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Fifth star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<section className="pt-3">
|
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec sodales nisi. Donec pretium varius purus quis porttitor. In et tempus massa, accumsan egestas orci. Aenean eros purus, consequat eget.</p>
|
|
||||||
</section>
|
|
||||||
<hr className="my-5" />
|
|
||||||
<footer className="flex items-center">
|
|
||||||
<img
|
|
||||||
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=731&q=80"
|
|
||||||
alt="avatar"
|
|
||||||
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>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
<div className="rounded-lg p-7 mx-5 md:mx-0
|
|
||||||
bg-gray-100
|
|
||||||
dark:bg-gray-700">
|
|
||||||
<header>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>First star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Second star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Third star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-yellow-400"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Fourth star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
<svg aria-hidden="true"
|
|
||||||
className="w-5 h-5 text-gray-300 dark:text-gray-500"
|
|
||||||
fill="currentColor"
|
|
||||||
viewBox="0 0 20 20"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><title>Fifth star</title>
|
|
||||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<section className="pt-3">
|
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec sodales nisi. Donec pretium varius purus quis porttitor. In et tempus massa, accumsan egestas orci. Aenean eros purus, consequat eget.</p>
|
|
||||||
</section>
|
|
||||||
<hr className="my-5" />
|
|
||||||
<footer className="flex items-center">
|
|
||||||
<img
|
|
||||||
src="https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=731&q=80"
|
|
||||||
alt="avatar"
|
|
||||||
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>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeSectionComments;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import HomeSectionGrid from './home-section-grid';
|
|
||||||
|
|
||||||
describe('HomeSectionGrid', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<HomeSectionGrid />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/* eslint-disable-next-line */
|
|
||||||
export interface HomeSectionGridProps {
|
|
||||||
}
|
|
||||||
|
|
||||||
export function HomeSectionGrid(props: HomeSectionGridProps) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<section className="w-full p-5 sm:p-10 lg:pt-0 lg:py-10 lg:my-10
|
|
||||||
bg-white
|
|
||||||
dark:bg-gray-800">
|
|
||||||
<div className="container max-w-6xl relative mx-auto relative flex row lg:mb-10 h-auto">
|
|
||||||
<div className="place-self-center lg:col-span-7 md:px-5 md:px-0 md:pr-10">
|
|
||||||
<h3 className="lg:max-w-2xl mb-4 lg:my-10 text-xl font-extrabold tracking-tight leading-none md:text-2xl xl:text-3xl
|
|
||||||
dark:text-white">
|
|
||||||
Méthode révolutionnaire pour apprendre à jouer
|
|
||||||
</h3>
|
|
||||||
<p className="lg:max-w-2xl mb-6 font-light text-gray-500 lg:mb-8 md:text-lg
|
|
||||||
dark:text-gray-400">
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed feugiat nulla lorem, at consectetur ligula pulvinar nec. Fusce dictum aliquet tellus id aliquam. Praesent feugiat tincidunt ante. Aliquam non lectus est. Suspendisse porta, dolor vel aliquet pharetra, ipsum diam laoreet ante, a feugiat nisi justo eu est.
|
|
||||||
</p>
|
|
||||||
<p className="lg:max-w-2xl font-light text-gray-500 lg:mb-8 md:text-lg
|
|
||||||
dark:text-gray-400">
|
|
||||||
Suspendisse in eros nisl. Vivamus eu convallis massa. Phasellus sit amet felis ut velit semper sagittis eget vitae arcu. Nunc leo est, vulputate sed libero non, efficitur lobortis odio. Proin fermentum massa non metus bibendum imperdiet.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="hidden relative md:mt-10 lg:col-span-5 lg:flex grow justify-around">
|
|
||||||
<div className="md:w-2/5 relative bg-gray-200 rounded-lg h-[350px]"></div>
|
|
||||||
<div className="md:w-2/5 relative bg-gray-200 rounded-lg h-[350px] top-10"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeSectionGrid;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import HomeSectionVideo from './home-section-video';
|
|
||||||
|
|
||||||
describe('HomeSectionVideo', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<HomeSectionVideo />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
import styles from './home-section-video.module.scss';
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface HomeSectionVideoProps {}
|
|
||||||
|
|
||||||
export function HomeSectionVideo(props: HomeSectionVideoProps) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<section className="container relative max-w-screen-xl mx-auto relative flex flex-col justify-center mb-10">
|
|
||||||
<h2 className="font-bold w-full text-center mt-5 text-2xl mx-auto text-blue-800">
|
|
||||||
Démonstration en vidéo
|
|
||||||
</h2>
|
|
||||||
<p className="text-lg text-gray-500 mb-10 text-center">Rien ne vaut une démonstration pour convaincre !</p>
|
|
||||||
|
|
||||||
<iframe src="https://embed.api.video/vod/vi2JpEFEClejM7A4hhn6i7fU"
|
|
||||||
width="90%"
|
|
||||||
frameBorder="0"
|
|
||||||
scrolling="no"
|
|
||||||
className="mx-auto"
|
|
||||||
allowFullScreen={true}></iframe>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeSectionVideo;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import Home from './home';
|
|
||||||
|
|
||||||
describe('Home', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<Home />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
import styles from './home.module.scss';
|
|
||||||
import HomeSectionGrid from "../home-section-grid/home-section-grid";
|
|
||||||
import HomeSectionCardsHeader from "../home-section-cards-header/home-section-cards-header";
|
|
||||||
import HomeSectionVideo from "../home-section-video/home-section-video";
|
|
||||||
import HomeSectionComments from "../home-section-comments/home-section-comments";
|
|
||||||
import HomeSectionBlog from "../home-section-blog/home-section-blog";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface HomeProps {
|
|
||||||
posts: object[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function HomeContent({posts}: HomeProps) {
|
|
||||||
return (
|
|
||||||
<div className={styles['container']}>
|
|
||||||
<header className="w-full hidden sm:block min-h-[40vh] md:min-h-[50vh] lg:min-h-[75vh] bg-gray-500 bg-cover bg-no-repeat" style={{backgroundImage: 'url(/images/home.jpeg)'}}></header>
|
|
||||||
<HomeSectionCardsHeader />
|
|
||||||
<HomeSectionGrid />
|
|
||||||
<HomeSectionVideo />
|
|
||||||
<HomeSectionComments />
|
|
||||||
<HomeSectionBlog posts={posts} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default HomeContent;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react';
|
|
||||||
|
|
||||||
import LastArticles from './last-articles';
|
|
||||||
|
|
||||||
describe('LastArticles', () => {
|
|
||||||
it('should render successfully', () => {
|
|
||||||
const { baseElement } = render(<LastArticles />);
|
|
||||||
expect(baseElement).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
import delve from 'dlv';
|
|
||||||
|
|
||||||
import styles from './last-articles.module.scss';
|
|
||||||
import {environment} from "../../environments/environment";
|
|
||||||
import {format} from "date-fns";
|
|
||||||
|
|
||||||
/* eslint-disable-next-line */
|
|
||||||
export interface LastArticlesProps {
|
|
||||||
items: object[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function LastArticles({items = []}: LastArticlesProps) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={styles['container'] + "rounded-lg mx-2 lg:mx-0 mt-5 lg:mt-0 p-5 mb-5 shadow-sm" +
|
|
||||||
" bg-white" +
|
|
||||||
" dark:bg-gray-800"}>
|
|
||||||
<div className="flex items-center justify-between mb-4">
|
|
||||||
<h5 className="text-xl font-bold leading-none text-gray-900 dark:text-white">Derniers articles publiés</h5>
|
|
||||||
</div>
|
|
||||||
<div className="flow-root">
|
|
||||||
<ul role="list" className="divide-y divide-gray-200 dark:divide-gray-700">
|
|
||||||
{items.map((item: object, index: number) => (<li key={'last-articles-' + index} className="py-3 sm:py-4">
|
|
||||||
<div className="flex items-center space-x-4">
|
|
||||||
<div className="flex-shrink-0">
|
|
||||||
<img className="w-[85px] h-[75px] rounded-lg"
|
|
||||||
src={environment.strapiUrl + delve(item, 'attributes.image.data.attributes.formats.medium.url', '')}
|
|
||||||
alt="Neil image"/>
|
|
||||||
</div>
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<p className="text-xl font-medium text-gray-900 dark:text-white">
|
|
||||||
{delve(item, 'attributes.title', 'N/A')}
|
|
||||||
</p>
|
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
|
||||||
{delve(item, 'attributes.category.data.attributes.name', 'N/A')} - {format(new Date(delve(item, 'attributes.publishedAt', 'Jun 1, 2020')), 'dd/MM/yyyy')}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>))}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default LastArticles;
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
.app-container {
|
|
||||||
position: relative;
|
|
||||||
min-height: 100vh;
|
|
||||||
|
|
||||||
.app-content {
|
|
||||||
position: relative;
|
|
||||||
padding-top: 58px;
|
|
||||||
min-height: calc(100vh - 189px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.without-headers {
|
|
||||||
padding-top: 0;
|
|
||||||
|
|
||||||
.app-content {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.without-footer {
|
|
||||||
padding-top: 0;
|
|
||||||
|
|
||||||
.app-content {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 453px) {
|
|
||||||
.app-container:not(.without-footer) {
|
|
||||||
.app-content {
|
|
||||||
min-height: calc(100vh - 169px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 640px) {
|
|
||||||
.app-container:not(.without-footer) {
|
|
||||||
.app-content {
|
|
||||||
min-height: calc(100vh - 133px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
.app-container:not(.without-headers) {
|
|
||||||
.app-content {
|
|
||||||
padding-top: 128px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.app-container:not(.without-footer) {
|
|
||||||
.app-content {
|
|
||||||
min-height: calc(100vh - 165px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 1024px) {
|
|
||||||
.app-container:not(.without-footer) {
|
|
||||||
.app-content {
|
|
||||||
padding-top: 131px;
|
|
||||||
min-height: calc(100vh - 181px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
import Header from "../header/header";
|
|
||||||
import Footer from "../footer/footer";
|
|
||||||
|
|
||||||
import styles from './layout.module.scss';
|
|
||||||
|
|
||||||
export function Layout({
|
|
||||||
showHeaders = true,
|
|
||||||
showFooter = true,
|
|
||||||
menuHeader = [],
|
|
||||||
menuFooter = [],
|
|
||||||
children = null,
|
|
||||||
className = '',
|
|
||||||
headerTransparent = false
|
|
||||||
}) {
|
|
||||||
|
|
||||||
const renderHeaders = () => {
|
|
||||||
if (showHeaders) {
|
|
||||||
return (<Header items={menuHeader}/>)
|
|
||||||
} else {
|
|
||||||
return ('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const renderFooters = () => {
|
|
||||||
if (showFooter) {
|
|
||||||
return (<Footer items={menuFooter}/>)
|
|
||||||
} else {
|
|
||||||
return ('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{renderHeaders()}
|
|
||||||
<div
|
|
||||||
className={'dark:bg-gray-900 bg-gray-50 ' + styles['app-container'] + ' ' + (showHeaders ? '' : styles['without-headers']) + ' ' + (showFooter ? '' : styles['without-footer']) + ' ' + className}>
|
|
||||||
<div className={styles['app-content'] + " w-full mx-auto"}>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
{renderFooters()}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Layout;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
import delve from "dlv";
|
|
||||||
|
|
||||||
import {siteConfig} from "../../config";
|
|
||||||
import Head from "next/head";
|
|
||||||
|
|
||||||
export const SeoConfig = ({metaDescription = null, lang = null, meta = [], metaTitle = null, SharedImage = null}) => {
|
|
||||||
const description = metaDescription || siteConfig.siteDescription;
|
|
||||||
const title = metaTitle || siteConfig.siteTitle;
|
|
||||||
const metaImage = SharedImage ? delve(SharedImage, `media.data.attributes.formats.small.url`, siteConfig.siteLogo) : siteConfig.siteLogo;
|
|
||||||
const metaLang = lang || siteConfig.siteLanguage;
|
|
||||||
const metas = [
|
|
||||||
{
|
|
||||||
name: `description`,
|
|
||||||
content: metaDescription
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:title`,
|
|
||||||
content: metaTitle
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:description`,
|
|
||||||
content: metaDescription
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:image`,
|
|
||||||
content: metaImage
|
|
||||||
},
|
|
||||||
{
|
|
||||||
property: `og:type`,
|
|
||||||
content: 'website'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:card`,
|
|
||||||
content: `summary_large_image`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:creator`,
|
|
||||||
content: siteConfig.author
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:title`,
|
|
||||||
content: metaTitle
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: `twitter:description`,
|
|
||||||
content: metaDescription
|
|
||||||
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const metaList = meta && meta.length > 0 ? meta : metas;
|
|
||||||
const type = 'website';
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Head>
|
|
||||||
<title>{title}</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<meta name="description"
|
|
||||||
content={description}/>
|
|
||||||
<meta property="og:title"
|
|
||||||
content={title}/>
|
|
||||||
<meta property="lang"
|
|
||||||
content={lang}/>
|
|
||||||
{metaList.map((meta, index) => (
|
|
||||||
<meta key={meta + index} property={meta.name} content={meta.content}/>
|
|
||||||
))}
|
|
||||||
</Head>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SeoConfig;
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
export const config = {
|
|
||||||
env: {
|
|
||||||
STRAPI_URL_API: process.env.NX_STRAPI_URL_API,
|
|
||||||
STRAPI_URL: process.env.NX_STRAPI_URL,
|
|
||||||
NEXTAUTH_SECRET: process.env.NX_NEXTAUTH_SECRET,
|
|
||||||
NEXTAUTH_URL: process.env.NX_NEXTAUTH_URL,
|
|
||||||
},
|
|
||||||
mainApiEndpoint: 'https://conduit.productionready.io/api'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const theme = {
|
|
||||||
colors: {
|
|
||||||
primary: '#3b5998',
|
|
||||||
secondary: '#8b9dc3',
|
|
||||||
gray: '#f7f7f7'
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
xl: 1200,
|
|
||||||
l: 900,
|
|
||||||
m: 750,
|
|
||||||
s: 400
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const siteConfig = {
|
|
||||||
siteTitle: 'Conduit', // Navigation and Site Title
|
|
||||||
siteUrl: process.env.ROOT_URL || 'https://next.org', // Domain of your site. No trailing slash!
|
|
||||||
siteLanguage: 'fr', // Language Tag on <html> element
|
|
||||||
siteLogo: '/logo.png', // Used for SEO and manifest, path to your image you placed in the 'static' folder
|
|
||||||
siteDescription: 'Real world example of nextjs SSR',
|
|
||||||
author: 'arrlancore', // Author for schemaORGJSONLD
|
|
||||||
organization: 'Open Source Organization',
|
|
||||||
|
|
||||||
userTwitter: '@arrlancore', // Twitter Username
|
|
||||||
ogSiteName: 'Dwiki Arlan', // Facebook Site Name
|
|
||||||
ogLanguage: 'en_US',
|
|
||||||
googleAnalyticsID: process.env.GOOGLE_ANALYTIC_ID || 'UA-XXX123-1',
|
|
||||||
|
|
||||||
// Manifest and Progress color
|
|
||||||
themeColor: '#4147DC',
|
|
||||||
backgroundColor: '#231C42',
|
|
||||||
defaultUserAvatar: '',
|
|
||||||
|
|
||||||
// Social component
|
|
||||||
twitter: 'https://twitter.com/arrlancore/',
|
|
||||||
twitterHandle: '@arrlancore',
|
|
||||||
github: 'https://github.com/arrlancore/',
|
|
||||||
youtube: 'https://www.youtube.com/',
|
|
||||||
rss: 'https://next.org/blog/rss.xml'
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
export const environment = {
|
|
||||||
appUrl: 'http://localhost:4200',
|
|
||||||
strapiUrl: 'http://localhost:1337',
|
|
||||||
strapiApiUrl: 'http://localhost:1337/api',
|
|
||||||
nextAuthSecret: "yBNW1wrb9CgOvEfbX6EQCvCDqiMkRBZP",
|
|
||||||
meiliUrl: "http://127.0.0.1:7700",
|
|
||||||
meiliApiKey: "f2e963e883cbacf6d4f63e792dc276491b8a866fb837f3fda37b8b78889a6851",
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
export const environment = {
|
|
||||||
appUrl: 'http://localhost:4200',
|
|
||||||
strapiUrl: 'https://admin.mecp.nasercloud.fr',
|
|
||||||
strapiApiUrl: 'https://admin.mecp.nasercloud.fr/api',
|
|
||||||
nextAuthSecret: "yBNW1wrb9CgOvEfbX6EQCvCDqiMkRBZP",
|
|
||||||
meiliUrl: "https://ms-b6dafcb0b382-1943.fra.meilisearch.io",
|
|
||||||
meiliApiKey: "0e9a9d027b9e6b2d98c9670e5030a8d1aa72cab911fd768d4ad02636ae673690",
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
export const environment = {
|
|
||||||
appUrl: 'http://localhost:4200',
|
|
||||||
strapiUrl: 'https://admin.mecp.nasercloud.fr',
|
|
||||||
strapiApiUrl: 'https://admin.mecp.nasercloud.fr/api',
|
|
||||||
nextAuthSecret: "yBNW1wrb9CgOvEfbX6EQCvCDqiMkRBZP",
|
|
||||||
meiliUrl: "https://ms-b6dafcb0b382-1943.fra.meilisearch.io",
|
|
||||||
meiliApiKey: "dda9e4a354839db9ae18c3722ae75422515c06525b3a841010928b5256f54e72",
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
export const environment = {
|
|
||||||
appUrl: 'http://localhost:4200',
|
|
||||||
strapiUrl: 'http://localhost:1337',
|
|
||||||
strapiApiUrl: 'http://localhost:1337/api',
|
|
||||||
nextAuthSecret: "yBNW1wrb9CgOvEfbX6EQCvCDqiMkRBZP",
|
|
||||||
meiliUrl: "http://127.0.0.1:7700",
|
|
||||||
meiliApiKey: "dda9e4a354839db9ae18c3722ae75422515c06525b3a841010928b5256f54e72",
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
export default {
|
|
||||||
displayName: 'website',
|
|
||||||
preset: '../../jest.preset.js',
|
|
||||||
transform: {
|
|
||||||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
|
||||||
'^.+\\.[tj]sx?$': ['babel-jest', {presets: ['@nrwl/next/babel']}],
|
|
||||||
},
|
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
||||||
collectCoverage: true,
|
|
||||||
coverageReporters: ["text", ["lcov", {"projectRoot": "./apps/website"}]],
|
|
||||||
coverageDirectory: './coverage',
|
|
||||||
moduleNameMapper: {
|
|
||||||
'^@/(.*)$': '<rootDir>/$1',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import * as _ from 'lodash';
|
|
||||||
|
|
||||||
import {environment} from "../environments/environment";
|
|
||||||
import {config} from "../config";
|
|
||||||
|
|
||||||
export type Inputs = {
|
|
||||||
email: string,
|
|
||||||
username: string,
|
|
||||||
password: string,
|
|
||||||
passwordConfirmation: string,
|
|
||||||
agreement: boolean,
|
|
||||||
newsletter: boolean,
|
|
||||||
}
|
|
||||||
|
|
||||||
export type LostPasswordInputs = {
|
|
||||||
email: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ResetPasswordInputs = {
|
|
||||||
password: string,
|
|
||||||
passwordConfirmation: string,
|
|
||||||
code: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const hasAvatar = (user) => {
|
|
||||||
return !_.isNil(user.avatar);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getBackendImg = (imageUrl: string) => {
|
|
||||||
return `${environment.strapiUrl}${imageUrl}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const signUpRequest = async (inputs: Inputs) => {
|
|
||||||
try {
|
|
||||||
const registerResponse = await axios.post(`${environment.strapiApiUrl}/auth/local/register`, {
|
|
||||||
email: inputs.email,
|
|
||||||
password: inputs.password,
|
|
||||||
username: inputs.username,
|
|
||||||
newsletter: inputs.newsletter
|
|
||||||
});
|
|
||||||
return registerResponse.data;
|
|
||||||
} catch (err) {
|
|
||||||
return Promise.reject('Internal error');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
import axios from 'axios';
|
|
||||||
import {signIn} from "next-auth/react";
|
|
||||||
import * as _ from 'lodash';
|
|
||||||
|
|
||||||
import {config} from "../config";
|
|
||||||
import {environment} from "../environments/environment";
|
|
||||||
|
|
||||||
export async function createJwtToken(email, password) {
|
|
||||||
return await signIn('credentials', {
|
|
||||||
redirect: false,
|
|
||||||
email,
|
|
||||||
password,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function signInStrapi({email, password}) {
|
|
||||||
const res = await axios.post(`${environment.strapiApiUrl}/auth/local`, {
|
|
||||||
identifier: email,
|
|
||||||
password,
|
|
||||||
});
|
|
||||||
if (res && res.data) {
|
|
||||||
const user = await axios.get(`${environment.strapiApiUrl}/users/${res.data.user.id}?populate=deep`);
|
|
||||||
if (user && user.data) {
|
|
||||||
res.data.user = {...res.data.user, ...user.data};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function lostPasswordStrapi({email}) {
|
|
||||||
const res = await axios.post(`${environment.strapiApiUrl}/auth/forgot-password`, {email});
|
|
||||||
if (res && res.data) {
|
|
||||||
return res.data.ok;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function resetPasswordStrapi({password, passwordConfirmation, code}) {
|
|
||||||
const res = await axios.post(`${environment.strapiApiUrl}/auth/reset-password`, {
|
|
||||||
password,
|
|
||||||
passwordConfirmation,
|
|
||||||
code
|
|
||||||
});
|
|
||||||
if (res && res.data) {
|
|
||||||
return !_.isNil(res.data.jwt);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
import delve from 'dlv';
|
|
||||||
|
|
||||||
import {environment} from "../environments/environment";
|
|
||||||
|
|
||||||
export type ImageFormatType = "default" | "thumbnail" | "medium" | "small";
|
|
||||||
|
|
||||||
export const getCategoryUrl = (item): string => {
|
|
||||||
const categorySlug = !delve(item, 'attributes', null) ? delve(item, 'category.data.attributes.slug', '') : delve(item, 'attributes.category.data.attributes.slug', '');
|
|
||||||
return '/blog/' + categorySlug;
|
|
||||||
}
|
|
||||||
export const getPostUrl = (item): string => {
|
|
||||||
const categorySlug = !delve(item, 'attributes', null) ? delve(item, 'category.data.attributes.slug', '') : delve(item, 'attributes.category.data.attributes.slug', '');
|
|
||||||
const postSlug = !delve(item, 'attributes', null) ? delve(item, 'slug', '') : delve(item, 'attributes.slug', '');
|
|
||||||
return '/blog/' + categorySlug + '/' + postSlug;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getStrapiImage = (item, format: ImageFormatType = 'default') => {
|
|
||||||
const image = !delve(item, 'attributes', null) ? delve(item, 'image.data.attributes', {}) : delve(item, 'attributes.image.data.attributes', {});
|
|
||||||
console.log(item, image);
|
|
||||||
switch (format) {
|
|
||||||
case "default":
|
|
||||||
return environment.strapiUrl + delve(image, "url", "/images/default.png");
|
|
||||||
case "medium":
|
|
||||||
return environment.strapiUrl + delve(image, "formats.medium.url", "/images/default.png");
|
|
||||||
case "small":
|
|
||||||
return environment.strapiUrl + delve(image, "formats.small.url", "/images/default.png");
|
|
||||||
case "thumbnail":
|
|
||||||
return environment.strapiUrl + delve(image, "formats.thumbnail.url", "/images/default.png");
|
|
||||||
default:
|
|
||||||
return environment.strapiUrl + delve(image, "url", "/images/default.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export const getStrapiImageSize = (item, format: ImageFormatType = 'default'): [number, number] => {
|
|
||||||
const image = delve(item, 'attributes.image.data.attributes', {});
|
|
||||||
switch (format) {
|
|
||||||
case "default":
|
|
||||||
return [delve(image, "width", 100), delve(image, "height", 100)];
|
|
||||||
case "medium":
|
|
||||||
return [delve(image, "formats.medium.width", 100), delve(image, "formats.medium.height", 100)];
|
|
||||||
case "small":
|
|
||||||
return [delve(image, "formats.small.width", 100), delve(image, "formats.small.height", 100)];
|
|
||||||
case "thumbnail":
|
|
||||||
return [delve(image, "formats.thumbnail.width", 100), delve(image, "formats.thumbnail.height", 100)];
|
|
||||||
default:
|
|
||||||
return [delve(image, "width", 100), delve(image, "height", 100)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "website",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"dependencies": {
|
|
||||||
"@nrwl/next": "15.5.1",
|
|
||||||
"next": "13.1.1",
|
|
||||||
"react": "18.2.0",
|
|
||||||
"react-dom": "18.2.0",
|
|
||||||
"typescript": "4.8.4"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"start": "next start"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
import App, {AppProps} from 'next/app';
|
|
||||||
import {SessionProvider} from "next-auth/react";
|
|
||||||
import {config, library} from "@fortawesome/fontawesome-svg-core";
|
|
||||||
import '@fortawesome/fontawesome-svg-core/styles.css';
|
|
||||||
import {
|
|
||||||
faBagShopping,
|
|
||||||
faChalkboardUser,
|
|
||||||
faGraduationCap,
|
|
||||||
faGuitar,
|
|
||||||
faLinesLeaning,
|
|
||||||
faRightToBracket,
|
|
||||||
faScrewdriverWrench,
|
|
||||||
faTabletScreenButton,
|
|
||||||
faUserPlus
|
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import axios from "axios";
|
|
||||||
import delve from 'dlv';
|
|
||||||
import {ThemeProvider} from "next-themes";
|
|
||||||
|
|
||||||
import {wrapper} from "../store/store";
|
|
||||||
|
|
||||||
import {environment} from "../environments/environment";
|
|
||||||
import './styles.css';
|
|
||||||
|
|
||||||
config.autoAddCss = false;
|
|
||||||
|
|
||||||
library.add(faRightToBracket);
|
|
||||||
library.add(faUserPlus);
|
|
||||||
library.add(faBagShopping);
|
|
||||||
library.add(faTabletScreenButton);
|
|
||||||
library.add(faGraduationCap);
|
|
||||||
library.add(faChalkboardUser);
|
|
||||||
library.add(faLinesLeaning);
|
|
||||||
library.add(faGuitar);
|
|
||||||
library.add(faScrewdriverWrench);
|
|
||||||
|
|
||||||
interface CustomAppProps extends AppProps {
|
|
||||||
menuHeader: object[],
|
|
||||||
menuFooter: object[],
|
|
||||||
page: object,
|
|
||||||
seo: object,
|
|
||||||
}
|
|
||||||
|
|
||||||
const getPageMetadata = async (path) => {
|
|
||||||
try {
|
|
||||||
return await axios.get(`${environment.strapiApiUrl}/pages?filters[slug]=${path === '/' ? 'home' : path.slice(1, path.length)}&populate=deep`);
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
return Promise.resolve({})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const CustomApp = ({Component, pageProps: {session, ...pageProps}, menuFooter, menuHeader, seo}: CustomAppProps) => {
|
|
||||||
pageProps = {...pageProps, menuFooter, menuHeader, seo};
|
|
||||||
return (
|
|
||||||
<SessionProvider session={session}>
|
|
||||||
<ThemeProvider enableSystem={true}
|
|
||||||
attribute="class">
|
|
||||||
<Component {...pageProps} />
|
|
||||||
</ThemeProvider>
|
|
||||||
</SessionProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomApp.getInitialProps = async (context) => {
|
|
||||||
const appProps = await App.getInitialProps(context);
|
|
||||||
const path = context.router.pathname;
|
|
||||||
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 page = await getPageMetadata(path);
|
|
||||||
|
|
||||||
return {
|
|
||||||
...appProps,
|
|
||||||
menuHeader: delve(menuHeader, 'data.data.attributes.items.data', []),
|
|
||||||
menuFooter: delve(menuFooter, 'data.data.attributes.items.data', []),
|
|
||||||
page: delve(page, "data.data.0.attributes", {}),
|
|
||||||
seo: delve(page, "data.data.0.attributes.seo", {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default wrapper.withRedux(CustomApp);
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
import {Head, Html, Main, NextScript} from 'next/document';
|
|
||||||
|
|
||||||
export default function Document() {
|
|
||||||
return (
|
|
||||||
<Html lang='en'>
|
|
||||||
<Head/>
|
|
||||||
<body>
|
|
||||||
<Main/>
|
|
||||||
<NextScript/>
|
|
||||||
</body>
|
|
||||||
</Html>
|
|
||||||
)
|
|
||||||
};
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
import NextAuth, {Session, User} from 'next-auth';
|
|
||||||
import CredentialsProvider from 'next-auth/providers/credentials';
|
|
||||||
import {JWT} from "next-auth/jwt";
|
|
||||||
import {AdapterUser} from "next-auth/adapters";
|
|
||||||
|
|
||||||
import {environment} from "../../../environments/environment";
|
|
||||||
import {signInStrapi} from '../../../libs/auth';
|
|
||||||
|
|
||||||
export default NextAuth({
|
|
||||||
|
|
||||||
// Configure one or more authentication providers
|
|
||||||
providers: [
|
|
||||||
CredentialsProvider({
|
|
||||||
name: 'Sign in with Email',
|
|
||||||
credentials: {
|
|
||||||
email: {label: 'Email', type: 'text'},
|
|
||||||
password: {label: 'Password', type: 'password'},
|
|
||||||
},
|
|
||||||
async authorize(credentials, req) {
|
|
||||||
/**
|
|
||||||
* This function is used to define if the user is authenticated or not.
|
|
||||||
* If authenticated, the function should return an object contains the user data.
|
|
||||||
* If not, the function should return `null`.
|
|
||||||
*/
|
|
||||||
if (credentials == null) return null;
|
|
||||||
/**
|
|
||||||
* credentials is defined in the config above.
|
|
||||||
* We can expect it contains two properties: `email` and `password`
|
|
||||||
*/
|
|
||||||
try {
|
|
||||||
const {user, jwt} = await signInStrapi({
|
|
||||||
email: credentials.email,
|
|
||||||
password: credentials.password,
|
|
||||||
});
|
|
||||||
return {...user, jwt};
|
|
||||||
} catch (error) {
|
|
||||||
// Sign In Fail
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
callbacks: {
|
|
||||||
session: async ({session, token}: {session: Session, token: JWT}) => {
|
|
||||||
(session as any).id = token.id;
|
|
||||||
(session as any).jwt = token.jwt;
|
|
||||||
(session as any).user = {
|
|
||||||
avatar: (token.user as any).avatar,
|
|
||||||
username: (token.user as any).username,
|
|
||||||
email: (token.user as any).email,
|
|
||||||
};
|
|
||||||
return Promise.resolve(session);
|
|
||||||
},
|
|
||||||
jwt: async ({token, user}: {token: JWT, user: User | AdapterUser}) => {
|
|
||||||
const isSignIn = user ? true : false;
|
|
||||||
if (isSignIn) {
|
|
||||||
token.id = user.id;
|
|
||||||
token.jwt = (user as any).jwt;
|
|
||||||
token.user = (user as any);
|
|
||||||
}
|
|
||||||
return Promise.resolve(token);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
secret: environment.nextAuthSecret
|
|
||||||
});
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import delve from 'dlv';
|
|
||||||
|
|
||||||
import {environment} from "../../../environments/environment";
|
|
||||||
import SeoConfig from "../../../components/seo-config/seo-config";
|
|
||||||
import Layout from "../../../components/layout/layout";
|
|
||||||
import styles from "../../index.module.scss";
|
|
||||||
import BlogSearch from "../../../components/blog-search/blog-search";
|
|
||||||
import Categories from "../../../components/categories/categories";
|
|
||||||
import LastArticles from "../../../components/last-articles/last-articles";
|
|
||||||
import CardBlogDetails from "../../../components/card-blog-details/card-blog-details";
|
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
|
||||||
const categories = await axios.get(`${environment.strapiApiUrl}/categories?populate=deep`);
|
|
||||||
const lastPublished = await axios.get(`${environment.strapiApiUrl}/articles?populate=deep&sort=publishedAt:DESC`);
|
|
||||||
const post = await axios.get(`${environment.strapiApiUrl}/articles?populate=deep&filters[slug]=${context.params.post_slug}`);
|
|
||||||
|
|
||||||
if (!delve(post, "data.data.0.attributes", null)) {
|
|
||||||
return {
|
|
||||||
notFound: true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
categories: delve(categories, 'data.data', []),
|
|
||||||
lastPublished: delve(lastPublished, 'data.data', []),
|
|
||||||
post: delve(post, "data.data.0.attributes", null),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function PostBlog({menuHeader, menuFooter, seo, categories, post, lastPublished}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SeoConfig {...seo}/>
|
|
||||||
<Layout menuHeader={menuHeader} menuFooter={menuFooter} headerTransparent={true}>
|
|
||||||
<main className={styles['blog-container'] + " w-full lg:my-10"}>
|
|
||||||
<section className="container max-w-screen-xl mx-auto relative flex flex-col lg:flex-row">
|
|
||||||
<section className="grow lg:basis-4/6 mx-2 lg:mx-0 lg:pr-5">
|
|
||||||
<CardBlogDetails item={post}/>
|
|
||||||
</section>
|
|
||||||
<aside className="grow lg:basis-2/6">
|
|
||||||
<BlogSearch/>
|
|
||||||
<Categories items={categories}/>
|
|
||||||
<LastArticles items={lastPublished}/>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PostBlog;
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import delve from "dlv";
|
|
||||||
|
|
||||||
import {environment} from "../../../environments/environment";
|
|
||||||
import SeoConfig from "../../../components/seo-config/seo-config";
|
|
||||||
import Layout from "../../../components/layout/layout";
|
|
||||||
import BlogSearch from "../../../components/blog-search/blog-search";
|
|
||||||
import Categories from "../../../components/categories/categories";
|
|
||||||
import LastArticles from "../../../components/last-articles/last-articles";
|
|
||||||
|
|
||||||
import styles from "../index.module.scss";
|
|
||||||
import CardBlog from "../../../components/card-blog/card-blog";
|
|
||||||
import BlogPagination from "../../../components/blog-pagination/blog-pagination";
|
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
|
||||||
const {query} = context;
|
|
||||||
const categories = await axios.get(`${environment.strapiApiUrl}/categories?populate=deep`);
|
|
||||||
const category = await axios.get(`${environment.strapiApiUrl}/categories?populate=deep&filters[slug]=${context.params.category_slug}`);
|
|
||||||
const lastPublished = await axios.get(`${environment.strapiApiUrl}/articles?populate=deep&_sort=date:DESC&sort=publishedAt:DESC`);
|
|
||||||
let postsUrl = `${environment.strapiApiUrl}/articles?populate=deep&sort=publishedAt:DESC&filters[category][slug][$contains]=${context.params.category_slug}`;
|
|
||||||
if (query && query.page) {
|
|
||||||
postsUrl += `$pagination[page]=${query.page}`;
|
|
||||||
}
|
|
||||||
const posts = await axios.get(postsUrl);
|
|
||||||
|
|
||||||
if (!delve(category, "data.data.0.attributes", null)) {
|
|
||||||
return {
|
|
||||||
notFound: true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
categories: delve(categories, 'data.data', []),
|
|
||||||
category: delve(category, "data.data.0.attributes", null),
|
|
||||||
lastPublished: delve(lastPublished, 'data.data', []),
|
|
||||||
posts: delve(posts, 'data.data', []),
|
|
||||||
paginator: delve(posts, 'data.meta', []),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function CategoryBlog({menuHeader, menuFooter, seo, categories, category, posts, lastPublished, paginator}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SeoConfig {...seo}/>
|
|
||||||
<Layout menuHeader={menuHeader} menuFooter={menuFooter} headerTransparent={true}>
|
|
||||||
<main className={styles['blog-container'] + " w-full lg:my-10"}>
|
|
||||||
<section className="container max-w-screen-xl mx-auto relative flex">
|
|
||||||
<section className="grow lg:basis-4/6 mx-2 lg:mx-0 lg:pr-5">
|
|
||||||
<h3 className="text-2xl font-bold mb-5">{category.name}</h3>
|
|
||||||
{posts.length === 0 && (
|
|
||||||
<p>Aucun article n'a été posté dans cette catégorie pour l'instant</p>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
{posts.length > 0 && posts.map((post, index: number) => (
|
|
||||||
<CardBlog key={'card-blog-' + post.id + index} item={post}/>))
|
|
||||||
}
|
|
||||||
|
|
||||||
{posts.length > 0 && (<footer className="mt-10">
|
|
||||||
<BlogPagination paginator={paginator}/>
|
|
||||||
</footer>)}
|
|
||||||
</section>
|
|
||||||
<aside className="grow lg:basis-2/6">
|
|
||||||
<BlogSearch/>
|
|
||||||
<Categories items={categories}/>
|
|
||||||
<LastArticles items={lastPublished}/>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default CategoryBlog;
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
.blog-container {
|
|
||||||
}
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import delve from "dlv";
|
|
||||||
|
|
||||||
import SeoConfig from "../../components/seo-config/seo-config";
|
|
||||||
import Layout from "../../components/layout/layout";
|
|
||||||
import Categories from "../../components/categories/categories";
|
|
||||||
|
|
||||||
import styles from "./index.module.scss";
|
|
||||||
import BlogSearch from "../../components/blog-search/blog-search";
|
|
||||||
import {environment} from "../../environments/environment";
|
|
||||||
import CardBlog from "../../components/card-blog/card-blog";
|
|
||||||
import BlogPagination from "../../components/blog-pagination/blog-pagination";
|
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
|
||||||
const {query} = context;
|
|
||||||
|
|
||||||
let postsUrl = `${environment.strapiApiUrl}/articles?populate=deep&sort=publishedAt:DESC`;
|
|
||||||
if (query && query.page) {
|
|
||||||
postsUrl += `$pagination[page]=${query.page}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const categories = await axios.get(`${environment.strapiApiUrl}/categories?populate=deep`);
|
|
||||||
const posts = await axios.get(postsUrl);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
categories: delve(categories, 'data.data', []),
|
|
||||||
lastPublished: delve(posts, 'data.data', []),
|
|
||||||
paginator: delve(posts, 'data.meta', []),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Blog({menuHeader, menuFooter, seo, categories, lastPublished, paginator}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SeoConfig {...seo}/>
|
|
||||||
<Layout menuHeader={menuHeader} menuFooter={menuFooter} headerTransparent={true}>
|
|
||||||
<main className={styles['blog-container'] + " w-full lg:my-10"}>
|
|
||||||
<section className="container max-w-screen-xl mx-auto relative flex">
|
|
||||||
<section className="grow lg:basis-4/6 mx-2 lg:mx-0 lg:pr-5">
|
|
||||||
{lastPublished.map((post, index: number) => (
|
|
||||||
<CardBlog key={'card-blog-' + post.id + index} item={post}/>))
|
|
||||||
}
|
|
||||||
|
|
||||||
{lastPublished.length > 0 && (<footer className="mt-10">
|
|
||||||
<BlogPagination paginator={paginator}/>
|
|
||||||
</footer>)}
|
|
||||||
</section>
|
|
||||||
<aside className="grow lg:basis-2/6">
|
|
||||||
<BlogSearch/>
|
|
||||||
<Categories items={categories}/>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Blog;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import delve from "dlv";
|
|
||||||
|
|
||||||
import {environment} from "../../environments/environment";
|
|
||||||
|
|
||||||
import SeoConfig from "../../components/seo-config/seo-config";
|
|
||||||
import Layout from "../../components/layout/layout";
|
|
||||||
import HomeContent from "../../components/home/home";
|
|
||||||
|
|
||||||
import styles from "../blog/index.module.scss";
|
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
|
||||||
const postsUrl = `${environment.strapiApiUrl}/articles?populate=deep&sort=publishedAt:DESC&pagination[limit]=3`;
|
|
||||||
const posts = await axios.get(postsUrl);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
posts: delve(posts, 'data.data', []),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Home({menuHeader, menuFooter, seo, posts}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SeoConfig {...seo} />
|
|
||||||
<Layout menuHeader={menuHeader}
|
|
||||||
menuFooter={menuFooter}>
|
|
||||||
<main className={styles['blog-container'] + " w-full"}>
|
|
||||||
<HomeContent posts={posts} />
|
|
||||||
</main>
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Home;
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
//@import 'tailwindcss/base.css';
|
|
||||||
@import 'tailwindcss/components.css';
|
|
||||||
@import 'tailwindcss/utilities.css';
|
|
||||||
|
|
||||||
.page {
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import delve from 'dlv';
|
|
||||||
|
|
||||||
import {environment} from "../environments/environment";
|
|
||||||
|
|
||||||
import SeoConfig from "../components/seo-config/seo-config";
|
|
||||||
import Layout from "../components/layout/layout";
|
|
||||||
import HomeContent from "../components/home/home";
|
|
||||||
|
|
||||||
import styles from "./blog/index.module.scss";
|
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
|
||||||
const postsUrl = `${environment.strapiApiUrl}/articles?populate=deep&sort=publishedAt:DESC&pagination[limit]=3`;
|
|
||||||
const posts = await axios.get(postsUrl);
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
posts: delve(posts, 'data.data', []),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Index({menuHeader, menuFooter, posts, seo}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SeoConfig {...seo} />
|
|
||||||
<Layout menuHeader={menuHeader}
|
|
||||||
menuFooter={menuFooter}>
|
|
||||||
<main className={styles['blog-container'] + " w-full"}>
|
|
||||||
<HomeContent posts={posts} />
|
|
||||||
</main>
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Index;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Replace this with your own classes
|
|
||||||
*
|
|
||||||
* e.g.
|
|
||||||
* .container {
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
import {useState} from "react";
|
|
||||||
import {SubmitHandler, useForm} from "react-hook-form";
|
|
||||||
|
|
||||||
import SeoConfig from "../../components/seo-config/seo-config";
|
|
||||||
import Layout from "../../components/layout/layout";
|
|
||||||
import {LostPasswordInputs} from "../../libs/api";
|
|
||||||
import {lostPasswordStrapi} from "../../libs/auth";
|
|
||||||
|
|
||||||
import styles from "../sign-up/index.module.scss";
|
|
||||||
|
|
||||||
export function LostPassword({menuHeader, menuFooter, page, seo}) {
|
|
||||||
const {register, handleSubmit, formState: {errors}} = useForm({
|
|
||||||
defaultValues: {
|
|
||||||
email: ""
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const [isSent, setIsSent] = useState(null);
|
|
||||||
|
|
||||||
const onSubmit: SubmitHandler<LostPasswordInputs> = async (data: LostPasswordInputs) => {
|
|
||||||
try {
|
|
||||||
const result = await lostPasswordStrapi({email: data.email});
|
|
||||||
setIsSent(result);
|
|
||||||
} catch (e) {
|
|
||||||
setIsSent(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasErrors = () => Object.keys(errors).length > 0;
|
|
||||||
|
|
||||||
const isBoolean = (val) => typeof val === "boolean";
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SeoConfig {...seo}/>
|
|
||||||
<Layout menuHeader={menuHeader} menuFooter={menuFooter}>
|
|
||||||
<div className={styles['page-sign-up']}>
|
|
||||||
<section className={styles['section']}>
|
|
||||||
<div className="container max-w-screen-xl px-6 py-4 md:py-12 h-full mx-auto">
|
|
||||||
<div className="flex justify-center items-center flex-wrap h-full g-6 text-gray-800">
|
|
||||||
<div className="md:w-8/12 lg:w-6/12">
|
|
||||||
<div
|
|
||||||
className="w-full max-w-[560px] p-4 bg-white border border-gray-200 rounded-lg shadow-md sm:p-6 md:p-8 dark:bg-gray-800 dark:border-gray-700">
|
|
||||||
<form className="space-y-6" onSubmit={handleSubmit(onSubmit)}>
|
|
||||||
<header className="text-left block">
|
|
||||||
<h3 className="text-3xl font-normal dark:text-white mb-6">Mot de passe oublié</h3>
|
|
||||||
<p className="mb-6 text-base font-normal text-gray-500 dark:text-gray-400">
|
|
||||||
Veuillez saisir votre addresse email ci-dessous et nous vous enverrons un courriel pour
|
|
||||||
changer votre mot de passe.
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
<main>
|
|
||||||
{isBoolean(isSent) && isSent ? (<div
|
|
||||||
className="p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400"
|
|
||||||
role="alert">
|
|
||||||
<span className="font-medium">Email envoyé !</span> Vérifiez votre boite de réception ou vos
|
|
||||||
courrier indésirables.
|
|
||||||
</div>) : ('')}
|
|
||||||
{isBoolean(isSent) && !isSent ? (<div
|
|
||||||
className="p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"
|
|
||||||
role="alert">
|
|
||||||
<span className="font-medium">Oups !</span> Une erreur est survenue durant l'envoi de
|
|
||||||
l'email.
|
|
||||||
Rapprochez vous de nos équipes pour en savoir plus.
|
|
||||||
</div>) : ('')}
|
|
||||||
<section className="grid grid-cols-1 gap-4 mb-4">
|
|
||||||
<div>
|
|
||||||
<label htmlFor="email"
|
|
||||||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
|
|
||||||
E-mail
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<input type="email"
|
|
||||||
name="email"
|
|
||||||
id="email"
|
|
||||||
{...register("email", {required: "L'email est requis"})}
|
|
||||||
className={errors.email ? 'bg-red-50 border border-red-500 text-red-900 placeholder-red-700 text-sm rounded-lg focus:ring-red-500 dark:bg-gray-700 focus:border-red-500 block w-full p-2.5 dark:text-red-500 dark:placeholder-red-500 dark:border-red-500' : 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pr-10 p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white'}
|
|
||||||
placeholder="name@company.com"/>
|
|
||||||
{errors.email && (
|
|
||||||
<p className="mt-2 text-sm text-red-600 dark:text-red-500">{errors.email.message}</p>)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section className="flex items-center pt-5">
|
|
||||||
<button type="submit"
|
|
||||||
className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800 w-full disabled:bg-gray-500 focus:disabled:bg-gray-500 hover:disabled:bg-gray-500"
|
|
||||||
data-mdb-ripple="true"
|
|
||||||
data-mdb-ripple-color="light" disabled={hasErrors()}>
|
|
||||||
Envoyer le code par email
|
|
||||||
</button>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="md:w-8/12 lg:w-6/12 mb-12 md:mb-0 hidden md:block">
|
|
||||||
<img src="/images/page-lost-password.png"
|
|
||||||
className="w-full" alt="Phone image"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</Layout>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default LostPassword;
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue