mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 11:55:05 +03:00
## Context Couple of small QoL improvements for branch management from internal feedback - Use `TimestampInfo` component for branch rows here <img width="786" height="395" alt="image" src="https://github.com/user-attachments/assets/639381e3-359b-4b11-9854-623d8cc7584f" /> - Workflow logs dialog will show branch name + use `TimestampInfo` component as well for workflow runs created at <img width="836" height="462" alt="image" src="https://github.com/user-attachments/assets/1d2af7fe-9445-47ae-a1a3-a5dcf0fecf4c" /> - Selecting a workflow run will then show the run created at in the header description + use `TimestampInfo` component <img width="829" height="256" alt="image" src="https://github.com/user-attachments/assets/9fe65f21-e948-4f49-a9ba-46acd9505f2f" />
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