Skip to content

Commit

Permalink
chore: random nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
charles4221 committed Feb 4, 2024
1 parent 594f330 commit e7b0c7e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svg]": {
"editor.defaultFormatter": "jock.svg"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand All @@ -30,8 +33,5 @@
// Extension Settings
"eslint.enable": true,
"eslint.format.enable": false, // formatting is handled by prettier
"prettier.enable": true,
"[svg]": {
"editor.defaultFormatter": "jock.svg"
}
"prettier.enable": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Last but definitely not least, we have Zustand for client-side state management.

Since I've done all the manual configuration stuff a million times before, this time around I decided I don't need to prove anything to anyone, so why not just use a starter template to take care of all that initial stuff that nobody wants to do? Especially now that I'm a father of two boys, I have a lot less free time and thus I need less reasons to procrastinate on actually building the damn site.

Thankfully since the last time I used Prismic to build a new site from scratch, they've introduced some great templates to get you started with various framework integrations. I used the [Prismic Next.js Multi-Page Website Starter][starter-docs] as a base, and then added all my own customisations on top of that. It's a great starter, and I highly recommend it for anyone wanting to build a Next.js site with Prismic.
Thankfully since the last time I used Prismic to build a new site from scratch, they've introduced some great templates to get you started with various framework integrations. I used the [Prismic Next.js Multi-Page Website Starter][starter-docs] as a base, converted the whole thing to TypeScript, and then added all my own customisations on top of that. It's a great starter, and I highly recommend it for anyone wanting to build a Next.js site with Prismic.

- **Learn more about using Prismic with Next.js**: [Prismic Next.js Documentation][prismic-docs]

Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useThemeInitialisation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ function setTheme(newTheme: 'dark' | 'light') {
* In terms of the rules of React, this is pretty naughty lol, but it works.
* The main reason for this is so that it doesn't cause dramas with server-side rendering.
* If I implement stateful/reactive values into the main layout where the `html` element is rendered,
* then the entire app would be rendered client-side and SSR would be disabled.
* then the entire app would be rendered client-side and SSR/static-generation would be disabled.
*
* Note: it's also basically the same as what the official `React.dev` website does, so I'm not too worried 😅
*/
export function useThemeInitialisation() {
// onload effect.
Expand Down
4 changes: 1 addition & 3 deletions src/utils/type-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export type PolymorphicComponentProp<
declare global {
interface Window {
__theme: 'dark' | 'light';
__setPreferredTheme: (theme: 'dark' | 'light') => void;
__setPreferredTheme?: (theme: 'dark' | 'light') => void;
}
}

window.__setPreferredTheme = window.__setPreferredTheme || (() => {});
3 changes: 2 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export default {
content: [
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/hooks/**/*.{js,ts,jsx,tsx,mdx}',
'./src/slices/**/*.{js,ts,jsx,tsx,mdx}',
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/store/**/*.{js,ts,jsx,tsx,mdx}',
'./src/theme/**/*.{js,ts,jsx,tsx,mdx}',
'./src/utils/**/*.{js,ts,jsx,tsx,mdx}',
],
Expand Down

0 comments on commit e7b0c7e

Please sign in to comment.