Skip to content

Commit

Permalink
chore: 🔧 home button optional on header
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed Jun 7, 2020
1 parent 786d88f commit db91699
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layouts/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const Header = () => {
const [open, setOpen] = useState(false);
const { connected } = useStatusState();

const showHomeButton = (): boolean =>
pathname === TRADER || pathname === CHAT || pathname === SETTINGS;

const transitions = useTransition(open, null, {
from: { position: 'absolute', opacity: 0 },
enter: { opacity: 1 },
Expand Down Expand Up @@ -71,7 +74,7 @@ export const Header = () => {
</ViewSwitch>
<ViewSwitch hideMobile={true}>
<HeaderButtons>
{renderNavButton(HOME, Home)}
{showHomeButton() && renderNavButton(HOME, Home)}
{renderNavButton(TRADER, CreditCard)}
{renderNavButton(CHAT, MessageCircle)}
{renderNavButton(SETTINGS, Settings)}
Expand Down

0 comments on commit db91699

Please sign in to comment.