mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
* Add crons option in the database menu. * Add react-hook-form to the studio package.json. * Refactor the functionSelector to be used by other features. * Add the bulk of the functionality for the cron UI. Some of the code is copy-pasted from functions feature, needs to be cleaned before merging. * Tons of changes, the Create Cron sheet works now. * Added some more functionality for the cronjob feature. * Convert the Cron table to a listing with cards. * Add click-to-copy in the Auth Hooks feature. * Remove extra prop. * Fix type errors. * Fix some random issues. Fix the tests. * Fix the tests. * Add a style for disabled radio button item. * Make the default SQL snippet. Handle the case pg_net is not installed. * Fix the heading and save button when creating a new cron job. * Change the name of the custom label in the schedule dropdown. * Minor fixes. * Rename all mentions of cronjobs to cron jobs. * Always show the cron jobs link. * Rename the link from crons to cron-jobs. * Fix the disabled state for the stacked radio group. * More minor fixes. * More small fixes. * Fix the tests. * Minor UI tweaks * More minor tweaks * Add padding bottom * Add feature flag for the cron ui. * Fix the SQL function option. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.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