Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20

- name: Install dependencies
run: npm install
Expand Down
15 changes: 7 additions & 8 deletions components/common/Divider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ const Divider: React.FC<DividerProps> = ({
}) => {
const [isMobile, setIsMobile] = useState(false);
const [isTablet, setIsTablet] = useState(false);
const [isMounted, setIsMounted] = useState(false);

useEffect(() => {
setIsMounted(true);
const handleResize = () => {
setIsMobile(window.innerWidth <= 768);
setIsTablet(window.innerWidth <= 1024 && window.innerWidth > 768);
const w = window.innerWidth;
const nextIsMobile = w <= 768;
const nextIsTablet = w <= 1024 && w > 768;

setIsMobile((prev) => (prev === nextIsMobile ? prev : nextIsMobile));
setIsTablet((prev) => (prev === nextIsTablet ? prev : nextIsTablet));
};

handleResize();
Expand All @@ -38,10 +40,7 @@ const Divider: React.FC<DividerProps> = ({
}, []);

const getMaxWidth = () => {
// Use default value during SSR and initial render to match server
if (!isMounted) {
return maxWidth || "980px";
}
if (maxWidth) return maxWidth;
if (isMobile) return "95%";
if (isTablet) return "90%";
return "980px";
Expand Down
4 changes: 0 additions & 4 deletions components/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ export default function Header() {
}
}, [isMobileMenuOpen]);

useEffect(() => {
setIsMobileMenuOpen(false);
}, [pathname]);

// Lock body scroll when mobile menu is open
useEffect(() => {
if (isMobileMenuOpen) {
Expand Down
25 changes: 9 additions & 16 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
];

export default eslintConfig;
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

export default defineConfig([
...nextVitals,
...nextTs,
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
]);
Loading