Skip to content

Commit 6108711

Browse files
committed
feat: next and prev page.
1 parent 461464a commit 6108711

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

src/components/CommandPalette.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,20 @@ const CommandPalette = ({
516516
});
517517
break;
518518
}
519+
case 'previousPage':
520+
addToast({
521+
title: 'Previous Page',
522+
duration: 1500,
523+
});
524+
navigate(-1);
525+
break;
526+
case 'nextPage':
527+
addToast({
528+
title: 'Next Page',
529+
duration: 1500,
530+
});
531+
navigate(1);
532+
break;
519533
default:
520534
break;
521535
}

src/components/Toast.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ const Toast = ({
3737
>
3838
<div className="flex flex-col text-sm group w-max flex-grow">
3939
<div className="flex items-center gap-2">
40-
{' '}
41-
{/* New div for icon and title */}
4240
{icon && <span className="text-xl text-red-100">{icon}</span>}
4341
<span className="text-base text-red-100">{title}</span>
4442
</div>

src/hooks/useSearchableData.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ const useSearchableData = () => {
308308
type: 'command',
309309
commandId: 'toggleGlitchMode',
310310
},
311-
{ title: 'Fezynth', type: 'command', commandId: 'openFezynth' },
311+
{ title: 'Previous Page', type: 'command', commandId: 'previousPage' },
312+
{ title: 'Next Page', type: 'command', commandId: 'nextPage' },
312313
];
313314

314315
setItems([

src/pages/CommandsPage.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ const commandsData = [
6565
description: 'Go to the bottom of the page.',
6666
color: 'blue',
6767
},
68+
{
69+
title: 'Previous Page',
70+
description: 'Go back to the previous page in your browser history.',
71+
color: 'sky',
72+
},
73+
{
74+
title: 'Next Page',
75+
description: 'Go forward to the next page in your browser history.',
76+
color: 'blue',
77+
},
6878
],
6979
},
7080
{

0 commit comments

Comments
 (0)