Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsayo committed Dec 9, 2024
2 parents c96ccee + f19e204 commit b3f1533
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export const EscrowFormSchema = yup
.required('Safety valve date is required.')
.min(
new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
'Safety valve date must be at least 30 days from today.'
'Safety valve date must be at least 30 days from today or the last milestone whichever is later.'
)
.test(
'after-last-milestone',
'Safety valve date must be at least 30 days after the last milestone date',
'Safety valve date must be at least 30 days after the last milestone date.',
function (value) {
const milestones = (this.parent.milestones || []) as Milestone[]
if (milestones.length === 0) return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ const MilestoneForm: React.FC<{
formik={formik}
id={`milestones.${index}.description`}
value={formik.values?.milestones[index]?.description}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
inputLabel="Description"
placeholder={'Milestone description is highly encouraged'}
/>
Expand Down Expand Up @@ -183,7 +181,7 @@ const EscrowForm: React.FC<EscrowFormProps> = ({
{...formik.getFieldProps('recipientAddress')}
id="recipientAddress"
inputLabel={'Recipient'}
placeholder={'0x... or .eth'}
placeholder={'0x...'}
isAddress={true}
errorMessage={
formik.touched.recipientAddress && formik.errors.recipientAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ export const MilestoneDetails: React.FC<MilestoneDetailsProps> = ({
{milestone.documents?.map((doc, index) => renderDocumentLink(doc))}
</Stack>

{executionTransactionHash && renderMilestoneButton(index, isReleased, isNext)}
{!!executionTransactionHash &&
renderMilestoneButton(index, isReleased, isNext)}
</Stack>
),
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Flex, Paragraph, atoms } from '@zoralabs/zord'
import { Box, Flex, Paragraph, Text, atoms } from '@zoralabs/zord'
import { useEffect } from 'hono/jsx'
import { toLower } from 'lodash'
import Image from 'next/image'
Expand Down Expand Up @@ -53,6 +53,7 @@ export const ProposalDescription: React.FC<ProposalDescriptionProps> = ({
}) => {
const { description, proposer, calldatas, values, targets, executionTransactionHash } =
proposal

const { displayName } = useEnsData(proposer)
const chain = useChainStore((x) => x.chain)

Expand Down Expand Up @@ -96,12 +97,19 @@ export const ProposalDescription: React.FC<ProposalDescriptionProps> = ({
)}
</Paragraph>
</Section>

{isEscrow && decodedTxnData && (
<Section title="Escrow Milestones">
<MilestoneDetails
decodedTxnData={decodedTxnData}
executionTransactionHash={executionTransactionHash}
/>
{executionTransactionHash ? (
<MilestoneDetails
decodedTxnData={decodedTxnData}
executionTransactionHash={executionTransactionHash}
/>
) : !decodedTxnData?._escrowData?.value ? (
<Text variant="code" color="negative">
Error Decoding Escrow Milestones
</Text>
) : null}
</Section>
)}

Expand Down

0 comments on commit b3f1533

Please sign in to comment.