From 81bd7318bba20dfbc52c6a09f23e9713d4d5fdf1 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Wed, 28 May 2025 16:02:26 +0200 Subject: [PATCH] ADD sidebar and REFACTOR buttons --- frontend/src/App.tsx | 1 + frontend/src/components/Sidebar.tsx | 27 ++++++++++++++----- frontend/src/components/Topbar.tsx | 19 +++++++++++++ .../src/components/buttons/BlueButton.tsx | 14 ++++++++++ .../src/components/buttons/MenuButton.tsx | 14 ++++++++++ frontend/src/index.css | 2 +- frontend/src/layouts/MainLayout.tsx | 21 ++++++++++----- frontend/src/pages/ClipEdit.tsx | 14 ++++------ 8 files changed, 88 insertions(+), 24 deletions(-) create mode 100644 frontend/src/components/Topbar.tsx create mode 100644 frontend/src/components/buttons/BlueButton.tsx create mode 100644 frontend/src/components/buttons/MenuButton.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0b4ddba..7a3c0d5 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -10,6 +10,7 @@ function App() { }> + Main Page} /> } /> } /> diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index fa62779..fb36178 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -1,9 +1,22 @@ -export default function Sidebar() { +import { Link } from "react-router-dom"; +import clsx from "clsx"; +import MenuButton from "./buttons/MenuButton.tsx"; + +type props = { + className?: string +} + +const Sidebar = ({className}: props) => { return ( -
-
    -
  • Create Clip
  • -
+
+ + + ➕ Create Clip + +
- ) -} \ No newline at end of file + ); +}; + +export default Sidebar; \ No newline at end of file diff --git a/frontend/src/components/Topbar.tsx b/frontend/src/components/Topbar.tsx new file mode 100644 index 0000000..80478be --- /dev/null +++ b/frontend/src/components/Topbar.tsx @@ -0,0 +1,19 @@ +import { Menu, X} from 'lucide-react'; +import MenuButton from "./buttons/MenuButton.tsx"; + +type props = { + sidebarToggled: boolean, + setSidebarToggled: Function +} + +const Topbar = ({sidebarToggled, setSidebarToggled}: props) => { + return ( +
+ setSidebarToggled(!sidebarToggled)}> + {sidebarToggled ? : } + +
+ ) +} + +export default Topbar; \ No newline at end of file diff --git a/frontend/src/components/buttons/BlueButton.tsx b/frontend/src/components/buttons/BlueButton.tsx new file mode 100644 index 0000000..9925337 --- /dev/null +++ b/frontend/src/components/buttons/BlueButton.tsx @@ -0,0 +1,14 @@ +import React from "react"; + +type Props = React.ButtonHTMLAttributes; + +const BlueButton: React.FC = ({ className = "", ...props }) => { + return ( + + { downloadable ? - () + ) :(