From 45db2a94dfabd39f80c617ae184d714c61c5de5e Mon Sep 17 00:00:00 2001 From: katty barroso Date: Thu, 21 Nov 2024 10:49:49 +0100 Subject: [PATCH] FIXUP --- .../src/components/FieldWithErrorMessage.tsx | 30 +- centrifuge-app/src/components/LoanList.tsx | 1 + .../IssuerCreatePool/IssuerCategories.tsx | 76 +++++ .../IssuerCreatePool/PoolDetailsSection.tsx | 280 ++++++------------ .../pages/IssuerCreatePool/PoolRatings.tsx | 80 +++++ .../IssuerCreatePool/PoolStructureSection.tsx | 4 +- .../src/pages/IssuerCreatePool/index.tsx | 48 ++- .../src/pages/IssuerCreatePool/types.ts | 27 +- centrifuge-js/src/modules/pools.ts | 32 +- fabric/src/components/Checkbox/index.tsx | 86 +++--- fabric/src/components/Stepper/index.tsx | 10 +- fabric/src/components/TextInput/index.tsx | 51 +++- 12 files changed, 444 insertions(+), 281 deletions(-) create mode 100644 centrifuge-app/src/pages/IssuerCreatePool/IssuerCategories.tsx create mode 100644 centrifuge-app/src/pages/IssuerCreatePool/PoolRatings.tsx diff --git a/centrifuge-app/src/components/FieldWithErrorMessage.tsx b/centrifuge-app/src/components/FieldWithErrorMessage.tsx index eef59b73ef..6490da9328 100644 --- a/centrifuge-app/src/components/FieldWithErrorMessage.tsx +++ b/centrifuge-app/src/components/FieldWithErrorMessage.tsx @@ -1,11 +1,35 @@ -import { Field, FieldAttributes, useField } from 'formik' +import { Box, URLInput } from '@centrifuge/fabric' +import { Field, FieldAttributes, useField, useFormikContext } from 'formik' import * as React from 'react' type Props = FieldAttributes & { label?: string | React.ReactElement + prefix?: string + isUrl?: boolean } export function FieldWithErrorMessage(props: Props) { - const [, meta] = useField(props) - return + const [field, meta] = useField(props) + const form = useFormikContext() + + const handleChange = (event: React.ChangeEvent) => { + form.setFieldValue(field.name, event.target.value) + } + + return props.isUrl ? ( + + + + ) : ( + + ) } diff --git a/centrifuge-app/src/components/LoanList.tsx b/centrifuge-app/src/components/LoanList.tsx index 711103b6d4..76795dd699 100644 --- a/centrifuge-app/src/components/LoanList.tsx +++ b/centrifuge-app/src/components/LoanList.tsx @@ -279,6 +279,7 @@ export function LoanList({ loans, snapshots }: Props) { } onChange={(e) => setShowRepaid(!showRepaid)} + variant="square" />