Skip to content

Commit

Permalink
fix(docs): fix resetPassword tabs (#4723)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpollman authored Nov 15, 2023
1 parent b289850 commit 0bc6151
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Fragment } from '@/components/Fragment';
import { Tabs } from '@aws-amplify/ui-react';

export const InitialStateTabs = () => {
return (
<Tabs.Container defaultValue="sign-in">
<Tabs.List>
<Tabs.Item value="sign-in">Sign In</Tabs.Item>
<Tabs.Item value="sign-up">Sign Up</Tabs.Item>
<Tabs.Item value="forgot-password">Forgot Password</Tabs.Item>
</Tabs.List>
<Tabs.Panel value="sign-in">
<Fragment>
{({ platform }) => import(`./initialState.signIn.${platform}.mdx`)}
</Fragment>
<Fragment platforms={['web', 'flutter']} useCommonWebContent>
{({ platform }) =>
import(`./initialState.signIn.example.${platform}.mdx`)
}
</Fragment>
</Tabs.Panel>
<Tabs.Panel value="sign-up">
<Fragment>
{({ platform }) => import(`./initialState.signUp.${platform}.mdx`)}
</Fragment>
<Fragment platforms={['web', 'flutter']} useCommonWebContent>
{({ platform }) =>
import(`./initialState.signUp.example.${platform}.mdx`)
}
</Fragment>
</Tabs.Panel>
<Tabs.Panel value="forgot-password">
<Fragment>
{({ platform }) =>
import(`./initialState.forgotPassword.${platform}.mdx`)
}
</Fragment>
<Fragment platforms={['web', 'flutter']} useCommonWebContent>
{({ platform }) =>
import(`./initialState.forgotPassword.example.${platform}.mdx`)
}
</Fragment>
</Tabs.Panel>
</Tabs.Container>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Fragment } from '@/components/Fragment';
import { Alert, Tabs } from '@aws-amplify/ui-react';
import { FRAMEWORKS } from '@/data/frameworks';
import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
import { InitialStateTabs } from './InitialStateTabs';

export async function getStaticPaths() {
return getCustomStaticPath(frontmatter.supportedFrameworks);
Expand All @@ -28,43 +29,7 @@ export async function getStaticProps() {

By default, unauthenticated users are redirected to the Sign In flow. You can explicitly redirect to Sign Up or Forgot Password:

<Tabs.Container defaultValue="sign-in">
<Tabs.List>
<Tabs.Item value="sign-in">Sign In</Tabs.Item>
<Tabs.Item value="sign-up">Sign Up</Tabs.Item>
<Tabs.Item value="forgot-password">Forgot Password</Tabs.Item>
</Tabs.List>
<Tabs.Panel value="sign-in">
<Fragment>
{({ platform }) => import(`./initialState.signIn.${platform}.mdx`)}
</Fragment>
<Fragment platforms={['web', 'flutter']} useCommonWebContent>
{({ platform }) =>
import(`./initialState.signIn.example.${platform}.mdx`)
}
</Fragment>
</Tabs.Panel>
<Tabs.Panel value="sign-up">
<Fragment>
{({ platform }) => import(`./initialState.signUp.${platform}.mdx`)}
</Fragment>
<Fragment platforms={['web', 'flutter']} useCommonWebContent>
{({ platform }) =>
import(`./initialState.signUp.example.${platform}.mdx`)
}
</Fragment>
</Tabs.Panel>
<Tabs.Panel value="Forgot Password">
<Fragment>
{({ platform }) => import(`./initialState.forgotPassword.${platform}.mdx`)}
</Fragment>
<Fragment platforms={['web', 'flutter']} useCommonWebContent>
{({ platform }) =>
import(`./initialState.forgotPassword.example.${platform}.mdx`)
}
</Fragment>
</Tabs.Panel>
</Tabs.Container>
<InitialStateTabs />

## Login Mechanisms

Expand Down

0 comments on commit 0bc6151

Please sign in to comment.