This file contains hidden or 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
| /* More info: https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=If%20the%20target%20is%20the,44%20by%2044%20CSS%20pixels.&text=A%20footnote%20or%20an%20icon,from%20the%20minimum%20target%20size */ | |
| /* touch-hitbox or pointer-coarse:touch-hitbox (mobile-only) */ | |
| @utility touch-hitbox { | |
| position: relative; | |
| &:before { | |
| content: ""; | |
| cursor: pointer; | |
| position: absolute; |
This file contains hidden or 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
| { | |
| "arrowParens": "always", | |
| "semi": false, | |
| "singleQuote": true, | |
| "tabWidth": 2, | |
| "trailingComma": "none", | |
| "plugins": [ | |
| "prettier-plugin-tailwindcss" | |
| ] | |
| } |
This file contains hidden or 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
| app.post<{ | |
| Body: { | |
| userId: string | |
| } | |
| // More keys: https://fastify.dev/docs/latest/Reference/TypeScript/#using-generics (3rd step) | |
| }>( | |
| '/my-endpoint', | |
| async ({ body }, reply) { | |
| console.log(body) // <- is of correct type | |
| } |
This file contains hidden or 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
| import { createContext, useContext, useReducer } from 'react' | |
| type State = { | |
| isLoading: boolean | |
| isSignout: boolean | |
| userToken: string | null | |
| } | |
| type Action = | |
| | { type: 'LOADED' } |
This file contains hidden or 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
| import { useRouter } from "next/router" | |
| import { useEffect, useRef } from "react" | |
| export const usePreserveScroll = () => { | |
| const router = useRouter() | |
| const scrollPositions = useRef<{ [url: string]: number }>({}) | |
| const isBack = useRef(false) | |
| useEffect(() => { |
This file contains hidden or 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
| const Component: React.FC = () => { | |
| return <></> | |
| } |