106 | {this.state.step === 1 && (
107 |
108 | )}
109 | {this.state.step === 2 && this.state.challengeMetadata.type === "NOSE" && (
110 |
115 | )}
116 | {this.state.step === 2 && this.state.challengeMetadata.type === "POSE" && (
117 |
122 | )}
123 | {this.state.step === 3 &&
}
124 | {this.state.step === 4 &&
}
125 | {this.state.step === -1 &&
}
126 |
127 | );
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/source/client/src/liveness/nose/NoseChallenge.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | * SPDX-License-Identifier: Apache-2.0
4 | */
5 |
6 | import React from "react";
7 | import "./NoseChallenge.css";
8 | // @ts-ignore
9 | import Lottie from "react-lottie";
10 | import SpinnerMessage from "../components/SpinnerMessage";
11 | import { NoseChallengeProcessor } from "./NoseChallengeProcessor";
12 | import { ChallengeMetadata } from "../utils/APIUtils";
13 | import { ConfigUtils } from "../utils/ConfigUtils";
14 | import { MediaUtils } from "../utils/MediaUtils";
15 | import * as help1 from "./lottie/help1.json";
16 | import * as help2 from "./lottie/help2.json";
17 |
18 | type Props = {
19 | challengeMetadata: ChallengeMetadata;
20 | onLocalEnd: (localSuccess: boolean) => void;
21 | onError: (error: Error) => void;
22 | };
23 |
24 | type State = {
25 | message: string;
26 | animation: number;
27 | localSuccess: boolean;
28 | uploading: boolean;
29 | };
30 |
31 | export default class NoseChallenge extends React.Component