From 59a9d299c54c98a52e77e6d9f26a6f31426835f8 Mon Sep 17 00:00:00 2001 From: zadit <75159257+insvrgent@users.noreply.github.com> Date: Sat, 4 Jan 2025 06:57:36 +0700 Subject: [PATCH] ok --- src/components/BarChart.js | 45 +++++++++++++---- src/components/BarChart.module.css | 6 +-- src/components/MusicComponent.css | 6 +-- src/components/MusicComponent.js | 13 ++--- src/components/MusicPlayer.css | 79 ++++++++++++++++++++++++------ src/components/MusicPlayer.js | 73 ++++++++++++++++----------- src/config.js | 2 +- src/pages/Dashboard.js | 17 ++++--- src/pages/LinktreePage.module.css | 20 +++++--- src/pages/Reports.js | 13 ++--- src/pages/Transactions.module.css | 4 +- 11 files changed, 187 insertions(+), 91 deletions(-) diff --git a/src/components/BarChart.js b/src/components/BarChart.js index f4ca6eb..448d91c 100644 --- a/src/components/BarChart.js +++ b/src/components/BarChart.js @@ -1,13 +1,31 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import Chart from "react-apexcharts"; import styles from "./BarChart.module.css"; // Import the CSS module -const BarChart = ({ transactionGraph, colors }) => { +const BarChart = ({ transactionGraph, colors, type, aggregatedReports }) => { const [selectedIndex, setSelectedIndex] = useState(-1); + useEffect(() => { + setSelectedIndex(-1); + }, [transactionGraph]); + const processData = (graphData) => { if (!graphData) return null; return graphData.map((dayData) => { + const monthly = [ + "minggu 1", + "minggu 2", + "minggu 3", + "minggu 4", + ]; + + const yearly = [ + "Q1", + "Q2", + "Q3", + "Q4", + ]; + const categories = [ "0-3", "3-6", @@ -60,11 +78,12 @@ const BarChart = ({ transactionGraph, colors }) => { const monthNames = [ "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des" ]; - const month = monthNames[date.getMonth()]; - const day = date.getDate(); + const month = monthNames[date.getUTCMonth()]; // Use getUTCMonth() for UTC month + const day = date.getUTCDate(); // Use getUTCDate() for UTC day return { month, day }; }; + return (
{song.name}
{song.artist}
diff --git a/src/components/MusicPlayer.css b/src/components/MusicPlayer.css index 15d52ff..da67862 100644 --- a/src/components/MusicPlayer.css +++ b/src/components/MusicPlayer.css @@ -115,7 +115,7 @@ overflow: hidden; transition: max-height 0.5s ease, padding 0.5s ease; /* Smooth transition for max-height and padding */ - background-color: rgba(0, 0, 0, 0.8); + /* Example background color */ } @@ -177,7 +177,8 @@ } .expand-button.expanded{ - padding-top: 0px; + padding-top: 2px; + margin-top: -6px; } /* Adjust height of the music player container when expanded */ @@ -190,9 +191,7 @@ display: flex; align-items: center; padding: 10px; - /* background-color: rgb(29, 185, 84); */ - - background-color: #73a585; + padding-top: 0px; } .search-box input[type="text"] { @@ -204,6 +203,13 @@ font-size: 16px; outline: none; /* Remove default outline */ + background-color: #f4efe6; + text-align: center; +} +.search-box input[type="text"]::placeholder { + font-weight: bold; + opacity: 0.7; + text-align: center; } .search-box .search-icon { @@ -225,7 +231,6 @@ display: flex; align-items: center; padding: 10px; - background-color: rgb(29, 185, 84); } .auth-box input[type="text"] { @@ -236,9 +241,17 @@ padding: 10px 15px; font-size: 16px; outline: none; + background-color: #019863; /* Remove default outline */ } +.auth-box input[type="text"]::placeholder { + color: white; /* Placeholder text color */ + font-weight: bold; + opacity: 0.7; /* Optional: Adjust visibility */ + text-align: center; +} + .auth-box .auth-icon { margin-right: 5px; color: #888; @@ -253,20 +266,54 @@ fill: #888; /* Adjust fill color */ } - .rectangle { position: relative; height: 200px; overflow: hidden; + border: 3px dashed #fbebcd; + border-radius: 11px; + + /* Flexbox for centering */ + display: flex; + flex-direction: column; /* Stack children vertically */ + justify-content: center; /* Center vertically */ + background-color: white; + z-index: 1; + overflow-y: auto; } -.diagonal-text { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%) rotate(-24deg); - font-size: 24px; - font-weight: bold; - color: #676767; - white-space: nowrap; +.middle-text { + text-align: center; + font-family: Arial, sans-serif; /* Optional font */ + color: #333; /* Optional text color */ + margin-bottom: 0.5rem; /* Add spacing between text and button */ +} + +.bold-text { + font-weight: bold; + font-size: 18px; +} + +.normal-text { + font-weight: normal; + font-size: 13px; +} + +.search-button { + display: block; + margin: 1rem auto 0; + + flex-grow: 1; + border: none; + border-radius: 25px; + padding: 10px 15px; + font-size: 16px; + outline: none; + background-color: #f4efe6; + color: black; + font-weight: bold; +} + +.search-button:hover { + background-color: #0056b3; } diff --git a/src/components/MusicPlayer.js b/src/components/MusicPlayer.js index 5b43db8..ccfbfa2 100644 --- a/src/components/MusicPlayer.js +++ b/src/components/MusicPlayer.js @@ -31,6 +31,8 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo const [canvaz, setCanvaz] = useState(''); const [videoSrc, setVideoSrc] = useState(''); const videoRef = useRef(null); + const inputRef = useRef(null); // Create a ref to the input field + useEffect(() => { @@ -368,6 +370,11 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo } }, [currentSong]); // Run effect when currentSong changes + const handleButtonClick = () => { + if (inputRef.current) { + inputRef.current.focus(); // Focus the input when the button is clicked + } + }; return (