Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide reset button on Playground, it doesn't make sense there #149

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions src/client/components/common/MobileNavbar/MobileNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,29 @@ interface MobileNavbarProps {
closeMobileMenu: () => void;
}
export default function MobileNavbar({ darkMode, closeMobileMenu }: MobileNavbarProps) {
const { mutate, isLoading: isResetLoading } = useReset({});
const { mutate, isLoading: isResetLoading, shouldDisplayResetButton } = useReset({});

return (
<nav className={classNames(styles.nav, { [styles.darkNavHeader]: darkMode })}>
<div className={styles.container}>
<div className={classNames(styles.links, styles.top)}>
<Button
className={classNames(styles.resetButton, isResetLoading && styles.loading)}
onClick={() => mutate()}
variant='primary'
outlined
disabled={isResetLoading}
size={'medium'}
title='Click Restart to remove all information obtained from this browser. This will reenable some scenarios for you if you were locked out of a specific action.'
buttonId='click_top_nav_restart'
data-testid={TEST_IDS.reset.resetButton}
>
Restart
<Image src={Restart} alt='Restart button' />
</Button>
</div>
{shouldDisplayResetButton ? (
<div className={classNames(styles.links, styles.top)}>
<Button
className={classNames(styles.resetButton, isResetLoading && styles.loading)}
onClick={() => mutate()}
variant='primary'
outlined
disabled={isResetLoading}
size={'medium'}
title='Click Restart to remove all information obtained from this browser. This will reenable some scenarios for you if you were locked out of a specific action.'
buttonId='click_top_nav_restart'
data-testid={TEST_IDS.reset.resetButton}
>
Restart
<Image src={Restart} alt='Restart button' />
</Button>
</div>
) : null}
<div className={classNames(styles.links, styles.top)}>
<Button
href={URL.contactSales}
Expand Down
Loading