refactor: rename components

This commit is contained in:
MAZE 2024-06-16 18:47:57 +04:30
parent c5657d0642
commit d73b2bc1ff
9 changed files with 17 additions and 14 deletions

View file

@ -6,7 +6,7 @@ interface SleepTimerProps {
open: () => void;
}
export function Timer({ open }: SleepTimerProps) {
export function CountdownTimer({ open }: SleepTimerProps) {
return (
<Item
icon={<MdOutlineTimer />}

View file

@ -7,4 +7,4 @@ export { Pomodoro as PomodoroItem } from './pomodoro';
export { Presets as PresetsItem } from './presets';
export { Shortcuts as ShortcutsItem } from './shortcuts';
export { SleepTimer as SleepTimerItem } from './sleep-timer';
export { Timer as TimerItem } from './timer';
export { CountdownTimer as CountdownTimerItem } from './countdown-timer';

View file

@ -11,7 +11,7 @@ import {
NotepadItem,
SourceItem,
PomodoroItem,
TimerItem,
CountdownTimerItem,
PresetsItem,
ShortcutsItem,
SleepTimerItem,
@ -21,7 +21,7 @@ import { ShareLinkModal } from '@/components/modals/share-link';
import { PresetsModal } from '@/components/modals/presets';
import { ShortcutsModal } from '@/components/modals/shortcuts';
import { SleepTimerModal } from '@/components/modals/sleep-timer';
import { Notepad, Pomodoro, Timer } from '@/components/toolbox';
import { Notepad, Pomodoro, CountdownTimer } from '@/components/toolbox';
import { fade, mix, slideY } from '@/lib/motion';
import { useSoundStore } from '@/stores/sound';
@ -36,13 +36,13 @@ export function Menu() {
const initial = useMemo(
() => ({
countdownTimer: false,
notepad: false,
pomodoro: false,
presets: false,
shareLink: false,
shortcuts: false,
sleepTimer: false,
timer: false,
}),
[],
);
@ -68,11 +68,11 @@ export function Menu() {
useHotkeys('shift+m', () => setIsOpen(prev => !prev));
useHotkeys('shift+n', () => open('notepad'));
useHotkeys('shift+p', () => open('pomodoro'));
useHotkeys('shift+t', () => open('timer'));
useHotkeys('shift+c', () => open('countdownTimer'));
useHotkeys('shift+alt+p', () => open('presets'));
useHotkeys('shift+h', () => open('shortcuts'));
useHotkeys('shift+s', () => open('shareLink'), { enabled: !noSelected });
useHotkeys('shift+alt+t', () => open('sleepTimer'));
useHotkeys('shift+t', () => open('sleepTimer'));
useCloseListener(closeAll);
@ -113,7 +113,7 @@ export function Menu() {
<Divider />
<NotepadItem open={() => open('notepad')} />
<PomodoroItem open={() => open('pomodoro')} />
<TimerItem open={() => open('timer')} />
<CountdownTimerItem open={() => open('countdownTimer')} />
<Divider />
<ShortcutsItem open={() => open('shortcuts')} />
@ -144,7 +144,10 @@ export function Menu() {
show={modals.pomodoro}
onClose={() => close('pomodoro')}
/>
<Timer show={modals.timer} onClose={() => close('timer')} />
<CountdownTimer
show={modals.countdownTimer}
onClose={() => close('countdownTimer')}
/>
<SleepTimerModal
show={modals.sleepTimer}
onClose={() => close('sleepTimer')}

View file

@ -30,11 +30,11 @@ export function ShortcutsModal({ onClose, show }: ShortcutsModalProps) {
label: 'Pomodoro Timer',
},
{
keys: ['Shift', 'T'],
keys: ['Shift', 'C'],
label: 'Countdown Timer',
},
{
keys: ['Shift', 'Alt', 'T'],
keys: ['Shift', 'T'],
label: 'Sleep Timer',
},
{

View file

@ -5,7 +5,7 @@ interface TimerProps {
show: boolean;
}
export function Timer({ onClose, show }: TimerProps) {
export function CountdownTimer({ onClose, show }: TimerProps) {
return (
<Modal show={show} onClose={onClose}>
<h1>Hello World</h1>

View file

@ -0,0 +1 @@
export { CountdownTimer } from './countdown-timer';

View file

@ -1,3 +1,3 @@
export { Notepad } from './notepad';
export { Pomodoro } from './pomodoro';
export { Timer } from './timer';
export { CountdownTimer } from './countdown-timer';

View file

@ -1 +0,0 @@
export { Timer } from './timer';