Skip to content

Commit

Permalink
Fix clipped input buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
DarksightKellar committed Apr 29, 2024
1 parent f1ff142 commit dc3b51e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
36 changes: 27 additions & 9 deletions src/components/ProposalBuilder/ProposalTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ export default function ProposalTransaction({
return (
<VStack
align="left"
spacing={4}
px="1.5rem"
mt={6}
>
{/* TRANSACTION TARGET ADDRESS */}
<InputComponent
label={t('labelTargetAddress')}
helper={t('helperTargetAddress')}
Expand Down Expand Up @@ -97,7 +98,10 @@ export default function ProposalTransaction({
/>
</Box>
)}

<Divider my="1.5rem" />

{/* FUNCTION SPECIFICATION */}
<Box>
<Text
textStyle="display-lg"
Expand Down Expand Up @@ -125,7 +129,9 @@ export default function ProposalTransaction({
testId="transaction.functionName"
/>
</Box>
<Box>

{/* TRANSACTION PARAMETERS LIST */}
<Box mt="1.5rem">
<Accordion
allowMultiple
index={expandedIndecies}
Expand All @@ -138,11 +144,17 @@ export default function ProposalTransaction({
padding="1rem"
borderRadius={4}
bg="neutral-3"
px={0}
py="1.5rem"
>
{({ isExpanded }) => (
<>
<Box>
<HStack justify="space-between">
{/* TRANSACTION PARAMETER HEADER */}
<HStack
px="1.5rem"
justify="space-between"
>
<AccordionButton
onClick={() => {
setExpandedIndecies(indexArray => {
Expand All @@ -169,6 +181,8 @@ export default function ProposalTransaction({
</Flex>
</Text>
</AccordionButton>

{/* Remove parameter button */}
{i !== 0 || transaction.parameters.length !== 1 ? (
<IconButton
icon={<MinusCircle />}
Expand All @@ -193,12 +207,11 @@ export default function ProposalTransaction({
<Box h="2.25rem" />
)}
</HStack>

{/* TRANSACTION PARAMETER SECTION */}
<AccordionPanel p={0}>
<Flex
gap={2}
mt={6}
>
<Box>
<Flex mt="1rem">
<Box px="1.5rem">
<InputComponent
label={t('labelFunctionParameter', { ns: 'proposalTemplate' })}
helper={t('helperFunctionParameter', { ns: 'proposalTemplate' })}
Expand Down Expand Up @@ -362,12 +375,15 @@ export default function ProposalTransaction({
</Flex>
</AccordionPanel>
</Box>

{!isExpanded && (
<Divider
variant="light"
mt="0.5rem"
/>
)}

{/* ADD PARAMETER BUTTON */}
{i === transaction.parameters.length - 1 && (
<Button
onClick={() => {
Expand All @@ -380,8 +396,8 @@ export default function ProposalTransaction({
}}
variant="text"
color="celery-0"
padding="0.25rem 0.75rem"
mt={1}
mx="1.5rem"
gap="0.25rem"
borderRadius="625rem"
borderColor="transparent"
Expand All @@ -398,6 +414,8 @@ export default function ProposalTransaction({
</AccordionItem>
))}
</Accordion>

{/* ETH VALUE */}
<Box mt={6}>
<BigIntComponent
label={t('labelEthValue')}
Expand Down
16 changes: 8 additions & 8 deletions src/components/ProposalBuilder/ProposalTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ export default function ProposalTransactions({
key={index}
borderTop="none"
borderBottom="none"
my="1.5rem"
>
{({ isExpanded }) => (
<Box
borderRadius={4}
p={3}
my="2"
>
<HStack justify="space-between">
<Box borderRadius={4}>
{/* TRANSACTION HEADER */}
<HStack
px="1.5rem"
justify="space-between"
>
<AccordionButton
onClick={() => {
setExpandedIndecies(indexArray => {
Expand All @@ -82,7 +81,7 @@ export default function ProposalTransactions({
}
});
}}
p={0}
p="0.25rem"
textStyle="display-lg"
color="lilac-0"
>
Expand Down Expand Up @@ -112,6 +111,7 @@ export default function ProposalTransactions({
<Box h="2.25rem" />
)}
</HStack>

<AccordionPanel p={0}>
<ProposalTransaction
transaction={transactions[index] as CreateProposalTransaction}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProposalBuilder/ProposalTransactionsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function ProposalTransactionsForm(props: ProposalTransactionsForm
}, [safeNonce, setFieldValue]);

return (
<Box>
<Box py="1.5rem">
<ProposalTransactions
expandedIndecies={expandedIndecies}
setExpandedIndecies={setExpandedIndecies}
Expand All @@ -49,7 +49,7 @@ export default function ProposalTransactionsForm(props: ProposalTransactionsForm
disabled={pendingTransaction}
w="fit-content"
color="celery-0"
padding="0.25rem 0.75rem"
mx="1.5rem"
gap="0.25rem"
borderRadius="625rem"
borderColor="transparent"
Expand Down
1 change: 0 additions & 1 deletion src/components/ProposalBuilder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export function ProposalBuilder({
<Box
marginBottom="2rem"
rounded="lg"
p="1.5rem"
bg="neutral-2"
>
{formState === CreateProposalState.METADATA_FORM ? (
Expand Down

0 comments on commit dc3b51e

Please sign in to comment.