Skip to content

Commit

Permalink
fix: normalize "start/stop slideshow" links
Browse files Browse the repository at this point in the history
  • Loading branch information
Azganoth committed Aug 13, 2023
1 parent 9a0c0fb commit d5e1b96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/_components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import styles from './Header.module.css';
import Link from 'next/link';
import Logo from '@/_assets/logo.svg';
import normalizeUrl from '../_utils/normalizeUrl';

export default function Header({ action }: { action: 'start' | 'stop' }) {
const canStop = action === 'stop';

return (
<header className={styles.header}>
<Logo className={styles.logo} />
<a className={styles.slidershow} href={canStop ? '/' : '/starry-night'}>
<a
className={styles.slidershow}
href={normalizeUrl(canStop ? '/' : '/starry-night')}
>
{canStop ? 'Stop' : 'Start'} slideshow
</a>
</header>
Expand Down

0 comments on commit d5e1b96

Please sign in to comment.