mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 17:04:15 +00:00
refactor: rename components
This commit is contained in:
parent
c5657d0642
commit
d73b2bc1ff
9 changed files with 17 additions and 14 deletions
|
|
@ -6,7 +6,7 @@ interface SleepTimerProps {
|
||||||
open: () => void;
|
open: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Timer({ open }: SleepTimerProps) {
|
export function CountdownTimer({ open }: SleepTimerProps) {
|
||||||
return (
|
return (
|
||||||
<Item
|
<Item
|
||||||
icon={<MdOutlineTimer />}
|
icon={<MdOutlineTimer />}
|
||||||
|
|
@ -7,4 +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 { Timer as TimerItem } from './timer';
|
export { CountdownTimer as CountdownTimerItem } from './countdown-timer';
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
NotepadItem,
|
NotepadItem,
|
||||||
SourceItem,
|
SourceItem,
|
||||||
PomodoroItem,
|
PomodoroItem,
|
||||||
TimerItem,
|
CountdownTimerItem,
|
||||||
PresetsItem,
|
PresetsItem,
|
||||||
ShortcutsItem,
|
ShortcutsItem,
|
||||||
SleepTimerItem,
|
SleepTimerItem,
|
||||||
|
|
@ -21,7 +21,7 @@ import { ShareLinkModal } from '@/components/modals/share-link';
|
||||||
import { PresetsModal } from '@/components/modals/presets';
|
import { PresetsModal } from '@/components/modals/presets';
|
||||||
import { ShortcutsModal } from '@/components/modals/shortcuts';
|
import { ShortcutsModal } from '@/components/modals/shortcuts';
|
||||||
import { SleepTimerModal } from '@/components/modals/sleep-timer';
|
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 { fade, mix, slideY } from '@/lib/motion';
|
||||||
import { useSoundStore } from '@/stores/sound';
|
import { useSoundStore } from '@/stores/sound';
|
||||||
|
|
||||||
|
|
@ -36,13 +36,13 @@ export function Menu() {
|
||||||
|
|
||||||
const initial = useMemo(
|
const initial = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
countdownTimer: false,
|
||||||
notepad: false,
|
notepad: false,
|
||||||
pomodoro: false,
|
pomodoro: false,
|
||||||
presets: false,
|
presets: false,
|
||||||
shareLink: false,
|
shareLink: false,
|
||||||
shortcuts: false,
|
shortcuts: false,
|
||||||
sleepTimer: false,
|
sleepTimer: false,
|
||||||
timer: false,
|
|
||||||
}),
|
}),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
@ -68,11 +68,11 @@ export function Menu() {
|
||||||
useHotkeys('shift+m', () => setIsOpen(prev => !prev));
|
useHotkeys('shift+m', () => setIsOpen(prev => !prev));
|
||||||
useHotkeys('shift+n', () => open('notepad'));
|
useHotkeys('shift+n', () => open('notepad'));
|
||||||
useHotkeys('shift+p', () => open('pomodoro'));
|
useHotkeys('shift+p', () => open('pomodoro'));
|
||||||
useHotkeys('shift+t', () => open('timer'));
|
useHotkeys('shift+c', () => open('countdownTimer'));
|
||||||
useHotkeys('shift+alt+p', () => open('presets'));
|
useHotkeys('shift+alt+p', () => open('presets'));
|
||||||
useHotkeys('shift+h', () => open('shortcuts'));
|
useHotkeys('shift+h', () => open('shortcuts'));
|
||||||
useHotkeys('shift+s', () => open('shareLink'), { enabled: !noSelected });
|
useHotkeys('shift+s', () => open('shareLink'), { enabled: !noSelected });
|
||||||
useHotkeys('shift+alt+t', () => open('sleepTimer'));
|
useHotkeys('shift+t', () => open('sleepTimer'));
|
||||||
|
|
||||||
useCloseListener(closeAll);
|
useCloseListener(closeAll);
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ export function Menu() {
|
||||||
<Divider />
|
<Divider />
|
||||||
<NotepadItem open={() => open('notepad')} />
|
<NotepadItem open={() => open('notepad')} />
|
||||||
<PomodoroItem open={() => open('pomodoro')} />
|
<PomodoroItem open={() => open('pomodoro')} />
|
||||||
<TimerItem open={() => open('timer')} />
|
<CountdownTimerItem open={() => open('countdownTimer')} />
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
<ShortcutsItem open={() => open('shortcuts')} />
|
<ShortcutsItem open={() => open('shortcuts')} />
|
||||||
|
|
@ -144,7 +144,10 @@ export function Menu() {
|
||||||
show={modals.pomodoro}
|
show={modals.pomodoro}
|
||||||
onClose={() => close('pomodoro')}
|
onClose={() => close('pomodoro')}
|
||||||
/>
|
/>
|
||||||
<Timer show={modals.timer} onClose={() => close('timer')} />
|
<CountdownTimer
|
||||||
|
show={modals.countdownTimer}
|
||||||
|
onClose={() => close('countdownTimer')}
|
||||||
|
/>
|
||||||
<SleepTimerModal
|
<SleepTimerModal
|
||||||
show={modals.sleepTimer}
|
show={modals.sleepTimer}
|
||||||
onClose={() => close('sleepTimer')}
|
onClose={() => close('sleepTimer')}
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,11 @@ export function ShortcutsModal({ onClose, show }: ShortcutsModalProps) {
|
||||||
label: 'Pomodoro Timer',
|
label: 'Pomodoro Timer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
keys: ['Shift', 'T'],
|
keys: ['Shift', 'C'],
|
||||||
label: 'Countdown Timer',
|
label: 'Countdown Timer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
keys: ['Shift', 'Alt', 'T'],
|
keys: ['Shift', 'T'],
|
||||||
label: 'Sleep Timer',
|
label: 'Sleep Timer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ interface TimerProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Timer({ onClose, show }: TimerProps) {
|
export function CountdownTimer({ onClose, show }: TimerProps) {
|
||||||
return (
|
return (
|
||||||
<Modal show={show} onClose={onClose}>
|
<Modal show={show} onClose={onClose}>
|
||||||
<h1>Hello World</h1>
|
<h1>Hello World</h1>
|
||||||
1
src/components/toolbox/countdown-timer/index.ts
Normal file
1
src/components/toolbox/countdown-timer/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export { CountdownTimer } from './countdown-timer';
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
export { Notepad } from './notepad';
|
export { Notepad } from './notepad';
|
||||||
export { Pomodoro } from './pomodoro';
|
export { Pomodoro } from './pomodoro';
|
||||||
export { Timer } from './timer';
|
export { CountdownTimer } from './countdown-timer';
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export { Timer } from './timer';
|
|
||||||
Loading…
Add table
Reference in a new issue