From dd6c5faa5ab4801c82765b674813e64bf53bb35f Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Thu, 22 Aug 2024 18:18:21 +0200 Subject: [PATCH] refactor: use class helper instead of component to handle responsiveness --- src/components/Music/index.tsx | 20 +++++-- src/components/Responsive.tsx | 31 ----------- src/components/Waybar/index.tsx | 94 +++++++++++++++------------------ src/context/AppContext.tsx | 2 +- src/providers/AppProvider.tsx | 15 +++++- src/utils/react.ts | 2 + 6 files changed, 77 insertions(+), 87 deletions(-) delete mode 100644 src/components/Responsive.tsx diff --git a/src/components/Music/index.tsx b/src/components/Music/index.tsx index 9871492..707ef78 100644 --- a/src/components/Music/index.tsx +++ b/src/components/Music/index.tsx @@ -4,12 +4,12 @@ import { Kitty } from "../Kitty"; import { SpotifyPlayer } from "./SpotifyPlayer"; import { Cava } from "./Cava"; import { useApp } from "~/hooks/useApp"; -import { Responsive } from "../Responsive"; +import { cn, hideIf } from "~/utils/react"; const song = "/audio/asinine-vivement-quoi.mp3"; export const Music = () => { - const { volume } = useApp(); + const { volume, screenWidth } = useApp(); const audio = useRef(null); @@ -55,7 +55,13 @@ export const Music = () => {