From 3247bd2d5630d42701a09555e09045ea92a624ce Mon Sep 17 00:00:00 2001 From: katty barroso Date: Thu, 21 Nov 2024 13:27:29 +0100 Subject: [PATCH 1/5] Add pool structure UI changes --- centrifuge-app/src/components/Tooltips.tsx | 20 ++ .../IssuerCreatePool/PoolSetupSection.tsx | 298 ++++++++++-------- .../IssuerCreatePool/PoolStructureSection.tsx | 4 +- .../src/pages/IssuerCreatePool/types.ts | 3 +- 4 files changed, 189 insertions(+), 136 deletions(-) diff --git a/centrifuge-app/src/components/Tooltips.tsx b/centrifuge-app/src/components/Tooltips.tsx index c7bc13c28b..0bca55ddcf 100644 --- a/centrifuge-app/src/components/Tooltips.tsx +++ b/centrifuge-app/src/components/Tooltips.tsx @@ -358,6 +358,26 @@ export const tooltipText = { label: '', body: 'This pool will have three classes. Senior tranche is the safest tranche with priority in repayment. Mezzanine tranche has intermediate risk and receives payment after Senior tranche obligations are met. Junior tranche which only receives returns after both Senior and Mezzanine tranches are paid.', }, + singleMultisign: { + label: '', + body: 'Setup a wallet where only one private key is required to authorise changes to the pool configuration.', + }, + multiMultisign: { + label: '', + body: 'Setup a wallet that requires multiple private keys to authorise changes to the pool configuration.', + }, + centrifugeOnboarding: { + label: '', + body: 'Investors will go through the Centrifuge onboarding provider, Shuftipro, before they can invest in your pool.', + }, + externalOnboarding: { + label: '', + body: 'You can select the provider you want to KYC/onboard your investors.', + }, + noneOnboarding: { + label: '', + body: 'You can directly whitelist the addresses that can invest in the pool.', + }, } export type TooltipsProps = { diff --git a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx index 92dd2f95fe..d3854f8993 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx @@ -1,7 +1,6 @@ import { PoolMetadataInput } from '@centrifuge/centrifuge-js' import { Box, - Button, Checkbox, FileUpload, Grid, @@ -14,7 +13,7 @@ import { Text, TextInput, } from '@centrifuge/fabric' -import { Field, FieldProps, useFormikContext } from 'formik' +import { Field, FieldArray, FieldProps, useFormikContext } from 'formik' import { useTheme } from 'styled-components' import { FieldWithErrorMessage } from '../../../src/components/FieldWithErrorMessage' import { Tooltips } from '../../../src/components/Tooltips' @@ -39,14 +38,9 @@ export const PoolSetupSection = () => { return ( - - - Management setup - - - + + Management setup + Pool managers* @@ -57,29 +51,47 @@ export const PoolSetupSection = () => { Security requirement } /> } /> - + Wallet addresses - - {({ field, form }: FieldProps) => } - - - {({ field, form }: FieldProps) => } - - + + {({ push }) => ( + <> + {form.values.adminMultisig?.signers?.map((_, index) => ( + + + {({ field }: FieldProps) => } + + + ))} + + { + if (form.values.adminMultisig && form.values.adminMultisig.signers?.length <= 10) { + push('') + } + }} + /> + + + )} + + @@ -88,12 +100,18 @@ export const PoolSetupSection = () => { {({ field, meta, form }: FieldProps) => ( form.setFieldValue(`poolFees.${index}.category`, event.target.value)} - onBlur={field.onBlur} - errorMessage={meta.touched && meta.error ? meta.error : undefined} - value={field.value} - options={feeCategories.map((cat) => ({ label: cat, value: cat }))} - /> - )} - - - {({ field, meta }: FieldProps) => { - return ( - { - form.setFieldValue(`poolFees.${index}.feeType`, event.target.value) - }} - onBlur={field.onBlur} - errorMessage={meta.touched && meta.error ? meta.error : undefined} - value={field.value} - options={FEE_TYPES} + + {({ field, meta }: FieldProps) => ( + form.setFieldValue(`poolFees.${index}.feePosition`, event.target.value)} + onBlur={field.onBlur} + errorMessage={meta.touched && meta.error ? meta.error : undefined} + value={field.value} + options={FEE_POSISTIONS} + /> + )} + + + {({ field, meta }: FieldProps) => ( +