mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-19 22:19:49 -04:00
* move tooltip into portal * Update navigation * Switch to useMatch * browser router * routing * Hide nav buttons on web * Include traffic lights and change icon
36 lines
905 B
TypeScript
36 lines
905 B
TypeScript
import { ArrowLeft, ArrowRight } from 'phosphor-react';
|
|
import { useNavigate } from 'react-router';
|
|
import { Button, Tooltip } from '@sd/ui';
|
|
import { useSearchStore } from '~/hooks/useSearchStore';
|
|
|
|
export default () => {
|
|
const navigate = useNavigate();
|
|
const { isFocused } = useSearchStore();
|
|
const idx = history.state.idx as number;
|
|
|
|
return (
|
|
<div className="flex">
|
|
<Tooltip label="Navigate back">
|
|
<Button
|
|
size="icon"
|
|
className="text-[14px] text-ink-dull"
|
|
onClick={() => navigate(-1)}
|
|
disabled={isFocused || idx === 0}
|
|
>
|
|
<ArrowLeft weight="bold" />
|
|
</Button>
|
|
</Tooltip>
|
|
<Tooltip label="Navigate forward">
|
|
<Button
|
|
size="icon"
|
|
className="text-[14px] text-ink-dull"
|
|
onClick={() => navigate(1)}
|
|
disabled={isFocused || idx === history.length - 1}
|
|
>
|
|
<ArrowRight weight="bold" />
|
|
</Button>
|
|
</Tooltip>
|
|
</div>
|
|
);
|
|
};
|