1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-12-08 00:44:30 +01:00

build(deps): bump next to 11.0.0

This commit is contained in:
divlo 2021-06-15 20:35:52 +02:00
parent 61ef6c5525
commit 892bf0e87a
8 changed files with 776 additions and 756 deletions

View File

@ -1,6 +1,11 @@
{ {
"extends": ["standard-with-typescript", "eslint-config-prettier"], "extends": [
"plugins": ["eslint-plugin-prettier"], "standard-with-typescript",
"next",
"next/core-web-vitals",
"prettier"
],
"plugins": ["prettier"],
"parserOptions": { "parserOptions": {
"project": "./tsconfig.json" "project": "./tsconfig.json"
}, },

View File

@ -75,6 +75,8 @@ jobs:
- name: 'Lighthouse' - name: 'Lighthouse'
run: 'npm run lighthouse' run: 'npm run lighthouse'
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
test: test:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'

View File

@ -10,16 +10,9 @@
"assert": { "assert": {
"preset": "lighthouse:recommended", "preset": "lighthouse:recommended",
"assertions": { "assertions": {
"legacy-javascript": "off", "csp-xss": "warning",
"unused-javascript": "off", "non-composited-animations": "warning",
"uses-rel-preload": "off", "uses-responsive-images": "warning"
"csp-xss": "off",
"canonical": "off",
"unsized-images": "off",
"uses-responsive-images": "off",
"bypass": "warning",
"color-contrast": "warning",
"preload-lcp-image": "warning"
} }
}, },
"upload": { "upload": {

View File

@ -1,15 +1,19 @@
import { 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 { Arrow } from './Arrow' import { Arrow } from './Arrow'
import { LanguageFlag } from './LanguageFlag' import { LanguageFlag } from './LanguageFlag'
import { locales } from 'i18n.json' import i18n from 'i18n.json'
export const Language: React.FC = () => { export const Language: React.FC = () => {
const { lang: currentLanguage } = useTranslation() const { lang: currentLanguage } = useTranslation()
const [hiddenMenu, setHiddenMenu] = useState(true) const [hiddenMenu, setHiddenMenu] = useState(true)
const handleHiddenMenu = useCallback(() => {
setHiddenMenu(!hiddenMenu)
}, [hiddenMenu])
useEffect(() => { useEffect(() => {
if (!hiddenMenu) { if (!hiddenMenu) {
window.document.addEventListener('click', handleHiddenMenu) window.document.addEventListener('click', handleHiddenMenu)
@ -20,17 +24,13 @@ export const Language: React.FC = () => {
return () => { return () => {
window.document.removeEventListener('click', handleHiddenMenu) window.document.removeEventListener('click', handleHiddenMenu)
} }
}, [hiddenMenu]) }, [hiddenMenu, handleHiddenMenu])
const handleLanguage = async (language: string): Promise<void> => { const handleLanguage = async (language: string): Promise<void> => {
await setLanguage(language) await setLanguage(language)
handleHiddenMenu() handleHiddenMenu()
} }
const handleHiddenMenu = (): void => {
setHiddenMenu(!hiddenMenu)
}
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 className='flex items-center mr-5' onClick={handleHiddenMenu}>
@ -39,7 +39,7 @@ export const Language: React.FC = () => {
</div> </div>
{!hiddenMenu && ( {!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 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'>
{locales.map((language, index) => { {i18n.locales.map((language, index) => {
if (language === currentLanguage) { if (language === currentLanguage) {
return null return null
} }

View File

@ -1,20 +1,11 @@
import { forwardRef } from 'react'
type SectionHeadingProps = React.ComponentPropsWithRef<'h2'> type SectionHeadingProps = React.ComponentPropsWithRef<'h2'>
export const SectionHeading = forwardRef< export const SectionHeading: React.FC<SectionHeadingProps> = (props) => {
HTMLHeadingElement,
SectionHeadingProps
>((props, ref) => {
const { children, ...rest } = props const { children, ...rest } = props
return ( return (
<h2 <h2 {...rest} className='text-4xl font-semibold text-center mt-1 mb-7'>
ref={ref}
{...rest}
className='text-4xl font-semibold text-center mt-1 mb-7'
>
{children} {children}
</h2> </h2>
) )
}) }

View File

@ -1,5 +1,3 @@
import { forwardRef } from 'react'
import { ShadowContainer } from '../ShadowContainer' import { ShadowContainer } from '../ShadowContainer'
import { SectionHeading } from './SectionHeading' import { SectionHeading } from './SectionHeading'
@ -10,7 +8,7 @@ type SectionProps = React.ComponentPropsWithRef<'section'> & {
withoutShadowContainer?: boolean withoutShadowContainer?: boolean
} }
export const Section = forwardRef<HTMLElement, SectionProps>((props, ref) => { export const Section: React.FC<SectionProps> = (props) => {
const { const {
children, children,
heading, heading,
@ -24,7 +22,7 @@ export const Section = forwardRef<HTMLElement, SectionProps>((props, ref) => {
return ( return (
<div className='px-3 w-full'> <div className='px-3 w-full'>
<ShadowContainer style={{ marginTop: 50 }}> <ShadowContainer style={{ marginTop: 50 }}>
<section ref={ref} {...rest}> <section {...rest}>
{heading != null && <SectionHeading>{heading}</SectionHeading>} {heading != null && <SectionHeading>{heading}</SectionHeading>}
<div className='px-3 w-full'>{children}</div> <div className='px-3 w-full'>{children}</div>
</section> </section>
@ -35,7 +33,7 @@ export const Section = forwardRef<HTMLElement, SectionProps>((props, ref) => {
if (withoutShadowContainer) { if (withoutShadowContainer) {
return ( return (
<section ref={ref} {...rest}> <section {...rest}>
{heading != null && <SectionHeading>{heading}</SectionHeading>} {heading != null && <SectionHeading>{heading}</SectionHeading>}
<div className='px-3 w-full'>{children}</div> <div className='px-3 w-full'>{children}</div>
</section> </section>
@ -43,7 +41,7 @@ export const Section = forwardRef<HTMLElement, SectionProps>((props, ref) => {
} }
return ( return (
<section ref={ref} {...rest}> <section {...rest}>
{heading != null && ( {heading != null && (
<SectionHeading style={{ ...(description != null && { margin: 0 }) }}> <SectionHeading style={{ ...(description != null && { margin: 0 }) }}>
{heading} {heading}
@ -61,4 +59,4 @@ export const Section = forwardRef<HTMLElement, SectionProps>((props, ref) => {
</div> </div>
</section> </section>
) )
}) }

1444
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,8 +18,8 @@
"lint:commit": "commitlint", "lint:commit": "commitlint",
"lint:docker": "dockerfilelint './Dockerfile'", "lint:docker": "dockerfilelint './Dockerfile'",
"lint:editorconfig": "editorconfig-checker", "lint:editorconfig": "editorconfig-checker",
"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", "lighthouse": "lhci autorun",
"test": "jest", "test": "jest",
@ -34,7 +34,7 @@
"@fortawesome/react-fontawesome": "0.1.14", "@fortawesome/react-fontawesome": "0.1.14",
"classnames": "2.3.1", "classnames": "2.3.1",
"html-react-parser": "1.2.6", "html-react-parser": "1.2.6",
"next": "10.2.3", "next": "11.0.0",
"next-pwa": "5.2.21", "next-pwa": "5.2.21",
"next-themes": "0.0.14", "next-themes": "0.0.14",
"next-translate": "1.0.7", "next-translate": "1.0.7",
@ -58,6 +58,7 @@
"dockerfilelint": "1.8.0", "dockerfilelint": "1.8.0",
"editorconfig-checker": "4.0.2", "editorconfig-checker": "4.0.2",
"eslint": "7.28.0", "eslint": "7.28.0",
"eslint-config-next": "11.0.0",
"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": "20.0.0",
"eslint-plugin-import": "2.23.4", "eslint-plugin-import": "2.23.4",
@ -70,7 +71,7 @@
"markdownlint-cli": "0.27.1", "markdownlint-cli": "0.27.1",
"postcss": "8.3.4", "postcss": "8.3.4",
"prettier": "2.3.1", "prettier": "2.3.1",
"semantic-release": "17.4.3", "semantic-release": "17.4.4",
"tailwindcss": "2.1.4", "tailwindcss": "2.1.4",
"typescript": "4.3.2" "typescript": "4.3.2"
} }