From bfd3d9cf5d4a26f08ff19cca8aa96e30ff4b0974 Mon Sep 17 00:00:00 2001 From: Leslie Yip Date: Mon, 22 Jan 2024 12:31:58 +0800 Subject: [PATCH 1/5] Update to `.tsx` --- src/layout/{NavigationBar.jsx => NavigationBar.tsx} | 1 + src/layout/{NavigationMenu.jsx => NavigationMenu.tsx} | 2 +- src/layout/NavigationMenuItem.tsx | 2 +- tailwind.config.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename src/layout/{NavigationBar.jsx => NavigationBar.tsx} (94%) rename src/layout/{NavigationMenu.jsx => NavigationMenu.tsx} (97%) diff --git a/src/layout/NavigationBar.jsx b/src/layout/NavigationBar.tsx similarity index 94% rename from src/layout/NavigationBar.jsx rename to src/layout/NavigationBar.tsx index 52d1c31..38a3843 100644 --- a/src/layout/NavigationBar.jsx +++ b/src/layout/NavigationBar.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { Link } from 'react-router-dom'; import NavigationMenu from './NavigationMenu'; import './NavigationBar.css'; diff --git a/src/layout/NavigationMenu.jsx b/src/layout/NavigationMenu.tsx similarity index 97% rename from src/layout/NavigationMenu.jsx rename to src/layout/NavigationMenu.tsx index 8c26a1b..d5ced90 100644 --- a/src/layout/NavigationMenu.jsx +++ b/src/layout/NavigationMenu.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import React, { useState } from 'react'; import { IoMenu, IoClose } from 'react-icons/io5'; import NavigationMenuItem from './NavigationMenuItem'; import './NavigationMenu.css'; diff --git a/src/layout/NavigationMenuItem.tsx b/src/layout/NavigationMenuItem.tsx index 74a3054..545059e 100644 --- a/src/layout/NavigationMenuItem.tsx +++ b/src/layout/NavigationMenuItem.tsx @@ -5,7 +5,7 @@ import './NavigationMenuItem.css'; interface NavigationMenuItemProps { link: string; label: string; - dropdown: boolean; + dropdown?: boolean; } function NavigationMenuItem(props: NavigationMenuItemProps) { diff --git a/tailwind.config.js b/tailwind.config.js index 1135580..6ef65b9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,7 +1,7 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ['./src/**/*.{js,jsx}'], + content: ['./src/**/*.{js,jsx,ts,tsx}'], theme: { extend: { colors: { From a934132cb7a37a742b8ca7c05e45bb5b1af2df41 Mon Sep 17 00:00:00 2001 From: Leslie Yip Date: Mon, 22 Jan 2024 13:24:54 +0800 Subject: [PATCH 2/5] Add footer --- src/App.css | 9 ++--- src/App.jsx | 4 +- src/index.css | 3 +- src/layout/Footer.css | 17 +++++++++ src/layout/Footer.tsx | 85 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 src/layout/Footer.css create mode 100644 src/layout/Footer.tsx diff --git a/src/App.css b/src/App.css index 7fc387d..243cbf6 100644 --- a/src/App.css +++ b/src/App.css @@ -1,9 +1,6 @@ -/* #root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} */ +#root { + flex-direction: column; +} .logo { height: 6em; diff --git a/src/App.jsx b/src/App.jsx index 86793a2..d1187ae 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,6 +1,7 @@ import { Routes, Route } from 'react-router-dom'; import { Home } from './pages'; import NavigationBar from './layout/NavigationBar'; +import Footer from './layout/Footer'; import './App.css'; function App() { @@ -15,8 +16,7 @@ function App() { - {/* Footer */} -
NUSComputing
+