Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create pool QA #2563

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@
const chainId = useCentEvmChainId()
const form = useFormikContext<CreatePoolValues>()
const { values } = form
const { selectedAccount } = useWallet().substrate
const {
substrate: { selectedAddress },
} = useWallet()

useEffect(() => {
form.setFieldValue('adminMultisig.signers[0]', selectedAccount?.address)
form.setFieldValue('adminMultisig.signers[0]', selectedAddress)
}, [])

Check warning on line 71 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 'selectedAddress'. Either include them or remove the dependency array

Check warning on line 71 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 'selectedAddress'. Either include them or remove the dependency array
console.log(values)

return (
<Box>
<Text variant="heading2" fontWeight={700}>
Expand All @@ -89,6 +91,7 @@
icon={<IconHelpCircle size="iconSmall" color={theme.colors.textSecondary} />}
onChange={() => {
form.setFieldValue('adminMultisigEnabled', false)
form.setFieldValue('adminMultisig.signers', [selectedAddress])
}}
isChecked={!values.adminMultisigEnabled}
id="singleMultisign"
Expand Down Expand Up @@ -280,7 +283,7 @@
{({ push, remove }) => (
<>
{values.poolFees.map((_, index) => {
if (index === 0) return

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

View workflow job for this annotation

GitHub Actions / build-app

Array.prototype.map() expects a return value from arrow function

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

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

Array.prototype.map() expects a return value from arrow function
return (
<Box mt={4} mb={3} key={index}>
<StyledGrid mt={3} gap={1}>
Expand Down Expand Up @@ -308,7 +311,10 @@
onBlur={field.onBlur}
errorMessage={meta.touched && meta.error ? meta.error : undefined}
value={field.value}
options={feeCategories.map((cat) => ({ label: cat, value: cat }))}
options={[
{ label: 'Please select', value: '' },
...feeCategories.map((cat) => ({ label: cat, value: cat })),
]}
/>
)}
</Field>
Expand Down
11 changes: 9 additions & 2 deletions centrifuge-app/src/pages/IssuerCreatePool/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
const IssuerCreatePoolPage = () => {
const theme = useTheme()
const formRef = useRef<HTMLFormElement>(null)
const containerRef = useRef<HTMLDivElement>(null)
const isSmall = useIsAboveBreakpoint('S')
const address = useAddress('substrate')
const navigate = useNavigate()
Expand Down Expand Up @@ -127,7 +128,7 @@
// It can take a second for the new data to come in after creating the pool
navigate(`/issuer/${poolId}`)
}
}, [poolId, pools])

Check warning on line 131 in centrifuge-app/src/pages/IssuerCreatePool/index.tsx

View workflow job for this annotation

GitHub Actions / build-app

React Hook useEffect has a missing dependency: 'navigate'. Either include it or remove the dependency array

Check warning on line 131 in centrifuge-app/src/pages/IssuerCreatePool/index.tsx

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook useEffect has a missing dependency: 'navigate'. Either include it or remove the dependency array

const { execute: createProxies, isLoading: createProxiesIsPending } = useCentrifugeTransaction(
`${txMessage[createType]} 1/2`,
Expand Down Expand Up @@ -449,10 +450,16 @@
...prev,
[step]: checkStepCompletion(step),
}))
}, [values, errors, step, stepFields])

Check warning on line 453 in centrifuge-app/src/pages/IssuerCreatePool/index.tsx

View workflow job for this annotation

GitHub Actions / build-app

React Hook useEffect has a missing dependency: 'checkStepCompletion'. Either include it or remove the dependency array. Outer scope values like 'stepFields' aren't valid dependencies because mutating them doesn't re-render the component

Check warning on line 453 in centrifuge-app/src/pages/IssuerCreatePool/index.tsx

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook useEffect has a missing dependency: 'checkStepCompletion'. Either include it or remove the dependency array. Outer scope values like 'stepFields' aren't valid dependencies because mutating them doesn't re-render the component

useEffect(() => {
if (containerRef.current) {
containerRef.current.scrollTo({ top: 0, behavior: 'smooth' })
}
}, [step, containerRef])

return (
<>
<div ref={containerRef} style={{ maxHeight: '100vh', overflowY: 'auto' }}>
<PreimageHashDialog
preimageHash={preimageHash}
open={isPreimageDialogOpen}
Expand Down Expand Up @@ -540,7 +547,7 @@
</Box>
</Dialog>
)}
</>
</div>
)
}

Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/src/pages/IssuerCreatePool/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const createEmptyTranche = (trancheName: string): Tranche => ({
interestRate: 0,
minRiskBuffer: trancheName === 'Junior' ? '' : 0,
minInvestment: 1000,
apy: '90d',
apy: 'target',
apyPercentage: null,
})

Expand Down
Loading