diff --git a/README.md b/README.md index 296e4c6..8837171 100644 --- a/README.md +++ b/README.md @@ -25,20 +25,20 @@ #### [Front](https://github.com/Accords-Library/accords-library.com) (this repository) - Language: [TypeScript](https://www.typescriptlang.org/) -- Framework: [Next.js](https://nextjs.org/) (React) +- Framework: [Next.js 12](https://nextjs.org/) (React 18) - Queries: [GraphQL Code Generator](https://www.graphql-code-generator.com/) - Fetch the GraphQL schema from the GraphQL back-end endpoint - Read the operations and fragments stored as graphql files in the `src/graphql` folder - Automatically generates a typesafe ready to use SDK using [graphql-request](https://www.npmjs.com/package/graphql-request) as the GraphQL client - Markdown: [markdown-to-jsx](https://www.npmjs.com/package/markdown-to-jsx) - - Support for Arbitrary React Components and Component Props! + - Support for arbitrary React Components and Component Props! - Autogenerated multi-level table of content and anchor links for the different headers - Styling: [Tailwind CSS](https://tailwindcss.com/) - Support for [Material Icons](https://fonts.google.com/icons) - Support for creating any arbitrary theming mode by swapping CSS variables - Support for Container Queries (media queries at the element level) - The website has a three-column layout, which turns into one-column + 2 toggleable side-menus if the screen is too narrow. - - Show out the Design System Showcase [here](https://accords-library.com/dev/showcase/design-system) + - Check out our [Design System Showcase](https://accords-library.com/dev/showcase/design-system) - State Management: [React Context](https://reactjs.org/docs/context.html) - Persistent app state using LocalStorage and SessionStorage - Accessibility @@ -52,18 +52,28 @@ - Main and fallback languages can be ordered manually by the user - At the content level, the user can know which language is available - Furthermore, the user can temporary select another language then the one that was automatically selected -- SSG + ISR (Static Site Generation + Incremental Static Regeneration): +- SSG + ISR (Static Site Generation + Incremental Static Regeneration) - The website is built before running in production - Performances are great, and possibility to deploy the app on a CDN - On-Demand ISR to continuously update the website when new content is added or existing content is modified/deleted + - UI localizations are downloaded separetely into the `public/local-data` to avoid fetching the same static props for every page. - SEO - Good defaults for the metadata and OpenGraph properties - - Each page can provide the thumbnail, title, description to be used + - Each page can provide a custom thumbnail, title, description to be used - Automatic generation of the sitemap using [next-sitemap](https://www.npmjs.com/package/next-sitemap) - Data quality testing - Data from the CMS is subject to a battery of tests (about 20 warning types and 40 error types) at build time - Each warning/error comes with a front-end link to the incriminating element, as well as a link to the CMS to fix it - Check for completeness, conformity, and integrity +- Code quality and style + - React Strict Mode + - [Eslint](https://www.npmjs.com/package/eslint) with [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import), [typescript-eslint](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) + - [Prettier](https://www.npmjs.com/package/prettier) with [prettier-plugin-tailwindcss](https://www.npmjs.com/package/prettier-plugin-tailwindcss) + - [ts-unused-exports](https://www.npmjs.com/package/ts-unused-exports) to find unused exported functions/constants... + +- Other + - Custom book reader based on [Okuma-Reader](https://github.com/DrMint/Okuma-Reader) + - Custom lightbox using [react-zoom-pan-pinch](https://www.npmjs.com/package/react-zoom-pan-pinch) ## Installation diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index cdcf37f..6267d0b 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -149,7 +149,7 @@ export const AppLayout = ({
{isDefined(contentPanel) ? ( @@ -167,8 +167,8 @@ export const AppLayout = ({
{index > 0 && ( diff --git a/src/components/Inputs/Switch.tsx b/src/components/Inputs/Switch.tsx index 6942767..f7b1a7f 100644 --- a/src/components/Inputs/Switch.tsx +++ b/src/components/Inputs/Switch.tsx @@ -22,7 +22,7 @@ export const Switch = ({ value, onClick, className, disabled = false }: Props): className={cJoin( `relative grid h-6 w-12 content-center rounded-full border-mid outline outline-1 -outline-offset-1 outline-mid transition-colors`, - cIf(value, "border-none bg-mid shadow-inner-sm shadow-shade outline-transparent"), + cIf(value, "border-none bg-mid shadow-inner-sm outline-transparent shadow-shade"), cIf(disabled, "cursor-not-allowed opacity-50 grayscale", "cursor-pointer"), cIf(disabled, cIf(value, "bg-dark/40 outline-transparent", "outline-dark/60")), className @@ -36,7 +36,7 @@ export const Switch = ({ value, onClick, className, disabled = false }: Props): onPointerUp={() => setIsFocused(false)}>
{isDefined(src) && ( diff --git a/src/components/SmartList.tsx b/src/components/SmartList.tsx index b067acf..73956f6 100644 --- a/src/components/SmartList.tsx +++ b/src/components/SmartList.tsx @@ -1,4 +1,5 @@ import { Fragment, useCallback, useEffect, useMemo, useState } from "react"; +import { useHotkeys } from "react-hotkeys-hook"; import naturalCompare from "string-natural-compare"; import { Chip } from "./Chip"; import { PageSelector } from "./Inputs/PageSelector"; @@ -9,7 +10,6 @@ import { useScrollTopOnChange } from "hooks/useScrollTopOnChange"; import { Ids } from "types/ids"; import { useLocalData } from "contexts/LocalDataContext"; import { useContainerQueries } from "contexts/ContainerQueriesContext"; -import { useHotkeys } from "react-hotkeys-hook"; interface Group { name: string; diff --git a/src/components/ThumbnailHeader.tsx b/src/components/ThumbnailHeader.tsx index 1396254..6afc6eb 100644 --- a/src/components/ThumbnailHeader.tsx +++ b/src/components/ThumbnailHeader.tsx @@ -48,7 +48,7 @@ export const ThumbnailHeader = ({ return ( <>
-
+
{thumbnail ? ( .tippy-arrow { @apply bottom-0;