diff --git a/src/react-components/ory/user-settings-screen.tsx b/src/react-components/ory/user-settings-screen.tsx index 0c78bcdf3..79bdf1d96 100644 --- a/src/react-components/ory/user-settings-screen.tsx +++ b/src/react-components/ory/user-settings-screen.tsx @@ -147,19 +147,22 @@ const body = ({ "webauthn", "totp", ] as UserSettingsFlowType[] - ).map( - (flowType) => - flow.ui.nodes.some(({ group }) => group === flowType) && ( -
- - -
- ), - )} + ).map((flowType) => { + const $card = + if (!$card) { + return null + } + return ( +
+ {$card} + +
+ ) + })} ) diff --git a/src/stories/Ory/SettingsScreen.stories.tsx b/src/stories/Ory/SettingsScreen.stories.tsx new file mode 100644 index 000000000..1135619b1 --- /dev/null +++ b/src/stories/Ory/SettingsScreen.stories.tsx @@ -0,0 +1,36 @@ +import { ComponentProps } from "react" +import { Meta, StoryFn } from "@storybook/react" + +import { Container } from "../storyhelper" +import { + UserSettingsScreen, + UserSettingsScreenProps, +} from "../../react-components" +import settingsFlow from "./settings-flow.json" +import { SettingsFlow } from "@ory/client" + +const Screen = (props: UserSettingsScreenProps) => ( +
+ +
+ +
+
+) + +export default { + title: "Ory/SettingsScreen", + component: Screen, +} as Meta + +const Template: StoryFn> = (args) => ( + + + +) + +export const SettingsScreen = Template.bind({}) +SettingsScreen.args = { + flow: settingsFlow as SettingsFlow, + logoutUrl: "https://www.ory.sh", +}