Skip to content

Commit

Permalink
Merge pull request #1950 from oasisprotocol/lw/add-contact-dialog-size
Browse files Browse the repository at this point in the history
Stop settings dialog resizing when clicking "Add contact"
  • Loading branch information
lukaw3d authored May 24, 2024
2 parents e1da102 + 7205d71 commit ed7629e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions .changelog/1950.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop settings dialog resizing when clicking "Add contact"
42 changes: 22 additions & 20 deletions src/app/components/Toolbar/Features/Contacts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,29 @@ export const Contacts = ({ closeHandler }: ContactsProps) => {
}

return (
<Box flex="grow" justify="between" gap="medium">
{!contacts.length && (
<ContactsListEmptyState>
{t('toolbar.contacts.emptyList', 'You have no contacts yet.')}
</ContactsListEmptyState>
)}
{!!contacts.length && (
<ScrollableContainer>
{contacts.map(contact => (
<ContactAccount key={contact.address} contact={contact} />
))}
</ScrollableContainer>
)}
<Box align="end">
<Button
primary
label={t('toolbar.contacts.add', 'Add contact')}
onClick={() => setLayerVisibility(true)}
/>
<>
<Box flex="grow" justify="between" gap="medium">
{!contacts.length && (
<ContactsListEmptyState>
{t('toolbar.contacts.emptyList', 'You have no contacts yet.')}
</ContactsListEmptyState>
)}
{!!contacts.length && (
<ScrollableContainer>
{contacts.map(contact => (
<ContactAccount key={contact.address} contact={contact} />
))}
</ScrollableContainer>
)}
<Box align="end">
<Button
primary
label={t('toolbar.contacts.add', 'Add contact')}
onClick={() => setLayerVisibility(true)}
/>
</Box>
</Box>
{layerVisibility && <AddContact setLayerVisibility={setLayerVisibility} />}
</Box>
</>
)
}

0 comments on commit ed7629e

Please sign in to comment.