Skip to content

Commit 409cdae

Browse files
authored
fix(ui): render organization profile modal close button inside the SSO wizard header (#9089)
1 parent 7516127 commit 409cdae

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/ui': patch
3+
---
4+
5+
Fix the organization profile modal close button overlapping the SSO configuration wizard's step header.

packages/ui/src/components/ConfigureSSO/ConfigureSSOHeader.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Flex, useLocalizations } from '@/customizables';
2+
import { useUnsafeModalContext } from '@/elements/Modal';
23
import { mqu } from '@/styledSystem';
34

45
import { ProfileCardHeader } from './elements/ProfileCard';
@@ -12,6 +13,8 @@ type ConfigureSSOHeaderProps = {
1213
export const ConfigureSSOHeader = ({ title }: ConfigureSSOHeaderProps): JSX.Element => {
1314
const { activeSteps, currentIndex, goToStep } = useWizard();
1415
const { t } = useLocalizations();
16+
const { toggle } = useUnsafeModalContext();
17+
const isModal = Boolean(toggle);
1518

1619
// Breadcrumb membership = labelled steps. `select-provider` has no label, so
1720
// it is absent from the visual stepper while remaining a real navigable step.
@@ -22,7 +25,14 @@ export const ConfigureSSOHeader = ({ title }: ConfigureSSOHeaderProps): JSX.Elem
2225
<ProfileCardHeader>
2326
{title}
2427

25-
<Flex sx={title ? { marginInlineStart: 'auto', [mqu.md]: { marginInlineStart: 0 } } : undefined}>
28+
<Flex
29+
sx={t => ({
30+
...(title ? { marginInlineStart: 'auto', [mqu.md]: { marginInlineStart: 0 } } : {}),
31+
// Reserve room for the card's absolute close button (modal only) so the
32+
// stepper doesn't render under it. Steps wrap when space is tight.
33+
...(isModal ? { marginInlineEnd: t.space.$10 } : {}),
34+
})}
35+
>
2636
<Stepper>
2737
{visibleSteps.map((step, index) => {
2838
const isCurrent = index === currentVisibleIndex;

packages/ui/src/components/ConfigureSSO/elements/ProfileCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const ProfileCardHeader = (props: ProfileCardHeaderProps): JSX.Element =>
99
elementDescriptor={descriptors.configureSSOHeader}
1010
{...props}
1111
sx={theme => ({
12-
gap: theme.space.$2,
12+
// Min gap between the back button and the stepper (the auto-margin collapses when the stepper wraps at tight widths).
13+
gap: theme.space.$4,
1314
width: '100%',
1415
minHeight: theme.sizes.$13,
1516
padding: theme.space.$5,

0 commit comments

Comments
 (0)