Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
fix(stats): statistic page (#117) (#118)
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
mehdilouraoui authored Dec 1, 2022
1 parent 700b33a commit 783e53d
Show file tree
Hide file tree
Showing 6 changed files with 1,135 additions and 892 deletions.
45 changes: 45 additions & 0 deletions .eslintrc.json
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"
}
]
}
}
3 changes: 1 addition & 2 deletions components/statistic/Statistic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export const Statistic = () => (
width="100%"
height="100%"
frameBorder="0"
// TODO: env ou prismic
src="https://posthog3.lafabriquenumerique.cloud-ed.fr/shared_dashboard/L4M71TMmeZm1ebmfePa5TPj_v92hYA?embedded"
src="https://mails.posthog.archifiltre.fr/shared_dashboard/yWQ2FcRFSrL1RmRbMStmwLl6R2KVrA?embedded"
/>
</Page>
);
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"exclude": [
"node_modules"
]
}
}
3 changes: 1 addition & 2 deletions utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const HAS_WINDOW = typeof window !== 'undefined';
export const events = ['scroll', 'wheel', 'touchmove', 'pointermove'];

/**
*
*
Short of querySelector method.
*/
Expand Down Expand Up @@ -84,8 +85,6 @@ export const getDownloadLink = (
? 'docs'
: 'mails';

console.log(version);

const baseUrlMail = `https://github.com/SocialGouv/archifiltre-${name}/releases/download/v${version}/archifiltre-${name}`;
const baseUrlDocs =
'https://github.com/SocialGouv/archifiltre-docs/releases/download/v4.0.0-beta.3/archifiltre-docs';
Expand Down
44 changes: 44 additions & 0 deletions utils/prismicHelpers.js
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;
Loading

0 comments on commit 783e53d

Please sign in to comment.