feat(nav, blog) new ThemeSwitcher, also several updates on ui

This commit is contained in:
lumither committed 2024-08-19 01:22:27 +08:00
1 parent 2ca7e8bc14
commit 3c1fc34c2a
8 files changed
+159 -100

No files matched your search

+3 -18
View File
@@ -1,8 +1,9 @@
'use client';
import React, { useEffect, useState } from 'react';
import React from 'react';
import { Pagination as NextUIPagination } from '@nextui-org/react';
import { useRouter, useSearchParams } from 'next/navigation';
import { useScreenSizeTrigger } from '@/app/public/screenSizeTrigger';
const Pagination = ({ total }: {
total: number,
@@ -12,23 +13,7 @@ const Pagination = ({ total }: {
const router = useRouter();
const maxMobileWidth: number = 768;
const [ isMobile, setIsMobile ] = useState(false);
useEffect(() => {
const updateMobileWidth = () => {
if (window.innerWidth <= maxMobileWidth) {
setIsMobile(true);
} else {
setIsMobile(false);
}
};
updateMobileWidth();
window.addEventListener('resize', updateMobileWidth);
return () => {
window.removeEventListener('resize', updateMobileWidth);
};
}, []);
const isMobile = useScreenSizeTrigger('md');
return (
<div className={ 'w-full p-4 pt-6 flex justify-center' }>