diff --git a/docs/src/components/Layout/Sidebar.tsx b/docs/src/components/Layout/Sidebar.tsx index abfd70534bf..7438e4eff93 100644 --- a/docs/src/components/Layout/Sidebar.tsx +++ b/docs/src/components/Layout/Sidebar.tsx @@ -140,6 +140,10 @@ const SecondaryNav = (props) => { const isFlutter = platform === 'flutter'; const isReactNative = platform === 'react-native'; + const isAndroid = platform === 'android'; + const isSwift = platform === 'swift'; + const isGuidesHidden = isFlutter || isReactNative || isAndroid || isSwift; + const isThemingHidden = isAndroid || isSwift; return ( @@ -184,19 +188,22 @@ const SecondaryNav = (props) => { ))} - } - value="theming" - > - {theming.map(({ label, ...rest }) => ( - - {label} - - ))} - + {/* Swift and Android don't have guides at this time */} + {isGuidesHidden ? null : ( + } + value="theming" + > + {theming.map(({ label, ...rest }) => ( + + {label} + + ))} + + )} - {/* Flutter and React Native don't have guides at this time */} - {isFlutter || isReactNative ? null : ( + {/* Flutter, React Native, Swift, and Android don't have guides at this time */} + {isGuidesHidden ? null : ( } value="guides" diff --git a/docs/src/data/frameworks.ts b/docs/src/data/frameworks.ts index d7f82f8b45b..7cc367b77c0 100644 --- a/docs/src/data/frameworks.ts +++ b/docs/src/data/frameworks.ts @@ -1,24 +1,30 @@ export type Framework = + | 'android' | 'angular' | 'flutter' | 'react' | 'react-native' + | 'swift' | 'vue'; export type Frameworks = Framework[]; export const FRAMEWORKS: Frameworks = [ + 'android', 'angular', 'flutter', 'react', 'react-native', + 'swift', 'vue', ]; export const FRAMEWORK_DISPLAY_NAMES: Record = { + android: 'Android', angular: 'Angular', flutter: 'Flutter', react: 'React', 'react-native': 'React Native', + swift: 'Swift', vue: 'Vue', }; diff --git a/docs/src/data/links.tsx b/docs/src/data/links.tsx index e4ddc421df6..dbd18e6d93a 100644 --- a/docs/src/data/links.tsx +++ b/docs/src/data/links.tsx @@ -145,6 +145,12 @@ export const connectedComponents: ComponentNavItem[] = [ platforms: ['react'], tertiary: true, }, + { + href: '/connected-components/liveness', + label: 'Liveness', + body: 'Amplify UI provides a UI component for detecting whether the person in front of the camera is live.', + platforms: ['react', 'android', 'swift'], + }, { href: '/connected-components/geo', label: 'Geo', @@ -472,12 +478,28 @@ export const gettingStarted: ComponentNavItem[] = [ { href: '/getting-started/introduction', label: 'Introduction', - platforms: ['react', 'vue', 'angular', 'flutter', 'react-native'], + platforms: [ + 'react', + 'vue', + 'angular', + 'flutter', + 'react-native', + 'android', + 'swift', + ], }, { href: '/getting-started/installation', label: 'Installation', - platforms: ['react', 'vue', 'angular', 'flutter', 'react-native'], + platforms: [ + 'react', + 'vue', + 'angular', + 'flutter', + 'react-native', + 'android', + 'swift', + ], }, { href: '/getting-started/usage', diff --git a/docs/src/pages/[platform]/connected-components/liveness/android.mdx b/docs/src/pages/[platform]/connected-components/liveness/android.mdx new file mode 100644 index 00000000000..378968adde9 --- /dev/null +++ b/docs/src/pages/[platform]/connected-components/liveness/android.mdx @@ -0,0 +1,12 @@ +Amplify FaceLivenessDetector is powered by [Amazon Rekognition](FIXME). + +### Quick Start + +> Prerequisites: +> +> 1. Install`@aws-amplify/ui-react-ml`with [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/). ( e.g. `npm install @aws-amplify/ui-react-ml`) +> 2. Follow the Rekognition developer guide FIXME LINK [FIXMELINK](fixme). + +## FaceLivenessDetector + +FIXME fill this out diff --git a/docs/src/pages/[platform]/connected-components/liveness/index.page.mdx b/docs/src/pages/[platform]/connected-components/liveness/index.page.mdx new file mode 100644 index 00000000000..b86b1bc0856 --- /dev/null +++ b/docs/src/pages/[platform]/connected-components/liveness/index.page.mdx @@ -0,0 +1,20 @@ +--- +title: Liveness +description: Amplify UI provides a UI component for detecting whether the person in front of the camera is live. +supportedFrameworks: react|android|swift +--- + +import { Fragment } from '@/components/Fragment'; +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export async function getStaticPaths() { + return getCustomStaticPath(frontmatter.supportedFrameworks); +} + +{/* `getStaticProps` is required to prevent "Error: getStaticPaths was added without a getStaticProps. Without getStaticProps, getStaticPaths does nothing" */} + +export async function getStaticProps() { + return { props: {} } +} + +{({ platform }) => import(`./${platform}.mdx`)} diff --git a/docs/src/pages/[platform]/connected-components/liveness/react.mdx b/docs/src/pages/[platform]/connected-components/liveness/react.mdx new file mode 100644 index 00000000000..378968adde9 --- /dev/null +++ b/docs/src/pages/[platform]/connected-components/liveness/react.mdx @@ -0,0 +1,12 @@ +Amplify FaceLivenessDetector is powered by [Amazon Rekognition](FIXME). + +### Quick Start + +> Prerequisites: +> +> 1. Install`@aws-amplify/ui-react-ml`with [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/). ( e.g. `npm install @aws-amplify/ui-react-ml`) +> 2. Follow the Rekognition developer guide FIXME LINK [FIXMELINK](fixme). + +## FaceLivenessDetector + +FIXME fill this out diff --git a/docs/src/pages/[platform]/connected-components/liveness/swift.mdx b/docs/src/pages/[platform]/connected-components/liveness/swift.mdx new file mode 100644 index 00000000000..378968adde9 --- /dev/null +++ b/docs/src/pages/[platform]/connected-components/liveness/swift.mdx @@ -0,0 +1,12 @@ +Amplify FaceLivenessDetector is powered by [Amazon Rekognition](FIXME). + +### Quick Start + +> Prerequisites: +> +> 1. Install`@aws-amplify/ui-react-ml`with [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/). ( e.g. `npm install @aws-amplify/ui-react-ml`) +> 2. Follow the Rekognition developer guide FIXME LINK [FIXMELINK](fixme). + +## FaceLivenessDetector + +FIXME fill this out diff --git a/docs/src/pages/[platform]/index.android.tsx b/docs/src/pages/[platform]/index.android.tsx new file mode 100644 index 00000000000..f7c2628939b --- /dev/null +++ b/docs/src/pages/[platform]/index.android.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { useRouter } from 'next/router'; + +import { + AmplifySection, + AuthenticationSection, +} from '@/components/home/sections'; + +const AndroidHomePage = ({ colorMode }) => { + const { + query: { platform = 'android' }, + } = useRouter(); + + return ( + <> + + + ); +}; + +export default AndroidHomePage; diff --git a/docs/src/pages/[platform]/index.page.tsx b/docs/src/pages/[platform]/index.page.tsx index 74bd1ad7b67..969a69abf9e 100644 --- a/docs/src/pages/[platform]/index.page.tsx +++ b/docs/src/pages/[platform]/index.page.tsx @@ -12,6 +12,8 @@ import AngularHomePage from './index.angular'; import FlutterHomePage from './index.flutter'; import { FRAMEWORKS } from '@/data/frameworks'; import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; +import SwiftHomePage from './index.swift'; +import AndroidHomePage from './index.android'; export async function getStaticPaths() { return getCustomStaticPath(FRAMEWORKS); @@ -64,6 +66,12 @@ const HomePage = ({ colorMode }) => { case 'react-native': pageContent = ; break; + case 'android': + pageContent = ; + break; + case 'swift': + pageContent = ; + break; default: pageContent = ; break; diff --git a/docs/src/pages/[platform]/index.swift.tsx b/docs/src/pages/[platform]/index.swift.tsx new file mode 100644 index 00000000000..f0c3a0c4639 --- /dev/null +++ b/docs/src/pages/[platform]/index.swift.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { useRouter } from 'next/router'; + +import { + AmplifySection, + AuthenticationSection, +} from '@/components/home/sections'; + +const SwiftHomePage = ({ colorMode }) => { + const { + query: { platform = 'swift' }, + } = useRouter(); + + return ( + <> + + + ); +}; + +export default SwiftHomePage;