mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
Compare commits
79 Commits
Author | SHA1 | Date | |
---|---|---|---|
8ecfeca50d | |||
fd0740d12a | |||
bd2dc9c9af | |||
a53888ab42 | |||
624e79eecd | |||
049ec367fc | |||
56f22d0c9b | |||
9adb67662e | |||
010087088f | |||
35d4396e80 | |||
934118737a | |||
b692dac926 | |||
dd582652ab | |||
337352de0c | |||
c513268cbb | |||
4fdcb2b667 | |||
377b8e91a6 | |||
fce29c9d4a | |||
c198f47aa9 | |||
8e051332cd | |||
9f3436e1df | |||
2f2373e62f | |||
c6b455dd10 | |||
4e089b41f2 | |||
6c102b1b35 | |||
52b10944b7 | |||
db36eb3e7a | |||
c739ad951d | |||
2802ff029f | |||
1a7457b44b | |||
ff210f879d | |||
607454b360 | |||
d1522fbf44 | |||
b82eae7499 | |||
73527ce8fe | |||
0cd885ee70 | |||
2cb2df975f | |||
37f5843adb | |||
d794d38f14 | |||
fc5ba28b8a | |||
b5945150b8 | |||
aa12d626d2 | |||
6ac4782b7d | |||
0aa998d593 | |||
56f975e53c | |||
5a16d24ea1 | |||
52267005ec | |||
99b9b12ac9 | |||
2cae77481f | |||
e98b47a459 | |||
4cc87758c1 | |||
1bb0f31223 | |||
af2dd0bd60 | |||
63d7485c8d | |||
74fde0ea40 | |||
0d2b318818 | |||
266b3f8589 | |||
f7d304ca80 | |||
63017953d7 | |||
20600eb976 | |||
7f920b77aa | |||
4f5dfc63ea | |||
712805df93 | |||
cd68f597c9 | |||
7ec3fe8ced | |||
90d22b2c7f | |||
4b06fd0522 | |||
b4427f36c2 | |||
b758c64e02 | |||
04469b83ea | |||
36d54666a0 | |||
a34cefec6e | |||
5c343395df | |||
028815a7b6 | |||
a2ad591d6d | |||
7087911756 | |||
35b1c4169f | |||
4c351b8179 | |||
701dccc018 |
@ -1,3 +1,14 @@
|
|||||||
{
|
{
|
||||||
"presets": ["next/babel"]
|
"presets": [
|
||||||
|
[
|
||||||
|
"next/babel",
|
||||||
|
{
|
||||||
|
"preset-env": {
|
||||||
|
"targets": {
|
||||||
|
"browsers": ">1%, not ie 11, not dead"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"next/core-web-vitals",
|
"next/core-web-vitals",
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
"plugins": ["prettier"],
|
"plugins": ["unicorn", "prettier"],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"project": "./tsconfig.json"
|
"project": "./tsconfig.json"
|
||||||
},
|
},
|
||||||
@ -15,6 +15,17 @@
|
|||||||
"jest": true
|
"jest": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"prettier/prettier": "error"
|
"prettier/prettier": "error",
|
||||||
|
"unicorn/prefer-node-protocol": "error",
|
||||||
|
"unicorn/prevent-abbreviations": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"replacements": {
|
||||||
|
"props": {
|
||||||
|
"properties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
57
.github/workflows/Divlo.yml
vendored
57
.github/workflows/Divlo.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
- uses: 'actions/checkout@v2.3.4'
|
- uses: 'actions/checkout@v2.3.4'
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v2.3.0'
|
uses: 'actions/setup-node@v2.4.0'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@ -46,13 +46,30 @@ jobs:
|
|||||||
- run: 'npm run lint:markdown'
|
- run: 'npm run lint:markdown'
|
||||||
- run: 'npm run lint:typescript'
|
- run: 'npm run lint:typescript'
|
||||||
|
|
||||||
build:
|
test-unit:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v2.3.4'
|
- uses: 'actions/checkout@v2.3.4'
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v2.3.0'
|
uses: 'actions/setup-node@v2.4.0'
|
||||||
|
with:
|
||||||
|
node-version: '16.x'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: 'Install'
|
||||||
|
run: 'npm install'
|
||||||
|
|
||||||
|
- name: 'Unit Test'
|
||||||
|
run: 'npm run test:unit'
|
||||||
|
|
||||||
|
test-lighthouse:
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
steps:
|
||||||
|
- uses: 'actions/checkout@v2.3.4'
|
||||||
|
|
||||||
|
- name: 'Use Node.js'
|
||||||
|
uses: 'actions/setup-node@v2.4.0'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@ -64,17 +81,17 @@ jobs:
|
|||||||
run: 'npm run build'
|
run: 'npm run build'
|
||||||
|
|
||||||
- name: 'Lighthouse'
|
- name: 'Lighthouse'
|
||||||
run: 'npm run lighthouse'
|
run: 'npm run test:lighthouse'
|
||||||
env:
|
env:
|
||||||
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
||||||
|
|
||||||
test:
|
test-e2e:
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v2.3.4'
|
- uses: 'actions/checkout@v2.3.4'
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v2.3.0'
|
uses: 'actions/setup-node@v2.4.0'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@ -82,18 +99,31 @@ jobs:
|
|||||||
- name: 'Install'
|
- name: 'Install'
|
||||||
run: 'npm install'
|
run: 'npm install'
|
||||||
|
|
||||||
- name: 'Test'
|
- name: 'Build'
|
||||||
run: 'npm run test'
|
run: 'npm run build'
|
||||||
|
|
||||||
|
- name: 'End To End (e2e) Test'
|
||||||
|
run: 'npm run test:e2e'
|
||||||
|
|
||||||
release:
|
release:
|
||||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||||
needs: [analyze, lint, build, test]
|
needs: [analyze, lint, test-unit, test-e2e, test-lighthouse]
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v2.3.4'
|
- uses: 'actions/checkout@v2.3.4'
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: 'Import GPG key'
|
||||||
|
uses: 'crazy-max/ghaction-import-gpg@v4'
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
git_user_signingkey: true
|
||||||
|
git_commit_gpgsign: true
|
||||||
|
|
||||||
- name: 'Use Node.js'
|
- name: 'Use Node.js'
|
||||||
uses: 'actions/setup-node@v2.3.0'
|
uses: 'actions/setup-node@v2.4.0'
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@ -101,13 +131,12 @@ jobs:
|
|||||||
- name: 'Install'
|
- name: 'Install'
|
||||||
run: 'npm install'
|
run: 'npm install'
|
||||||
|
|
||||||
- name: 'Archive Source code'
|
|
||||||
run: 'tar --exclude="./node_modules" --exclude=".git" -cvf "./Divlo.tar.gz" "./" --warning=no-file-changed'
|
|
||||||
|
|
||||||
- name: 'Release'
|
- name: 'Release'
|
||||||
run: 'npm run release'
|
run: 'npm run release'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
|
||||||
|
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}
|
||||||
|
|
||||||
- name: 'Deploy to Vercel'
|
- name: 'Deploy to Vercel'
|
||||||
run: 'npm run deploy -- --token="${VERCEL_TOKEN}" --prod'
|
run: 'npm run deploy -- --token="${VERCEL_TOKEN}" --prod'
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,6 +14,9 @@ dist
|
|||||||
|
|
||||||
# testing
|
# testing
|
||||||
coverage
|
coverage
|
||||||
|
cypress/screenshots
|
||||||
|
cypress/videos
|
||||||
|
cypress/downloads
|
||||||
|
|
||||||
# PWA
|
# PWA
|
||||||
**/workbox-*.js
|
**/workbox-*.js
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
"assert": {
|
"assert": {
|
||||||
"preset": "lighthouse:recommended",
|
"preset": "lighthouse:recommended",
|
||||||
"assertions": {
|
"assertions": {
|
||||||
"csp-xss": "warning",
|
"csp-xss": "warning"
|
||||||
"non-composited-animations": "warning",
|
|
||||||
"uses-responsive-images": "warning"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"upload": {
|
"upload": {
|
||||||
|
@ -13,11 +13,24 @@
|
|||||||
"preset": "conventionalcommits"
|
"preset": "conventionalcommits"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@semantic-release/npm",
|
|
||||||
[
|
[
|
||||||
"@semantic-release/github",
|
"@semantic-release/npm",
|
||||||
{
|
{
|
||||||
"assets": [{ "path": "Divlo.tar.gz", "label": "Source code (tar.gz)" }]
|
"npmPublish": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/git",
|
||||||
|
{
|
||||||
|
"assets": ["package.json", "package-lock.json"],
|
||||||
|
"message": "chore(release): ${nextRelease.version} [skip ci]"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@semantic-release/github",
|
||||||
|
[
|
||||||
|
"@saithodev/semantic-release-backmerge",
|
||||||
|
{
|
||||||
|
"backmergeStrategy": "merge"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
41
.vscode/settings.json
vendored
41
.vscode/settings.json
vendored
@ -1,9 +1,48 @@
|
|||||||
{
|
{
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
||||||
"prettier.configPath": ".prettierrc.json",
|
"prettier.configPath": ".prettierrc.json",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": true
|
"source.fixAll": true
|
||||||
|
},
|
||||||
|
"[css]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[sass]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[scss]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[json]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[jsonc]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescriptreact]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[javascriptreact]": {
|
||||||
|
"editor.autoClosingBrackets": "always",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
FROM node:16.5.0 AS dependencies
|
FROM node:16.8.0 AS dependencies
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY ./package*.json ./
|
COPY ./package*.json ./
|
||||||
RUN npm clean-install
|
RUN npm clean-install
|
||||||
|
|
||||||
FROM node:16.5.0 AS builder
|
FROM node:16.8.0 AS builder
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
|
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM node:16.5.0 AS runner
|
FROM node:16.8.0 AS runner
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
|
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"name": "Divlo",
|
"name": "Divlo",
|
||||||
"pronouns": "He' | 'Him",
|
"pronouns": "He/Him",
|
||||||
"birthDate": "31/03/2003",
|
"birthDate": "31/03/2003",
|
||||||
"nationality": "Alsace, France",
|
"nationality": "Alsace, France",
|
||||||
"interests": [
|
"interests": [
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"programmingLanguages": ["JavaScript", "TypeScript", "Python"],
|
"programmingLanguages": ["JavaScript", "TypeScript", "Python"],
|
||||||
"frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"],
|
"frontEnd": ["HTML", "CSS", "Tailwind CSS", "React.js (+ Next.js)"],
|
||||||
"backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"],
|
"backEnd": ["Node.js", "Fastify", "Prisma", "PostgreSQL", "MySQL"],
|
||||||
"tools": ["Ubuntu", "Hyper Terminal", "VSCode", "Git", "Docker"]
|
"tools": ["Ubuntu", "Visual Studio Code", "Git", "Docker"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react'
|
|
||||||
|
|
||||||
import Error404 from 'pages/404'
|
|
||||||
|
|
||||||
describe('GET /404', () => {
|
|
||||||
it('should render', async () => {
|
|
||||||
const { getByText } = render(<Error404 />)
|
|
||||||
expect(getByText('404')).toBeInTheDocument()
|
|
||||||
})
|
|
||||||
})
|
|
@ -1,10 +0,0 @@
|
|||||||
import { render } from '@testing-library/react'
|
|
||||||
|
|
||||||
import Error500 from 'pages/500'
|
|
||||||
|
|
||||||
describe('GET /500', () => {
|
|
||||||
it('should render', async () => {
|
|
||||||
const { getByText } = render(<Error500 />)
|
|
||||||
expect(getByText('500')).toBeInTheDocument()
|
|
||||||
})
|
|
||||||
})
|
|
@ -14,7 +14,12 @@ export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
|
|||||||
<>
|
<>
|
||||||
<h1 className='my-6 font-semibold text-4xl'>
|
<h1 className='my-6 font-semibold text-4xl'>
|
||||||
{t('errors:error')}{' '}
|
{t('errors:error')}{' '}
|
||||||
<span className='text-yellow dark:text-yellow-dark'>{statusCode}</span>
|
<span
|
||||||
|
className='text-yellow dark:text-yellow-dark'
|
||||||
|
data-cy='status-code'
|
||||||
|
>
|
||||||
|
{statusCode}
|
||||||
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p className='text-center text-lg'>
|
<p className='text-center text-lg'>
|
||||||
{message}{' '}
|
{message}{' '}
|
||||||
|
@ -11,10 +11,7 @@ export const Footer: React.FC<FooterProps> = (props) => {
|
|||||||
const { version } = props
|
const { version } = props
|
||||||
|
|
||||||
const versionLink = useMemo(() => {
|
const versionLink = useMemo(() => {
|
||||||
if (version !== '0.0.0-development') {
|
|
||||||
return `https://github.com/Divlo/Divlo/releases/tag/v${version}`
|
return `https://github.com/Divlo/Divlo/releases/tag/v${version}`
|
||||||
}
|
|
||||||
return 'https://github.com/Divlo/Divlo/tree/develop'
|
|
||||||
}, [version])
|
}, [version])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -15,7 +15,9 @@ export const LanguageFlag: React.FC<LanguageFlagProps> = (props) => {
|
|||||||
src={`/images/languages/${language}.svg`}
|
src={`/images/languages/${language}.svg`}
|
||||||
alt={language}
|
alt={language}
|
||||||
/>
|
/>
|
||||||
<p className='mx-2 text-base'>{language.toUpperCase()}</p>
|
<p data-cy='language-flag-text' className='mx-2 text-base'>
|
||||||
|
{language.toUpperCase()}
|
||||||
|
</p>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import setLanguage from 'next-translate/setLanguage'
|
import setLanguage from 'next-translate/setLanguage'
|
||||||
|
import classNames from 'classnames'
|
||||||
|
|
||||||
import { Arrow } from './Arrow'
|
import { Arrow } from './Arrow'
|
||||||
import { LanguageFlag } from './LanguageFlag'
|
import { LanguageFlag } from './LanguageFlag'
|
||||||
@ -33,12 +34,22 @@ export const Language: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-center items-center cursor-pointer'>
|
<div className='flex flex-col justify-center items-center cursor-pointer'>
|
||||||
<div className='flex items-center mr-5' onClick={handleHiddenMenu}>
|
<div
|
||||||
|
data-cy='language-click'
|
||||||
|
className='flex items-center mr-5'
|
||||||
|
onClick={handleHiddenMenu}
|
||||||
|
>
|
||||||
<LanguageFlag language={currentLanguage} />
|
<LanguageFlag language={currentLanguage} />
|
||||||
<Arrow />
|
<Arrow />
|
||||||
</div>
|
</div>
|
||||||
{!hiddenMenu && (
|
|
||||||
<ul className='flex flex-col justify-center items-center absolute p-0 top-14 z-10 w-24 mt-3 mr-4 rounded-lg list-none shadow-light dark:shadow-dark bg-white dark:bg-black'>
|
<ul
|
||||||
|
data-cy='languages-list'
|
||||||
|
className={classNames(
|
||||||
|
'flex flex-col justify-center items-center absolute p-0 top-14 z-10 w-24 mt-3 mr-4 rounded-lg list-none shadow-light dark:shadow-dark bg-white dark:bg-black',
|
||||||
|
{ hidden: hiddenMenu }
|
||||||
|
)}
|
||||||
|
>
|
||||||
{i18n.locales.map((language, index) => {
|
{i18n.locales.map((language, index) => {
|
||||||
if (language === currentLanguage) {
|
if (language === currentLanguage) {
|
||||||
return null
|
return null
|
||||||
@ -54,7 +65,6 @@ export const Language: React.FC = () => {
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -13,26 +13,42 @@ export const SwitchTheme: React.FC = () => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleClick = (): void => {
|
||||||
|
setTheme(theme === 'dark' ? 'light' : 'dark')
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className='toggle-button'
|
className='flex items-center'
|
||||||
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
|
data-cy='switch-theme-click'
|
||||||
|
onClick={handleClick}
|
||||||
>
|
>
|
||||||
<div className='toggle-theme-button'>
|
<div className='toggle-theme-button relative cursor-pointer bg-transparent inline-block'>
|
||||||
<div className='toggle-track'>
|
<div className='toggle-track'>
|
||||||
<div className='toggle-track-check'>
|
<div
|
||||||
<span className='toggle_Dark'>🌜</span>
|
data-cy='switch-theme-dark'
|
||||||
|
className='toggle-track-check absolute'
|
||||||
|
>
|
||||||
|
<span className='toggle_Dark flex justify-center items-center relative'>
|
||||||
|
🌜
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='toggle-track-x'>
|
<div
|
||||||
<span className='toggle_Light'>🌞</span>
|
data-cy='switch-theme-light'
|
||||||
|
className='toggle-track-x absolute'
|
||||||
|
>
|
||||||
|
<span className='toggle_Light flex justify-center items-center relative'>
|
||||||
|
🌞
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='toggle-thumb' />
|
<div className='toggle-thumb absolute' />
|
||||||
<input
|
<input
|
||||||
|
data-cy='switch-theme-input'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
aria-label='Dark mode toggle'
|
aria-label='Dark mode toggle'
|
||||||
className='toggle-screenreader-only'
|
className='toggle-screenreader-only absolute overflow-hidden'
|
||||||
defaultChecked
|
defaultChecked
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -40,16 +56,8 @@ export const SwitchTheme: React.FC = () => {
|
|||||||
|
|
||||||
<style jsx>
|
<style jsx>
|
||||||
{`
|
{`
|
||||||
.toggle-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.toggle-theme-button {
|
.toggle-theme-button {
|
||||||
touch-action: pan-x;
|
touch-action: pan-x;
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@ -64,7 +72,6 @@ export const SwitchTheme: React.FC = () => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.toggle-track-check {
|
.toggle-track-check {
|
||||||
position: absolute;
|
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -77,7 +84,6 @@ export const SwitchTheme: React.FC = () => {
|
|||||||
transition: opacity 0.25s ease;
|
transition: opacity 0.25s ease;
|
||||||
}
|
}
|
||||||
.toggle-track-x {
|
.toggle-track-x {
|
||||||
position: absolute;
|
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -90,15 +96,10 @@ export const SwitchTheme: React.FC = () => {
|
|||||||
}
|
}
|
||||||
.toggle_Dark,
|
.toggle_Dark,
|
||||||
.toggle_Light {
|
.toggle_Light {
|
||||||
align-items: center;
|
|
||||||
display: flex;
|
|
||||||
height: 10px;
|
height: 10px;
|
||||||
justify-content: center;
|
|
||||||
position: relative;
|
|
||||||
width: 10px;
|
width: 10px;
|
||||||
}
|
}
|
||||||
.toggle-thumb {
|
.toggle-thumb {
|
||||||
position: absolute;
|
|
||||||
left: ${theme === 'dark' ? '27px' : '0px'};
|
left: ${theme === 'dark' ? '27px' : '0px'};
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
@ -115,9 +116,7 @@ export const SwitchTheme: React.FC = () => {
|
|||||||
clip: rect(0 0 0 0);
|
clip: rect(0 0 0 0);
|
||||||
height: 1px;
|
height: 1px;
|
||||||
margin: -1px;
|
margin: -1px;
|
||||||
overflow: hidden;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
position: absolute;
|
|
||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
`}
|
`}
|
||||||
|
@ -11,7 +11,7 @@ export const InterestParagraph: React.FC<InterestParagraphProps> = (props) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p className='text-center my-6 text-gray dark:text-gray-dark'>
|
<p className='text-center my-6 text-gray dark:text-gray-dark'>
|
||||||
<strong className='text-yellow font-medium text-lg dark:text-yellow-dark'>
|
<strong className='text-yellow font-semibold text-lg dark:text-yellow-dark'>
|
||||||
{title}
|
{title}
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
|
|
||||||
export const ProfileInfo: React.FC = () => {
|
export const ProfileInformation: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<div className='pb-2 mb-6 border-b-2 font-headline border-gray-600 dark:border-gray-400'>
|
<div className='pb-2 mb-6 border-b-2 font-headline border-gray-600 dark:border-gray-400'>
|
||||||
<h1 className='text-4xl mb-2'>
|
<h1 className='text-4xl mb-2'>
|
||||||
{t('home:about.IAm')}{' '}
|
{t('home:about.IAm')}{' '}
|
||||||
@ -14,31 +13,5 @@ export const ProfileInfo: React.FC = () => {
|
|||||||
</h1>
|
</h1>
|
||||||
<h2 className='text-base mb-3'>{t('home:about.description')}</h2>
|
<h2 className='text-base mb-3'>{t('home:about.description')}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style jsx>
|
|
||||||
{`
|
|
||||||
.profile-info {
|
|
||||||
padding-bottom: 25px;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
border-bottom: 1px solid #dedede;
|
|
||||||
}
|
|
||||||
.profile-title {
|
|
||||||
font-size: 36px;
|
|
||||||
line-height: 1.1;
|
|
||||||
font-weight: 300;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.profile-title > strong {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.profile-description {
|
|
||||||
font-size: 17.4px;
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 1.1;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
</style>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
|
|
||||||
|
import DivloLogo from 'public/images/divlo_logo.png'
|
||||||
|
|
||||||
export const ProfileLogo: React.FC = () => {
|
export const ProfileLogo: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className='px-2 py-6'>
|
<div className='px-2 py-6 max-w-[370px] max-h-[370px]'>
|
||||||
<Image
|
<Image src={DivloLogo} alt='Divlo' priority />
|
||||||
width={370}
|
|
||||||
height={370}
|
|
||||||
src='/images/divlo_logo.png'
|
|
||||||
alt='Divlo'
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { ProfileDescriptionBottom } from './ProfileDescriptionBottom'
|
import { ProfileDescriptionBottom } from './ProfileDescriptionBottom'
|
||||||
import { ProfileInfo } from './ProfileInfo'
|
import { ProfileInformation } from './ProfileInfo'
|
||||||
import { ProfileList } from './ProfileList'
|
import { ProfileList } from './ProfileList'
|
||||||
import { ProfileLogo } from './ProfileLogo'
|
import { ProfileLogo } from './ProfileLogo'
|
||||||
|
|
||||||
export const Profile: React.FC = () => {
|
export const Profile: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-center items-center px-10 pt-2 md:pt-10 xl:pt-0 md:flex-row'>
|
<div className='flex flex-col justify-center items-center px-10 pt-2 md:pt-10 md:flex-row'>
|
||||||
<ProfileLogo />
|
<ProfileLogo />
|
||||||
<div>
|
<div>
|
||||||
<ProfileInfo />
|
<ProfileInformation />
|
||||||
<ProfileList />
|
<ProfileList />
|
||||||
<ProfileDescriptionBottom />
|
<ProfileDescriptionBottom />
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,7 +31,6 @@ export const Skills: React.FC = () => {
|
|||||||
|
|
||||||
<SkillsSection title={t('home:skills.softwareTools')}>
|
<SkillsSection title={t('home:skills.softwareTools')}>
|
||||||
<SkillComponent skill='Ubuntu' />
|
<SkillComponent skill='Ubuntu' />
|
||||||
<SkillComponent skill='Hyper' />
|
|
||||||
<SkillComponent skill='Visual Studio Code' />
|
<SkillComponent skill='Visual Studio Code' />
|
||||||
<SkillComponent skill='Git' />
|
<SkillComponent skill='Git' />
|
||||||
<SkillComponent skill='Docker' />
|
<SkillComponent skill='Docker' />
|
||||||
|
@ -3,7 +3,7 @@ import { render } from '@testing-library/react'
|
|||||||
import { Footer } from '../Footer'
|
import { Footer } from '../Footer'
|
||||||
|
|
||||||
describe('<Footer />', () => {
|
describe('<Footer />', () => {
|
||||||
it('should render the version link pointing to the GitHub release', async () => {
|
it('should render with appropriate link tag version', async () => {
|
||||||
const version = '1.0.0'
|
const version = '1.0.0'
|
||||||
const { getByText } = render(<Footer version={version} />)
|
const { getByText } = render(<Footer version={version} />)
|
||||||
const versionLink = getByText(version) as HTMLAnchorElement
|
const versionLink = getByText(version) as HTMLAnchorElement
|
||||||
@ -13,15 +13,4 @@ describe('<Footer />', () => {
|
|||||||
`https://github.com/Divlo/Divlo/releases/tag/v${version}`
|
`https://github.com/Divlo/Divlo/releases/tag/v${version}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should render the version link pointing to the `develop` branch', async () => {
|
|
||||||
const version = '0.0.0-development'
|
|
||||||
const { getByText } = render(<Footer version={version} />)
|
|
||||||
const versionLink = getByText(version) as HTMLAnchorElement
|
|
||||||
expect(getByText('Divlo')).toBeInTheDocument()
|
|
||||||
expect(versionLink).toBeInTheDocument()
|
|
||||||
expect(versionLink.href).toEqual(
|
|
||||||
'https://github.com/Divlo/Divlo/tree/develop'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
8
cypress.json
Normal file
8
cypress.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"baseUrl": "http://localhost:3000",
|
||||||
|
"pluginsFile": false,
|
||||||
|
"supportFile": false,
|
||||||
|
"fixturesFolder": false,
|
||||||
|
"video": false,
|
||||||
|
"screenshotOnRunFailure": false
|
||||||
|
}
|
47
cypress/integration/common/Header.spec.ts
Normal file
47
cypress/integration/common/Header.spec.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
describe('Common > Header', () => {
|
||||||
|
beforeEach(() => cy.visit('/'))
|
||||||
|
|
||||||
|
describe('Switch theme color (dark/light)', () => {
|
||||||
|
it('should switch theme from `dark` (default) to `light`', () => {
|
||||||
|
cy.get('[data-cy=switch-theme-dark]').should('be.visible')
|
||||||
|
cy.get('[data-cy=switch-theme-light]').should('not.be.visible')
|
||||||
|
cy.get('body').should(
|
||||||
|
'not.have.css',
|
||||||
|
'background-color',
|
||||||
|
'rgb(255, 255, 255)'
|
||||||
|
)
|
||||||
|
|
||||||
|
cy.get('[data-cy=switch-theme-click]').click()
|
||||||
|
|
||||||
|
cy.get('[data-cy=switch-theme-dark]').should('not.be.visible')
|
||||||
|
cy.get('[data-cy=switch-theme-light]').should('be.visible')
|
||||||
|
cy.get('body').should(
|
||||||
|
'have.css',
|
||||||
|
'background-color',
|
||||||
|
'rgb(255, 255, 255)'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('Switch Language', () => {
|
||||||
|
it('should switch language from EN (default) to FR', () => {
|
||||||
|
cy.get('h1').contains('I am Divlo')
|
||||||
|
cy.get('[data-cy=language-flag-text]').contains('EN')
|
||||||
|
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||||
|
cy.get('[data-cy=language-click]').click()
|
||||||
|
cy.get('[data-cy=languages-list]').should('be.visible')
|
||||||
|
cy.get('[data-cy=languages-list] > li:first-child').contains('FR').click()
|
||||||
|
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||||
|
cy.get('[data-cy=language-flag-text]').contains('FR')
|
||||||
|
cy.get('h1').contains('Je suis Divlo')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should close the language list menu when clicking outside', () => {
|
||||||
|
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||||
|
cy.get('[data-cy=language-click]').click()
|
||||||
|
cy.get('[data-cy=languages-list]').should('be.visible')
|
||||||
|
cy.get('h1').click()
|
||||||
|
cy.get('[data-cy=languages-list]').should('not.be.visible')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
7
cypress/integration/pages/404.spec.ts
Normal file
7
cypress/integration/pages/404.spec.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
describe('Page /404', () => {
|
||||||
|
beforeEach(() => cy.visit('/404', { failOnStatusCode: false }))
|
||||||
|
|
||||||
|
it('should display the statusCode of 404', () => {
|
||||||
|
cy.get('[data-cy=status-code]').contains('404')
|
||||||
|
})
|
||||||
|
})
|
7
cypress/integration/pages/500.spec.ts
Normal file
7
cypress/integration/pages/500.spec.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
describe('Page /500', () => {
|
||||||
|
beforeEach(() => cy.visit('/500', { failOnStatusCode: false }))
|
||||||
|
|
||||||
|
it('should display the statusCode of 500', () => {
|
||||||
|
cy.get('[data-cy=status-code]').contains('500')
|
||||||
|
})
|
||||||
|
})
|
19
cypress/integration/pages/index.spec.ts
Normal file
19
cypress/integration/pages/index.spec.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
describe('Page /', () => {
|
||||||
|
beforeEach(() => cy.visit('/'))
|
||||||
|
|
||||||
|
it('should reveals the sections while scrolling except the about section', () => {
|
||||||
|
const sectionsReveals = [
|
||||||
|
'#interests',
|
||||||
|
'#skills',
|
||||||
|
'#portfolio',
|
||||||
|
'#open-source'
|
||||||
|
]
|
||||||
|
cy.get('#about').should('be.visible')
|
||||||
|
for (const section of sectionsReveals) {
|
||||||
|
cy.get(section)
|
||||||
|
.should('not.be.visible')
|
||||||
|
.scrollIntoView()
|
||||||
|
.should('be.visible')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
9
cypress/tsconfig.json
Normal file
9
cypress/tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"types": ["cypress"],
|
||||||
|
"isolatedModules": false
|
||||||
|
},
|
||||||
|
"include": ["../node_modules/cypress", "./**/*.ts"]
|
||||||
|
}
|
@ -1,16 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
roots: ['<rootDir>'],
|
|
||||||
transform: {
|
|
||||||
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest'
|
|
||||||
},
|
|
||||||
moduleDirectories: ['node_modules', './'],
|
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
||||||
testEnvironment: 'jsdom',
|
|
||||||
setupFilesAfterEnv: [
|
|
||||||
'@testing-library/jest-dom/extend-expect',
|
|
||||||
'@testing-library/react'
|
|
||||||
],
|
|
||||||
collectCoverage: true,
|
|
||||||
coverageDirectory: './coverage',
|
|
||||||
coverageReporters: ['text', 'cobertura']
|
|
||||||
}
|
|
14
jest.config.json
Normal file
14
jest.config.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"roots": ["<rootDir>"],
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest"
|
||||||
|
},
|
||||||
|
"moduleDirectories": ["node_modules", "./"],
|
||||||
|
"modulePathIgnorePatterns": ["<rootDir>/cypress"],
|
||||||
|
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
|
||||||
|
"testEnvironment": "jsdom",
|
||||||
|
"setupFilesAfterEnv": [
|
||||||
|
"@testing-library/jest-dom/extend-expect",
|
||||||
|
"@testing-library/react"
|
||||||
|
]
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
"description": "Developer Full Stack Junior • Passionate about High-Tech",
|
"description": "Developer Full Stack Junior • Passionate about High-Tech",
|
||||||
"birthDate": "Birth date",
|
"birthDate": "Birth date",
|
||||||
"nationality": "Nationality",
|
"nationality": "Nationality",
|
||||||
"descriptionBottom": "I am self-taught in Computer Science by following online trainings. <0/> <0/> I put into practice everything I learn and make many projects."
|
"descriptionBottom": "I am self-taught in Computer Science by following online trainings and I am also a student at the university following the French training \"BUT Informatique\" (first year). <0/> <0/> I put into practice everything I learn and make many projects."
|
||||||
},
|
},
|
||||||
"interests": {
|
"interests": {
|
||||||
"title": "Interests",
|
"title": "Interests",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"description": "Développeur Full Stack Junior • Passionné de High-Tech",
|
"description": "Développeur Full Stack Junior • Passionné de High-Tech",
|
||||||
"birthDate": "Date de naissance",
|
"birthDate": "Date de naissance",
|
||||||
"nationality": "Nationalité",
|
"nationality": "Nationalité",
|
||||||
"descriptionBottom": "Je me forme en autodidacte dans l'informatique en suivant des formations en ligne. <0/> <0/> Je mets en pratique tout ce que j'apprends et réalise de nombreux projets."
|
"descriptionBottom": "Je me forme en autodidacte dans l'informatique en suivant des formations en ligne et je suis aussi un étudiant à l'université suivant la formation \"BUT Informatique\" (première année). <0/> <0/> Je mets en pratique tout ce que j'apprends et réalise de nombreux projets."
|
||||||
},
|
},
|
||||||
"interests": {
|
"interests": {
|
||||||
"title": "Intérêts",
|
"title": "Intérêts",
|
||||||
|
3
next-env.d.ts
vendored
3
next-env.d.ts
vendored
@ -1,3 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/types/global" />
|
/// <reference types="next/types/global" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
|
||||||
|
// NOTE: This file should not be edited
|
||||||
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||||
|
@ -1,11 +1,35 @@
|
|||||||
const nextPWA = require('next-pwa')
|
const nextPWA = require('next-pwa')
|
||||||
const nextTranslate = require('next-translate')
|
const nextTranslate = require('next-translate')
|
||||||
|
const { createSecureHeaders } = require('next-secure-headers')
|
||||||
|
|
||||||
|
/** @type {import("next").NextConfig} */
|
||||||
module.exports = nextTranslate(
|
module.exports = nextTranslate(
|
||||||
nextPWA({
|
nextPWA({
|
||||||
pwa: {
|
pwa: {
|
||||||
disable: process.env.NODE_ENV !== 'production',
|
disable: process.env.NODE_ENV !== 'production',
|
||||||
dest: 'public'
|
dest: 'public'
|
||||||
|
},
|
||||||
|
async headers() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: '/:path*',
|
||||||
|
headers: createSecureHeaders({
|
||||||
|
contentSecurityPolicy: {
|
||||||
|
directives: {
|
||||||
|
defaultSrc: ["'self'"],
|
||||||
|
scriptSrc: ["'self'", "'unsafe-eval'", "'unsafe-inline'"],
|
||||||
|
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||||
|
imgSrc: ['*', 'data:', 'blob:'],
|
||||||
|
mediaSrc: "'none'",
|
||||||
|
connectSrc: '*',
|
||||||
|
objectSrc: "'none'",
|
||||||
|
fontSrc: "'self'",
|
||||||
|
baseURI: "'none'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
14702
package-lock.json
generated
14702
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
72
package.json
72
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "divlo",
|
"name": "divlo",
|
||||||
"version": "0.0.0-development",
|
"version": "1.3.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -21,61 +21,69 @@
|
|||||||
"lint:markdown": "markdownlint '**/*.md' --dot --ignore node_modules",
|
"lint:markdown": "markdownlint '**/*.md' --dot --ignore node_modules",
|
||||||
"lint:typescript": "eslint '**/*.{js,ts,jsx,tsx}'",
|
"lint:typescript": "eslint '**/*.{js,ts,jsx,tsx}'",
|
||||||
"lint:staged": "lint-staged",
|
"lint:staged": "lint-staged",
|
||||||
"lighthouse": "lhci autorun",
|
"test:unit": "jest",
|
||||||
"test": "jest",
|
"test:lighthouse": "lhci autorun",
|
||||||
|
"test:e2e": "start-server-and-test 'start' 'http://localhost:3000' 'cypress run'",
|
||||||
|
"test:e2e:dev": "start-server-and-test 'dev' 'http://localhost:3000' 'cypress open'",
|
||||||
"release": "semantic-release",
|
"release": "semantic-release",
|
||||||
"deploy": "vercel",
|
"deploy": "vercel",
|
||||||
"postinstall": "husky install"
|
"postinstall": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/montserrat": "4.5.0",
|
"@fontsource/montserrat": "4.5.1",
|
||||||
"@fortawesome/fontawesome-svg-core": "1.2.35",
|
"@fortawesome/fontawesome-svg-core": "1.2.36",
|
||||||
"@fortawesome/free-brands-svg-icons": "5.15.3",
|
"@fortawesome/free-brands-svg-icons": "5.15.4",
|
||||||
"@fortawesome/free-solid-svg-icons": "5.15.3",
|
"@fortawesome/free-solid-svg-icons": "5.15.4",
|
||||||
"@fortawesome/react-fontawesome": "0.1.14",
|
"@fortawesome/react-fontawesome": "0.1.15",
|
||||||
"classnames": "2.3.1",
|
"classnames": "2.3.1",
|
||||||
"html-react-parser": "1.2.7",
|
"html-react-parser": "1.3.0",
|
||||||
"next": "11.0.1",
|
"next": "11.1.2",
|
||||||
"next-pwa": "5.2.24",
|
"next-pwa": "5.3.1",
|
||||||
"next-themes": "0.0.15",
|
"next-themes": "0.0.15",
|
||||||
"next-translate": "1.0.7",
|
"next-translate": "1.0.7",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
"read-pkg": "5.2.0",
|
"read-pkg": "7.0.0",
|
||||||
|
"sharp": "0.29.1",
|
||||||
"universal-cookie": "4.0.4"
|
"universal-cookie": "4.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "13.1.0",
|
"@commitlint/cli": "13.1.0",
|
||||||
"@commitlint/config-conventional": "13.1.0",
|
"@commitlint/config-conventional": "13.1.0",
|
||||||
"@lhci/cli": "0.8.0",
|
"@lhci/cli": "0.8.1",
|
||||||
|
"@saithodev/semantic-release-backmerge": "1.5.3",
|
||||||
|
"@semantic-release/git": "9.0.1",
|
||||||
"@testing-library/jest-dom": "5.14.1",
|
"@testing-library/jest-dom": "5.14.1",
|
||||||
"@testing-library/react": "12.0.0",
|
"@testing-library/react": "12.0.0",
|
||||||
"@types/jest": "26.0.24",
|
"@types/jest": "27.0.1",
|
||||||
"@types/node": "16.4.3",
|
"@types/node": "16.9.0",
|
||||||
"@types/react": "17.0.15",
|
"@types/react": "17.0.20",
|
||||||
"@types/styled-jsx": "2.2.9",
|
"@typescript-eslint/eslint-plugin": "4.31.0",
|
||||||
"@typescript-eslint/eslint-plugin": "4.28.5",
|
"autoprefixer": "10.3.4",
|
||||||
"autoprefixer": "10.3.1",
|
"babel-jest": "27.1.1",
|
||||||
"babel-jest": "27.0.6",
|
"cypress": "8.3.1",
|
||||||
"dockerfilelint": "1.8.0",
|
"dockerfilelint": "1.8.0",
|
||||||
"editorconfig-checker": "4.0.2",
|
"editorconfig-checker": "4.0.2",
|
||||||
"eslint": "7.31.0",
|
"eslint": "7.32.0",
|
||||||
"eslint-config-next": "11.0.1",
|
"eslint-config-next": "11.1.2",
|
||||||
"eslint-config-prettier": "8.3.0",
|
"eslint-config-prettier": "8.3.0",
|
||||||
"eslint-config-standard-with-typescript": "20.0.0",
|
"eslint-config-standard-with-typescript": "21.0.1",
|
||||||
"eslint-plugin-import": "2.23.4",
|
"eslint-plugin-import": "2.24.2",
|
||||||
"eslint-plugin-node": "11.1.0",
|
"eslint-plugin-node": "11.1.0",
|
||||||
"eslint-plugin-prettier": "3.4.0",
|
"eslint-plugin-prettier": "4.0.0",
|
||||||
"eslint-plugin-promise": "5.1.0",
|
"eslint-plugin-promise": "5.1.0",
|
||||||
"husky": "7.0.1",
|
"eslint-plugin-unicorn": "35.0.0",
|
||||||
"jest": "27.0.6",
|
"husky": "7.0.2",
|
||||||
"lint-staged": "11.1.1",
|
"jest": "27.1.1",
|
||||||
|
"lint-staged": "11.1.2",
|
||||||
"markdownlint-cli": "0.28.1",
|
"markdownlint-cli": "0.28.1",
|
||||||
|
"next-secure-headers": "2.2.0",
|
||||||
"postcss": "8.3.6",
|
"postcss": "8.3.6",
|
||||||
"prettier": "2.3.2",
|
"prettier": "2.3.2",
|
||||||
"semantic-release": "17.4.4",
|
"semantic-release": "17.4.7",
|
||||||
"tailwindcss": "2.2.7",
|
"start-server-and-test": "1.14.0",
|
||||||
"typescript": "4.3.5",
|
"tailwindcss": "2.2.14",
|
||||||
"vercel": "23.0.1"
|
"typescript": "4.4.2",
|
||||||
|
"vercel": "23.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { GetStaticProps } from 'next'
|
import { GetStaticProps } from 'next'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import readPackageJSON from 'read-pkg'
|
|
||||||
|
|
||||||
import { ErrorPage } from 'components/ErrorPage'
|
import { ErrorPage } from 'components/ErrorPage'
|
||||||
import { Head } from 'components/Head'
|
import { Head } from 'components/Head'
|
||||||
@ -25,7 +24,8 @@ const Error404: React.FC<FooterProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
||||||
const { version } = await readPackageJSON()
|
const { readPackage } = await import('read-pkg')
|
||||||
|
const { version } = await readPackage()
|
||||||
return { props: { version } }
|
return { props: { version } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { GetStaticProps } from 'next'
|
import { GetStaticProps } from 'next'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import readPackageJSON from 'read-pkg'
|
|
||||||
|
|
||||||
import { ErrorPage } from 'components/ErrorPage'
|
import { ErrorPage } from 'components/ErrorPage'
|
||||||
import { Head } from 'components/Head'
|
import { Head } from 'components/Head'
|
||||||
@ -25,7 +24,8 @@ const Error500: React.FC<FooterProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
||||||
const { version } = await readPackageJSON()
|
const { readPackage } = await import('read-pkg')
|
||||||
|
const { version } = await readPackage()
|
||||||
return { props: { version } }
|
return { props: { version } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,16 +6,14 @@ import UniversalCookie from 'universal-cookie'
|
|||||||
|
|
||||||
import 'tailwindcss/tailwind.css'
|
import 'tailwindcss/tailwind.css'
|
||||||
import '@fontsource/montserrat/400.css'
|
import '@fontsource/montserrat/400.css'
|
||||||
import '@fontsource/montserrat/500.css'
|
|
||||||
import '@fontsource/montserrat/600.css'
|
import '@fontsource/montserrat/600.css'
|
||||||
import '@fontsource/montserrat/700.css'
|
|
||||||
|
|
||||||
const universalCookie = new UniversalCookie()
|
const universalCookie = new UniversalCookie()
|
||||||
|
|
||||||
/** how long in seconds, until the cookie expires (10 years) */
|
/** how long in seconds, until the cookie expires (10 years) */
|
||||||
const COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60
|
const COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60
|
||||||
|
|
||||||
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
|
const Application = ({ Component, pageProps }: AppProps): JSX.Element => {
|
||||||
const { lang } = useTranslation()
|
const { lang } = useTranslation()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -32,4 +30,4 @@ const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MyApp
|
export default Application
|
||||||
|
@ -1,21 +1,6 @@
|
|||||||
import Document, {
|
import { Html, Head, Main, NextScript } from 'next/document'
|
||||||
Html,
|
|
||||||
Head,
|
|
||||||
Main,
|
|
||||||
NextScript,
|
|
||||||
DocumentContext,
|
|
||||||
DocumentInitialProps
|
|
||||||
} from 'next/document'
|
|
||||||
|
|
||||||
class MyDocument extends Document {
|
const Document: React.FC = () => {
|
||||||
static async getInitialProps(
|
|
||||||
ctx: DocumentContext
|
|
||||||
): Promise<DocumentInitialProps> {
|
|
||||||
const initialProps = await Document.getInitialProps(ctx)
|
|
||||||
return initialProps
|
|
||||||
}
|
|
||||||
|
|
||||||
render(): JSX.Element {
|
|
||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head />
|
<Head />
|
||||||
@ -26,6 +11,5 @@ class MyDocument extends Document {
|
|||||||
</Html>
|
</Html>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export default MyDocument
|
export default Document
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { GetStaticProps } from 'next'
|
import { GetStaticProps } from 'next'
|
||||||
import useTranslation from 'next-translate/useTranslation'
|
import useTranslation from 'next-translate/useTranslation'
|
||||||
import readPackageJSON from 'read-pkg'
|
|
||||||
|
|
||||||
import { RevealFade } from 'components/design/RevealFade'
|
import { RevealFade } from 'components/design/RevealFade'
|
||||||
import { Section } from 'components/design/Section'
|
import { Section } from 'components/design/Section'
|
||||||
@ -71,7 +70,8 @@ const Home: React.FC<FooterProps> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
|
||||||
const { version } = await readPackageJSON()
|
const { readPackage } = await import('read-pkg')
|
||||||
|
const { version } = await readPackage()
|
||||||
return { props: { version } }
|
return { props: { version } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 92 KiB |
@ -10,6 +10,7 @@
|
|||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"types": ["jest", "@testing-library/jest-dom", "@testing-library/react"],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"github": {
|
"github": {
|
||||||
"enabled": false,
|
"enabled": false
|
||||||
"silent": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user