Skip to content

Commit

Permalink
Add jay's feedback and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Dec 13, 2024
1 parent bc1c277 commit 60e8383
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const PoolDetailsSection = () => {
{({ field, meta, form }: FieldProps) => (
<FieldWithErrorMessage
name="issuerShortDescription"
label="Landing page description (50-100 characters)"
label="Landing page description (50-100 characters)*"
onChange={(event: any) => form.setFieldValue('issuerShortDescription', event.target.value)}
onBlur={field.onBlur}
errorMessage={meta.touched && meta.error ? meta.error : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const PoolSetupSection = () => {
useEffect(() => {
form.setFieldValue('adminMultisig.signers[0]', selectedAccount?.address)
}, [])

Check warning on line 69 in centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx

View workflow job for this annotation

GitHub Actions / build-app

React Hook useEffect has missing dependencies: 'form' and 'selectedAccount?.address'. Either include them or remove the dependency array

Check warning on line 69 in centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook useEffect has missing dependencies: 'form' and 'selectedAccount?.address'. Either include them or remove the dependency array

console.log(values)
return (
<Box>
<Text variant="heading2" fontWeight={700}>
Expand Down Expand Up @@ -209,10 +209,10 @@ export const PoolSetupSection = () => {
<Text color="textSecondary" variant="body3">
Add or remove addresses that can:
</Text>
<Text variant="heading2">Originate assets and invest in the pool*</Text>
<Text variant="heading2">Originate assets and invest in the pool</Text>
{values.assetOriginators?.map((_: string, index: number) => (
<Box key={index} mt={2}>
<Field name={`assetOriginators.${index}`} validate={validate.addressValidate}>
<Field name={`assetOriginators.${index}`}>
{() => (
<FormAddressInput
name={`assetOriginators.${index}`}
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/src/pages/IssuerCreatePool/TrancheInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function TrancheInput({
{...field}
label={<Tooltips type="minimumInvestment" label="Min. investment*" />}
placeholder="0.00"
currency={values.currency}
currency={values.assetDenomination}
errorMessage={meta.touched ? meta.error : undefined}
onChange={(value) => form.setFieldValue(field.name, value)}
onBlur={() => form.setFieldTouched(field.name, true)}
Expand Down
3 changes: 1 addition & 2 deletions centrifuge-app/src/pages/IssuerCreatePool/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FeeTypes, PoolMetadataInput } from '@centrifuge/centrifuge-js'
import { isTestEnv } from '../../config'

export interface Tranche {
tokenName: string
Expand Down Expand Up @@ -91,7 +90,7 @@ export const initialValues: CreatePoolValues = {
// pool structure
poolStructure: 'revolving',
assetClass: 'Private credit',
assetDenomination: isTestEnv ? 'USDC' : 'Native USDC',
assetDenomination: 'USDC',
subAssetClass: '',
tranches: [createEmptyTranche('Junior')],

Expand Down
16 changes: 0 additions & 16 deletions centrifuge-app/src/pages/IssuerCreatePool/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export const validateValues = (values: CreatePoolValues) => {

if (values.issuerCategories.length > 1) {
values.issuerCategories.forEach((category, i) => {
console.log(category)
if (category.type === '') {
errors = setIn(errors, `issuerCategories.${i}.type`, 'Type is required')
}
Expand All @@ -117,7 +116,6 @@ export const validateValues = (values: CreatePoolValues) => {

if (values.poolRatings.length > 1) {
values.poolRatings.forEach((rating, i) => {
console.log(rating)
if (rating.agency === '') {
errors = setIn(errors, `poolRatings.${i}.agency`, 'Field is required')
}
Expand All @@ -133,14 +131,6 @@ export const validateValues = (values: CreatePoolValues) => {
})
}

if (values.adminMultisigEnabled) {
values.adminMultisig.signers.forEach((signer, i) => {
if (!isSubstrateAddress(signer) && signer !== '') {
errors = setIn(errors, `adminMultisig.signers.${i}`, 'Invalid address')
}
})
}

values.poolFees.forEach((fee, i) => {
if (fee.name === '' && i !== 0) {
errors = setIn(errors, `poolFees.${i}.name`, 'Name is required')
Expand All @@ -156,12 +146,6 @@ export const validateValues = (values: CreatePoolValues) => {
}
})

values.assetOriginators.forEach((asset, i) => {
if (!isSubstrateAddress(asset) && asset !== '') {
errors = setIn(errors, `assetOriginators.${i}`, 'Invalid address')
}
})

values.tranches.forEach((t, i) => {
if (tokenNames.has(t.tokenName)) {
errors = setIn(errors, `tranches.${i}.tokenName`, 'Tranche names must be unique')
Expand Down

0 comments on commit 60e8383

Please sign in to comment.