mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 08:54:13 +00:00
feat: add countdown timer button
This commit is contained in:
parent
7cb0f1c752
commit
5f066a4eff
5 changed files with 24 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { FiExternalLink } from 'react-icons/fi/index';
|
||||||
import { Item as DropdownItem } from '@radix-ui/react-dropdown-menu';
|
import { Item as DropdownItem } from '@radix-ui/react-dropdown-menu';
|
||||||
|
|
||||||
import styles from './item.module.css';
|
import styles from './item.module.css';
|
||||||
|
|
@ -37,6 +38,12 @@ export function Item({
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{shortcut && <span className={styles.shortcut}>{shortcut}</span>}
|
{shortcut && <span className={styles.shortcut}>{shortcut}</span>}
|
||||||
|
|
||||||
|
{href && (
|
||||||
|
<span className={styles.external}>
|
||||||
|
<FiExternalLink />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</Comp>
|
</Comp>
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
13
src/components/menu/items/countdown-timer.tsx
Normal file
13
src/components/menu/items/countdown-timer.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { MdOutlineTimer } from 'react-icons/md/index';
|
||||||
|
|
||||||
|
import { Item } from '../item';
|
||||||
|
|
||||||
|
export function CountdownTimer() {
|
||||||
|
return (
|
||||||
|
<Item
|
||||||
|
href="https://timesy.app"
|
||||||
|
icon={<MdOutlineTimer />}
|
||||||
|
label="Countdown Timer"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -7,3 +7,4 @@ export { Pomodoro as PomodoroItem } from './pomodoro';
|
||||||
export { Presets as PresetsItem } from './presets';
|
export { Presets as PresetsItem } from './presets';
|
||||||
export { Shortcuts as ShortcutsItem } from './shortcuts';
|
export { Shortcuts as ShortcutsItem } from './shortcuts';
|
||||||
export { SleepTimer as SleepTimerItem } from './sleep-timer';
|
export { SleepTimer as SleepTimerItem } from './sleep-timer';
|
||||||
|
export { CountdownTimer as CountdownTimerItem } from './countdown-timer';
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export function SleepTimer({ open }: SleepTimerProps) {
|
||||||
return (
|
return (
|
||||||
<Item
|
<Item
|
||||||
icon={<IoMoonSharp />}
|
icon={<IoMoonSharp />}
|
||||||
label="Sleep timer"
|
label="Sleep Timer"
|
||||||
shortcut="Shift + T"
|
shortcut="Shift + T"
|
||||||
onClick={open}
|
onClick={open}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import {
|
||||||
PresetsItem,
|
PresetsItem,
|
||||||
ShortcutsItem,
|
ShortcutsItem,
|
||||||
SleepTimerItem,
|
SleepTimerItem,
|
||||||
|
CountdownTimerItem,
|
||||||
} from './items';
|
} from './items';
|
||||||
import { Divider } from './divider';
|
import { Divider } from './divider';
|
||||||
import { ShareLinkModal } from '@/components/modals/share-link';
|
import { ShareLinkModal } from '@/components/modals/share-link';
|
||||||
|
|
@ -110,6 +111,7 @@ export function Menu() {
|
||||||
<Divider />
|
<Divider />
|
||||||
<NotepadItem open={() => open('notepad')} />
|
<NotepadItem open={() => open('notepad')} />
|
||||||
<PomodoroItem open={() => open('pomodoro')} />
|
<PomodoroItem open={() => open('pomodoro')} />
|
||||||
|
<CountdownTimerItem />
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
<ShortcutsItem open={() => open('shortcuts')} />
|
<ShortcutsItem open={() => open('shortcuts')} />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue