-
Notifications
You must be signed in to change notification settings - Fork 460
refactor(ui): wire mosaic organization sections to real Clerk hooks #9017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+349
−151
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| import { Box } from '../components/box'; | ||
| import { Tabs } from '../components/tabs'; | ||
|
|
||
| interface OrganizationProfileViewProps { | ||
| /** The General tab's panel content. */ | ||
| general: ReactNode; | ||
| } | ||
|
|
||
| export function OrganizationProfileView({ general }: OrganizationProfileViewProps) { | ||
| return ( | ||
| <Box | ||
| sx={{ | ||
| width: '100%', | ||
| }} | ||
| > | ||
| <Box | ||
| render={p => <h1 {...p} />} | ||
| sx={t => ({ | ||
| ...t.text('lg'), | ||
| fontWeight: t.font.semibold, | ||
| marginBlockEnd: t.spacing(8), | ||
| })} | ||
| > | ||
| Organization Profile | ||
| </Box> | ||
| <Tabs.Root defaultValue='general'> | ||
| <Tabs.List> | ||
| <Tabs.Tab value='general'>General</Tabs.Tab> | ||
| <Tabs.Tab value='members'>Members</Tabs.Tab> | ||
| </Tabs.List> | ||
| <Tabs.Panel value='general'>{general}</Tabs.Panel> | ||
| <Tabs.Panel value='members'> | ||
| <Box | ||
| render={p => <h1 {...p} />} | ||
| sx={t => ({ | ||
| ...t.text('base'), | ||
| fontWeight: t.font.medium, | ||
| textAlign: 'center', | ||
| })} | ||
| > | ||
| Members content | ||
| </Box> | ||
| </Tabs.Panel> | ||
| </Tabs.Root> | ||
| </Box> | ||
| ); | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,6 @@ | ||
| import { Box } from '../components/box'; | ||
| import { Tabs } from '../components/tabs'; | ||
| import { OrganizationProfileGeneral } from '../panels/organization-profile-general'; | ||
| import { OrganizationProfileView } from './organization-profile-view'; | ||
|
|
||
| export function OrganizationProfile() { | ||
| return ( | ||
| <Box | ||
| sx={t => ({ | ||
| width: '100%', | ||
| })} | ||
| > | ||
| <Box | ||
| render={p => <h1 {...p} />} | ||
| sx={t => ({ | ||
| ...t.text('lg'), | ||
| fontWeight: t.font.semibold, | ||
| marginBlockEnd: t.spacing(8), | ||
| })} | ||
| > | ||
| Organization Profile | ||
| </Box> | ||
| <Tabs.Root defaultValue='general'> | ||
| <Tabs.List> | ||
| <Tabs.Tab value='general'>General</Tabs.Tab> | ||
| <Tabs.Tab value='members'>Members</Tabs.Tab> | ||
| </Tabs.List> | ||
| <Tabs.Panel value='general'> | ||
| <OrganizationProfileGeneral /> | ||
| </Tabs.Panel> | ||
| <Tabs.Panel value='members'> | ||
| <Box | ||
| render={p => <h1 {...p} />} | ||
| sx={t => ({ | ||
| ...t.text('base'), | ||
| fontWeight: t.font.medium, | ||
| textAlign: 'center', | ||
| })} | ||
| > | ||
| Members content | ||
| </Box> | ||
| </Tabs.Panel> | ||
| </Tabs.Root> | ||
| </Box> | ||
| ); | ||
| return <OrganizationProfileView general={<OrganizationProfileGeneral />} />; | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/ui/src/mosaic/panels/organization-profile-general-view.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| import { Box } from '../components/box'; | ||
| import { alpha } from '../utils'; | ||
|
|
||
| interface OrganizationProfileGeneralViewProps { | ||
| /** The leave-organization section, rendered above the divider. */ | ||
| leaveOrganization: ReactNode; | ||
| /** The delete-organization section, rendered below the divider. */ | ||
| deleteOrganization: ReactNode; | ||
| } | ||
|
|
||
| export function OrganizationProfileGeneralView({ | ||
| leaveOrganization, | ||
| deleteOrganization, | ||
| }: OrganizationProfileGeneralViewProps) { | ||
| return ( | ||
| <Box | ||
| sx={{ | ||
| width: '100%', | ||
| containerType: 'inline-size', | ||
| }} | ||
| > | ||
| {leaveOrganization} | ||
| <Box | ||
| sx={t => ({ | ||
| height: '1px', | ||
| background: `light-dark(${alpha('#000', 10)},${alpha('#fff', 10)})`, | ||
| marginBlock: t.spacing(4), | ||
| })} | ||
| /> | ||
| {deleteOrganization} | ||
| </Box> | ||
| ); | ||
| } |
23 changes: 5 additions & 18 deletions
23
packages/ui/src/mosaic/panels/organization-profile-general.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,12 @@ | ||
| import { Box } from '../components/box'; | ||
| import { DeleteOrganization } from '../sections/delete-organization'; | ||
| import { LeaveOrganization } from '../sections/leave-organization'; | ||
| import { alpha } from '../utils'; | ||
| import { OrganizationProfileGeneralView } from './organization-profile-general-view'; | ||
|
|
||
| export function OrganizationProfileGeneral() { | ||
| return ( | ||
| <Box | ||
| sx={t => ({ | ||
| width: '100%', | ||
| containerType: 'inline-size', | ||
| })} | ||
| > | ||
| <LeaveOrganization /> | ||
| <Box | ||
| sx={t => ({ | ||
| height: '1px', | ||
| background: `light-dark(${alpha('#000', 10)},${alpha('#fff', 10)})`, | ||
| marginBlock: t.spacing(4), | ||
| })} | ||
| /> | ||
| <DeleteOrganization /> | ||
| </Box> | ||
| <OrganizationProfileGeneralView | ||
| leaveOrganization={<LeaveOrganization />} | ||
| deleteOrganization={<DeleteOrganization />} | ||
| /> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.