Skip to content

Commit

Permalink
fix: only allow action bar button when at least one account is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
lfelipessilva committed Sep 10, 2024
1 parent 19a8e0f commit 9ca6afc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
10 changes: 7 additions & 3 deletions src/pages/home/components/ActionBar/ActionBar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@

justify-content: center;

background-color: $secondaryPurple;
background: $secondaryPurple;

border-radius: 50%;

.arrowIcon {
color: $primaryWhite;
&:disabled {
background: #1d1b201f;
}
}

.arrowIcon {
color: $primaryWhite;
}

.submit {
max-width: max-content;

Expand Down
15 changes: 11 additions & 4 deletions src/pages/home/components/ActionBar/ActionBar.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import { ReactNode } from 'react';

import { useAccountStore } from '~stores/useAccountStore/useAccountStore';

import Button from '~components/Button/Button';
import Icon from '~components/Icon/Icon';

import scss from './ActionBar.module.scss';

function ActionBar(): ReactNode {
const { accounts } = useAccountStore();

return (
<div className={scss.container}>
<div className={scss.composeContainer}>
<Icon className={scss.closeIcon} icon="close" size={14} />
<p className={scss.composeLabel}>Compose</p>
</div>
<button className={scss.navigationIconContainer}>
<Icon className={scss.arrowIcon} icon="arrow-right" size={12} />
</button>

<Button
circle
className={scss.navigationIconContainer}
color="secondary"
disabled={accounts.length === 0}
icon={<Icon className={scss.arrowIcon} icon="arrow-right" size={12} />}
/>
<Button className={scss.submit} variant="container">
Postar
</Button>
Expand Down

0 comments on commit 9ca6afc

Please sign in to comment.