Skip to content

Commit

Permalink
fix: tune spacing for two-steps registration
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl committed Feb 7, 2024
1 parent d8e7451 commit 0110f8c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 34 deletions.
20 changes: 9 additions & 11 deletions src/react-components/ory/sections/auth-code-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ export const AuthCodeSection = ({
}}
/>
<div className={gridStyle({ gap: 32 })}>
<div className={gridStyle({ gap: 16 })}>
{/* default group is used here automatically for login */}
<FilterFlowNodes
filter={{
nodes: nodes,
groups: "code",
withoutDefaultAttributes: true,
excludeAttributes: ["hidden", "button", "submit"], // the form will take care of default (csrf) hidden fields
}}
/>
</div>
{/* default group is used here automatically for login */}
<FilterFlowNodes
filter={{
nodes: nodes,
groups: "code",
withoutDefaultAttributes: true,
excludeAttributes: ["hidden", "button", "submit"], // the form will take care of default (csrf) hidden fields
}}
/>
{/* include hidden here because we want to have resend support */}
{/* exclude default group because we dont want to map csrf twice */}
<FilterFlowNodes
Expand Down
24 changes: 9 additions & 15 deletions src/react-components/ory/sections/profile-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { SettingsFlow } from "@ory/client"
import { gridStyle } from "../../../theme"
import { FilterFlowNodes } from "../helpers/filter-flow-nodes"
import { SelfServiceFlow } from "../helpers/types"
import {
hasPasskey,
hasPassword,
hasProfile,
hasWebauthn,
} from "../helpers/utils"
import { hasProfile } from "../helpers/utils"

export interface ProfileSettingsProps {
flow: SettingsFlow
Expand Down Expand Up @@ -37,19 +32,18 @@ export const ProfileRegistrationSection = (
): JSX.Element | null => {
return hasProfile(flow.ui.nodes) ? (
<div className={gridStyle({ gap: 32 })}>
<div className={gridStyle({ gap: 16 })}>
<FilterFlowNodes
filter={{
nodes: flow.ui.nodes,
groups: ["profile"],
excludeAttributes: "submit",
}}
/>
</div>
<FilterFlowNodes
filter={{
nodes: flow.ui.nodes,
groups: ["profile"],
excludeAttributes: "submit,hidden",
}}
/>
<FilterFlowNodes
filter={{
nodes: flow.ui.nodes,
groups: ["profile"],
excludeAttributes: "hidden",
attributes: "submit",
}}
/>
Expand Down
17 changes: 9 additions & 8 deletions src/react-components/ory/user-auth-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,6 @@ export const UserAuthCard = ({
</UserAuthForm>
</>
)}
{$profile && (
<>
<Divider />
<UserAuthForm flow={flow} data-testid={`${flowType}-flow-profile`}>
{$profile}
</UserAuthForm>
</>
)}
{$code && (
<>
<Divider />
Expand Down Expand Up @@ -567,6 +559,15 @@ export const UserAuthCard = ({
</>
)}

{$profile && (
<>
<Divider />
<UserAuthForm flow={flow} data-testid={`${flowType}-flow-profile`}>
{$profile}
</UserAuthForm>
</>
)}

{message && MessageSection(message)}
</div>
</Card>
Expand Down

0 comments on commit 0110f8c

Please sign in to comment.