mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 13:49:09 +03:00
## Problem - The legacy jwt settings still uses `formik` and we want to remove it in favour of `react-hook-form` to keep only one form library - The legacy jwt settings does not follow the design system guidelines ## Solution - Migrate to `react-hook-form` - Apply the design system guidelines ## How to test To test the custom JWT secret, I haven't found a better way than inverting the condition at L337 (`!legacyKey` to `legacyKey`). This allowed me to ensure the process worked at least up to the API call which fails with my local instance as legacy tokens aren't supported anymore. ## Screenshots Before: <img width="1199" height="599" alt="image" src="https://github.com/user-attachments/assets/1c6e0bb1-0698-4238-847f-d2c72adf3462" /> After: <img width="1228" height="646" alt="image" src="https://github.com/user-attachments/assets/3b2a45a9-aa43-4c3e-9653-2b2610616889" /> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Writing components
Where to create your components
- For components that declare the general structure and layout of a page:
/components/layouts/xxx
- For components that are tightly coupled to a specific interface:
/components/interfaces/xxx
- For components that are meant to be reusable across multiple pages:
/components/ui/xxx
- Note: We're gradually moving files out of the
to-be-cleanedfolder into the respective folders as we refactor
Component structure
- If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an
index.tsxas an entry point - Otherwise it can just be a file on its own
- For example:
-
components/ui - SampleComponentA - SampleComponentA.tsx - SampleComponentA.constants.ts - SampleComponentA.utils.ts - SampleComponentA.types.ts - index.ts - SampleComponentB.tsx
-
Template for building components
// Declare the prop types of your component
interface ComponentAProps {
sampleProp: string
}
// Name your component accordingly
const ComponentA = ({ sampleProp }: ComponentAProps) => {
return <div>ComponentA: {sampleProp}</div>
}
export default ComponentA