-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix report url and clean up pre edit view * Add pool structure, fix pool name in tranche edit, fix targetAPY,
- Loading branch information
1 parent
4806f75
commit 70aa42c
Showing
9 changed files
with
242 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
centrifuge-app/src/pages/IssuerCreatePool/PoolRatingInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Grid, Stack, Text, TextInput } from '@centrifuge/fabric' | ||
import { FieldWithErrorMessage } from '../../components/FieldWithErrorMessage' | ||
|
||
export function PoolRatingInput() { | ||
return ( | ||
<Stack gap={2}> | ||
<Text variant="heading2">Pool rating</Text> | ||
<Grid columns={[1, 2]} equalColumns gap={2} rowGap={3}> | ||
<FieldWithErrorMessage name="ratingAgency" as={TextInput} label="Rating agency" placeholder="Agency Name..." /> | ||
<FieldWithErrorMessage name="ratingValue" as={TextInput} label="Rating" placeholder="Rating value..." /> | ||
<FieldWithErrorMessage | ||
name="ratingReportUrl" | ||
as={TextInput} | ||
label="Rating report URL" | ||
placeholder="https://..." | ||
/> | ||
</Grid> | ||
</Stack> | ||
) | ||
} |
88 changes: 44 additions & 44 deletions
88
centrifuge-app/src/pages/IssuerCreatePool/PoolReportsInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
import { FileUpload, Grid, TextInput } from '@centrifuge/fabric' | ||
import { FileUpload, Grid, Stack, Text, TextInput } from '@centrifuge/fabric' | ||
import { Field, FieldProps } from 'formik' | ||
import { FieldWithErrorMessage } from '../../components/FieldWithErrorMessage' | ||
import { combineAsync, imageFile, maxFileSize, maxImageSize } from '../../utils/validation' | ||
import { validate } from './validate' | ||
|
||
export function PoolReportsInput() { | ||
return ( | ||
<Grid columns={[1, 2]} equalColumns gap={2} rowGap={3}> | ||
<FieldWithErrorMessage | ||
name="reportUrl" | ||
as={TextInput} | ||
label="Report URL" | ||
placeholder="https://..." | ||
validate={validate.websiteNotRequired} | ||
/> | ||
<FieldWithErrorMessage | ||
name="reportAuthorName" | ||
as={TextInput} | ||
label="Reviewer name" | ||
placeholder="Name..." | ||
maxLength={100} | ||
/> | ||
<FieldWithErrorMessage | ||
name="reportAuthorTitle" | ||
as={TextInput} | ||
label="Reviewer job title" | ||
placeholder="Title..." | ||
maxLength={100} | ||
/> | ||
<Field | ||
name="reportAuthorAvatar" | ||
validate={combineAsync(imageFile(), maxFileSize(1024 ** 2), maxImageSize(200, 200))} | ||
> | ||
{({ field, meta, form }: FieldProps) => ( | ||
<FileUpload | ||
file={field.value} | ||
onFileChange={(file) => { | ||
form.setFieldTouched('reportAuthorAvatar', true, false) | ||
form.setFieldValue('reportAuthorAvatar', file) | ||
}} | ||
label="Reviewer avatar (JPG/PNG/SVG, max 40x40px)" | ||
errorMessage={meta.touched && meta.error ? meta.error : undefined} | ||
accept="image/*" | ||
/> | ||
)} | ||
</Field> | ||
<FieldWithErrorMessage name="ratingAgency" as={TextInput} label="Rating agency" placeholder="Agency Name..." /> | ||
<FieldWithErrorMessage name="ratingValue" as={TextInput} label="Rating" placeholder="Rating value..." /> | ||
<FieldWithErrorMessage name="ratingReport" as={TextInput} label="Rating report URL" placeholder="https://..." /> | ||
</Grid> | ||
<Stack gap={2}> | ||
<Text variant="heading2">Pool analysis</Text> | ||
<Grid columns={[1, 2]} equalColumns gap={2} rowGap={3}> | ||
<FieldWithErrorMessage | ||
name="reportUrl" | ||
as={TextInput} | ||
label="Report URL" | ||
placeholder="https://..." | ||
validate={validate.websiteNotRequired} | ||
/> | ||
<FieldWithErrorMessage | ||
name="reportAuthorName" | ||
as={TextInput} | ||
label="Reviewer name" | ||
placeholder="Name..." | ||
maxLength={100} | ||
/> | ||
<FieldWithErrorMessage | ||
name="reportAuthorTitle" | ||
as={TextInput} | ||
label="Reviewer job title" | ||
placeholder="Title..." | ||
maxLength={100} | ||
/> | ||
<Field | ||
name="reportAuthorAvatar" | ||
validate={combineAsync(imageFile(), maxFileSize(1024 ** 2), maxImageSize(200, 200))} | ||
> | ||
{({ field, meta, form }: FieldProps) => ( | ||
<FileUpload | ||
file={field.value} | ||
onFileChange={(file) => { | ||
form.setFieldTouched('reportAuthorAvatar', true, false) | ||
form.setFieldValue('reportAuthorAvatar', file) | ||
}} | ||
label="Reviewer avatar (JPG/PNG/SVG, max 40x40px)" | ||
errorMessage={meta.touched && meta.error ? meta.error : undefined} | ||
accept="image/*" | ||
/> | ||
)} | ||
</Field> | ||
</Grid> | ||
</Stack> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.