diff --git a/centrifuge-app/src/components/Menu/IssuerMenu.tsx b/centrifuge-app/src/components/Menu/IssuerMenu.tsx index 24ad7b9a81..1e2385649a 100644 --- a/centrifuge-app/src/components/Menu/IssuerMenu.tsx +++ b/centrifuge-app/src/components/Menu/IssuerMenu.tsx @@ -62,9 +62,9 @@ export function IssuerMenu({ defaultOpen = false, children }: IssuerMenuProps) { Issuer {isLarge && (open ? ( - + ) : ( - + ))} diff --git a/centrifuge-app/src/components/Menu/Toggle.tsx b/centrifuge-app/src/components/Menu/Toggle.tsx index 8737377fe0..08838a5cfa 100644 --- a/centrifuge-app/src/components/Menu/Toggle.tsx +++ b/centrifuge-app/src/components/Menu/Toggle.tsx @@ -10,7 +10,7 @@ export const Toggle = styled(Text)<{ isActive?: boolean; stacked?: boolean }>` width: 100%; grid-template-columns: ${({ stacked, theme }) => stacked ? '1fr' : `${theme.sizes.iconSmall}px 1fr ${theme.sizes.iconSmall}px`}; - color: ${({ isActive, theme }) => (isActive ? theme.colors.textGold : theme.colors.textInverted)}; + color: ${({ theme }) => theme.colors.textInverted}; border-radius: 4px; background-color: ${({ isActive }) => (isActive ? LIGHT_BACKGROUND : 'transparent')}; diff --git a/centrifuge-app/src/components/Menu/index.tsx b/centrifuge-app/src/components/Menu/index.tsx index 1c3e321919..5fe10a79d2 100644 --- a/centrifuge-app/src/components/Menu/index.tsx +++ b/centrifuge-app/src/components/Menu/index.tsx @@ -40,6 +40,10 @@ const StyledRouterLinkButton = styled(RouterLinkButton)` background-color: ${COLOR}; color: white; } + + &:active { + border-color: transparent; + } } ` diff --git a/centrifuge-app/src/pages/IssuerCreatePool/AdminMultisig.tsx b/centrifuge-app/src/pages/IssuerCreatePool/AdminMultisig.tsx index 68476ce014..5ac4c2de4e 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/AdminMultisig.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/AdminMultisig.tsx @@ -1,9 +1,9 @@ import { useWallet } from '@centrifuge/centrifuge-react' import { Button } from '@centrifuge/fabric' import { useFormikContext } from 'formik' -import { CreatePoolValues } from '.' import { PageSection } from '../../components/PageSection' import { MultisigForm } from '../IssuerPool/Access/MultisigForm' +import { CreatePoolValues } from './types' export function AdminMultisigSection() { const form = useFormikContext() diff --git a/centrifuge-app/src/pages/IssuerCreatePool/IssuerCategories.tsx b/centrifuge-app/src/pages/IssuerCreatePool/IssuerCategories.tsx index 4d70a2f345..311c7e76a7 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/IssuerCategories.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/IssuerCategories.tsx @@ -1,5 +1,5 @@ import { PoolMetadataInput } from '@centrifuge/centrifuge-js' -import { Box, IconButton, IconTrash, Select, Text, TextInput } from '@centrifuge/fabric' +import { Box, Grid, IconButton, IconTrash, Select, Text, TextInput } from '@centrifuge/fabric' import { Field, FieldArray, FieldProps, useFormikContext } from 'formik' import { AddButton } from './PoolDetailsSection' import { StyledGrid } from './PoolStructureSection' @@ -38,24 +38,32 @@ export const IssuerCategoriesSection = () => { {({ push, remove }) => ( <> - {form.values.issuerCategories.map((_, index) => ( + {form.values.issuerCategories.map((category, index) => ( <> - - {({ field, meta }: FieldProps) => ( - form.setFieldValue(field.name, event.target.value)} + onBlur={field.onBlur} + value={field.value} + options={PROVIDERS} + placeholder="Please select..." + /> + )} + + {category.type === 'other' && ( + + {({ field, meta }: FieldProps) => ( + + )} + )} - - + - {({ field, meta }: FieldProps) => ( + {({ field }: FieldProps) => ( { const form = useFormikContext() const createLabel = (label: string) => `${label}${isTestEnv ? '' : '*'}` - console.log(form.values) - return ( @@ -193,7 +191,6 @@ export const PoolDetailsSection = () => { placeholder="Type here..." maxLength={1000} errorMessage={meta.touched && meta.error ? meta.error : undefined} - // disabled={waitingForStoredIssuer} /> )} @@ -299,9 +296,9 @@ export const PoolDetailsSection = () => { onFileChange={(file) => { form.setFieldValue('reportAuthorAvatar', file) }} - accept="application/pdf" label="Reviewer avatar" placeholder="Choose file" + accept="image/*" small /> )} diff --git a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx index b3bfede001..971334ca03 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx @@ -1,4 +1,5 @@ -import { PoolMetadataInput } from '@centrifuge/centrifuge-js' +import { addressToHex, evmToSubstrateAddress, PoolMetadataInput } from '@centrifuge/centrifuge-js' +import { useCentEvmChainId } from '@centrifuge/centrifuge-react' import { Box, Checkbox, @@ -18,6 +19,7 @@ import { useTheme } from 'styled-components' import { FieldWithErrorMessage } from '../../../src/components/FieldWithErrorMessage' import { Tooltips } from '../../../src/components/Tooltips' import { feeCategories } from '../../../src/config' +import { isEvmAddress } from '../../../src/utils/address' import { AddButton } from './PoolDetailsSection' import { CheckboxOption, Line, StyledGrid } from './PoolStructureSection' @@ -28,8 +30,30 @@ const FEE_TYPES = [ const FEE_POSISTIONS = [{ label: 'Top of waterfall', value: 'Top of waterfall' }] +const TaxDocument = () => { + const form = useFormikContext() + + return ( + + Tax document requirement + + + {({ field }: FieldProps) => ( + form.setFieldValue('onboarding.taxInfoRequired', val.target.checked ? true : false)} + /> + )} + + + ) +} + export const PoolSetupSection = () => { const theme = useTheme() + const chainId = useCentEvmChainId() const form = useFormikContext() const { values } = form @@ -73,7 +97,24 @@ export const PoolSetupSection = () => { values.adminMultisig?.signers?.map((_, index) => ( - {({ field }: FieldProps) => } + {({ field, form }: FieldProps) => ( + { + form.setFieldValue(`adminMultisig.signers.${index}`, val.target.value) + }} + onBlur={() => { + const value = form.values.adminMultisig.signers[index] + if (value) { + const transformedValue = isEvmAddress(value) + ? evmToSubstrateAddress(value, chainId ?? 0) + : value + form.setFieldValue(`adminMultisig.signers.${index}`, transformedValue) + } + }} + /> + )} )) @@ -88,7 +129,7 @@ export const PoolSetupSection = () => { { - if (form.values.adminMultisig && form.values.adminMultisig.signers?.length <= 10) { + if (values.adminMultisig && values.adminMultisig.signers?.length <= 10) { push('') } }} @@ -103,19 +144,19 @@ export const PoolSetupSection = () => { - + {({ field, meta, form }: FieldProps) => (