Skip to content

Commit

Permalink
Stop settings dialog resizing when clicking "Add contact"
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed May 24, 2024
1 parent 67dcf59 commit 89dcafd
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 89dcafd

Please sign in to comment.