This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial commit from Create Next App * ✨ setup * 🚑 fix download page (#36) * Fix/typo header (#39) * ✨ add maj to header links * adjust header width * trigger deploy * trigger deploy * 🚀 deploy * 🔥 remove hello.ts init file * 📝 update readme * fix/download-page (#37) (#48) * 🚑 fix download links * Fix/change download links (#53) * 🚑 fix download links * Fix/fix download links (#55) * 🚑 fix download links * Fix/links from download page (#57) * 🚑 fix dl links * fix: statistic page
- Loading branch information
1 parent
700b33a
commit 783e53d
Showing
6 changed files
with
1,135 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"prettier" | ||
], | ||
"plugins": [ | ||
"prettier", | ||
"@typescript-eslint", | ||
"unused-imports" | ||
], | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"unused-imports/no-unused-imports": "error", | ||
"unused-imports/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"vars": "all", | ||
"varsIgnorePattern": "^_", | ||
"args": "after-used", | ||
"argsIgnorePattern": "^_" | ||
} | ||
], | ||
"import/order": [ | ||
"warn", | ||
{ | ||
"alphabetize": { | ||
"order": "asc" | ||
} | ||
} | ||
], | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"parser": "typescript", | ||
"arrowParens": "avoid" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ | |
"exclude": [ | ||
"node_modules" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// ~/utils/prismicHelpers.js | ||
import * as prismic from '@prismicio/client'; | ||
import Link from 'next/link'; | ||
import { | ||
apiEndpoint, | ||
accessToken, | ||
linkResolver, | ||
Router, | ||
} from '../prismicConfiguration'; | ||
|
||
// Helper function to convert Prismic Rich Text links to Next/Link components | ||
export const customLink = (type, element, content, children, index) => ( | ||
<Link key={index} href={linkResolver(element.data)}> | ||
<a>{content}</a> | ||
</Link> | ||
); | ||
|
||
// -- @prismicio/client initialisation | ||
// Initialises the Prismic Client that's used for querying the API and passes it any query options. | ||
export const Client = (req = null) => | ||
prismic.createClient( | ||
apiEndpoint, | ||
createClientOptions(req, accessToken, Router), | ||
); | ||
|
||
// Options to be passed to the Client | ||
const createClientOptions = ( | ||
req = null, | ||
prismicAccessToken = null, | ||
routes = null, | ||
) => { | ||
const reqOption = req ? { req } : {}; | ||
const accessTokenOption = prismicAccessToken | ||
? { accessToken: prismicAccessToken } | ||
: {}; | ||
const routesOption = routes ? { routes: Router.routes } : {}; | ||
return { | ||
...reqOption, | ||
...accessTokenOption, | ||
...routesOption, | ||
}; | ||
}; | ||
|
||
export default Client; |
Oops, something went wrong.