Skip to content

Commit

Permalink
chore: Step2Form error dependent on scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
shindigira committed Oct 10, 2023
1 parent e4bf56b commit cde31a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/pages/ProfileForm/Step2Form/Step2Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useProfileForm from "store/useProfileForm";
import { Link, Notification } from 'design-system-react';
import Step2FormHeader from './Step2FormHeader';

import { Scenarios } from './Step2FormHeader.data';
import { Step2FormHeaderMessages, Scenarios} from './Step2FormHeader.data';

interface Properties {
}
Expand All @@ -23,9 +23,9 @@ function Step2Form({}: Properties): JSX.Element {
window.scrollTo({ top: 0});
}, []);

const [selectedScenario, setScenario] = useState<Scenarios>(Scenarios.Error2);
const [selectedScenario, setScenario] = useState<Scenarios>(Scenarios.Warning1B);

if (selectedScenario === Scenarios.Error2) return (
if (Step2FormHeaderMessages[selectedScenario].type === "error") return (
<div id="step2form">
<Step2FormHeader scenario={selectedScenario} />
</div>
Expand All @@ -52,7 +52,7 @@ function Step2Form({}: Properties): JSX.Element {
{profileData.financialInstitutions.map(obj => {
const success = Boolean(randomIntFromInterval(0, 1));
return (
<div key={obj.lei} className='mb-2 flex flex-row gap-[15px]'>
<div key={obj.lei} className='mb-2 flex flex-row gap-[0.9375rem]'>
<div className="min-w-[6.25rem]">
<Notification isFieldLevel type={ success ? "success" : "warning"} message={ success ? "Approved" : "Pending"} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ProfileForm/Step2Form/Step2FormHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Step2FormHeaderProperties {
function Step2FormHeader({ scenario = Scenarios.Success1A }: Step2FormHeaderProperties): JSX.Element {
return (
<div id="Step2FormHeader" className="max-w-[670px] mb-[45px]">
<h1 className="mb-[30px]">{scenario === Scenarios.Error2 ? "Unable to complete registration" : "User profile submission status"}</h1>
<h1 className="mb-[30px]">{Step2FormHeaderMessages[scenario].type === "error" ? "Unable to complete registration" : "User profile submission status"}</h1>
<Notification
message={Step2FormHeaderMessages[scenario].message}
type={Step2FormHeaderMessages[scenario].type}
Expand Down

0 comments on commit cde31a4

Please sign in to comment.