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

Pool structure - create pool #2543

Merged
merged 5 commits into from
Nov 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion centrifuge-app/src/components/PoolCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function PoolCard({
}
})
.reverse()
}, [isTinlakePool, metaData?.tranches, tinlakeKey, tranches])
}, [isTinlakePool, metaData?.tranches, tinlakeKey, tranches, createdAt, poolId])

return (
<RouterTextLink to={`${poolId}`} style={{ textDecoration: 'none' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ export const TrancheTokenCards = ({
return 'mezzanine'
}

const getTarget = (tranche: Token) =>
(isTinlakePool && tranche.seniority === 0) || poolId === DYF_POOL_ID || poolId === NS3_POOL_ID

const columns = useMemo(() => {
return [
{
Expand Down Expand Up @@ -121,6 +118,8 @@ export const TrancheTokenCards = ({
}, [pool.tranches, metadata, poolId, pool?.currency.symbol])

const dataTable = useMemo(() => {
const getTarget = (tranche: Token) =>
(isTinlakePool && tranche.seniority === 0) || poolId === DYF_POOL_ID || poolId === NS3_POOL_ID
return trancheTokens.map((tranche) => {
const calculateApy = (trancheToken: Token) => {
if (isTinlakePool && getTrancheText(trancheToken) === 'senior') return formatPercentage(trancheToken.apy)
Expand All @@ -145,7 +144,7 @@ export const TrancheTokenCards = ({
isTarget: getTarget(tranche),
}
})
}, [trancheTokens, getTarget])
}, [trancheTokens, daysSinceCreation, isTinlakePool, poolId])

return (
<Shelf gap={3}>
Expand Down
20 changes: 20 additions & 0 deletions centrifuge-app/src/components/Tooltips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
17 changes: 12 additions & 5 deletions centrifuge-app/src/pages/IssuerCreatePool/IssuerCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ const PROVIDERS = [
{ label: 'Other', value: 'other' },
]

const LabelWithDeleteButton = ({ onDelete }: { onDelete: () => void }) => {
const LabelWithDeleteButton = ({ onDelete, hideButton }: { onDelete: () => void; hideButton: boolean }) => {
return (
<Box display="flex" justifyContent="space-between" alignItems="center">
<Text variant="heading4">Name of provider</Text>
<IconButton onClick={onDelete}>
<IconTrash color="textSecondary" />
</IconButton>
{!hideButton && (
<IconButton onClick={onDelete}>
<IconTrash color="textSecondary" />
</IconButton>
)}
</Box>
)
}
Expand Down Expand Up @@ -56,7 +58,12 @@ export const IssuerCategoriesSection = () => {
{({ field, meta }: FieldProps) => (
<TextInput
{...field}
label={<LabelWithDeleteButton onDelete={() => remove(index)} />}
label={
<LabelWithDeleteButton
onDelete={() => remove(index)}
hideButton={form.values.issuerCategories.length === 1}
/>
}
placeholder="Type here..."
maxLength={100}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
TextInput,
} from '@centrifuge/fabric'
import { Field, FieldProps, useFormikContext } from 'formik'
import { useTheme } from 'styled-components'
import { FieldWithErrorMessage } from '../../../src/components/FieldWithErrorMessage'
import { Tooltips } from '../../../src/components/Tooltips'
import { isTestEnv } from '../../../src/config'
Expand All @@ -27,7 +26,6 @@ export const AddButton = ({ onClick }: { onClick: () => void }) => (
)

export const PoolDetailsSection = () => {
const theme = useTheme()
const form = useFormikContext<PoolMetadataInput>()
const createLabel = (label: string) => `${label}${isTestEnv ? '' : '*'}`

Expand Down
Loading
Loading