ok
This commit is contained in:
@@ -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 (
|
||||
<div className={styles.chartItemContainer}>
|
||||
{chartData &&
|
||||
@@ -87,10 +106,18 @@ const BarChart = ({ transactionGraph, colors }) => {
|
||||
onClick={() =>
|
||||
selectedIndex !== index ? setSelectedIndex(index) : setSelectedIndex(-1)
|
||||
}
|
||||
style={{ backgroundColor: index === indexx ? colors[index % colors.length] : 'transparent' }}
|
||||
>
|
||||
<div>
|
||||
{indexx !== chartData.length - 1 ? (
|
||||
<>
|
||||
{day}{" "}
|
||||
{(indexx === 0 || formatDate(chartData[indexx - 1].date).month !== month) && month}
|
||||
{(indexx === 0 || (formatDate(chartData[indexx - 1].date).month !== month && type != 'weekly')) && month}
|
||||
</>
|
||||
) : (
|
||||
'kemarin'
|
||||
)}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -113,7 +140,7 @@ const BarChart = ({ transactionGraph, colors }) => {
|
||||
categories: data.categories,
|
||||
labels: {
|
||||
style: {
|
||||
colors: index === 0 ? "#000" : "transparent",
|
||||
colors: index === 0 || index == selectedIndex || selectedIndex == 0 && index == 1 ? "#000" : "transparent",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
right: 20px;
|
||||
}
|
||||
.chartItemWrapperActive {
|
||||
top: 200px; /* Move chartItemWrapper down when selected */
|
||||
top: 275px; /* Move chartItemWrapper down when selected */
|
||||
}
|
||||
|
||||
.chartItemWrapperInactive {
|
||||
@@ -27,14 +27,12 @@
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
border: 1px solid black;
|
||||
border-radius: 10px 10px 0 0;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.dateSelectorActive {
|
||||
color: black;
|
||||
border-color: black;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@@ -44,6 +42,6 @@
|
||||
}
|
||||
|
||||
.chartWrapper {
|
||||
border: 1px solid black;
|
||||
border: 1px solid rgb(179, 177, 177);
|
||||
}
|
||||
|
||||
@@ -45,18 +45,18 @@
|
||||
text-align: start;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
color: black;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.artist-name {
|
||||
text-align: start;
|
||||
font-size: 0.9rem;
|
||||
color: white;
|
||||
color: black;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.song-duration {
|
||||
font-size: 0.9rem;
|
||||
color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
@@ -121,14 +121,15 @@ const MusicComponent = ({ song, min, max, onDecision }) => {
|
||||
onTouchEnd={handleTouchEnd}
|
||||
style={{ transform: `translateX(${positionX}px)` }}
|
||||
ref={containerRef}>
|
||||
{/* {min === 0 && max === 0 &&
|
||||
<VinylComponent
|
||||
album={songg.image || songg.album.images[0].url}
|
||||
/>} */}
|
||||
{song.set && <div className="decisionbgrnd" style={{ backgroundColor: song.bePlayed ? "green" : "red" }}>
|
||||
<h1 className="decision">{song.bePlayed ? "next up" : "skipped"}</h1></div>}
|
||||
<div className="bgrnd" style={{ backgroundColor: backgroundColor }}></div>
|
||||
<img src={song.image} alt={song.name} className="song-image" />
|
||||
<img
|
||||
src={song.image}
|
||||
alt={song.name}
|
||||
className="song-image"
|
||||
onError={(e) => e.target.src = song.image}
|
||||
/>
|
||||
<div className="song-details">
|
||||
<p className="song-name">{song.name}</p>
|
||||
<p className="artist-name">{song.artist}</p>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<div className={`music-player`} style={{ marginBottom: `${viewing ? '-10px' : ''}` }}>
|
||||
@@ -464,22 +471,30 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="search-box" style={{}}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
className="search-icon"
|
||||
>
|
||||
<path d="M10.533 1.27893C5.35215 1.27893 1.12598 5.41887 1.12598 10.5579C1.12598 15.697 5.35215 19.8369 10.533 19.8369C12.767 19.8369 14.8235 19.0671 16.4402 17.7794L20.7929 22.132C21.1834 22.5226 21.8166 22.5226 22.2071 22.132C22.5976 21.7415 22.5976 21.1083 22.2071 20.7178L17.8634 16.3741C19.1616 14.7849 19.94 12.7634 19.94 10.5579C19.94 5.41887 15.7138 1.27893 10.533 1.27893ZM3.12598 10.5579C3.12598 6.55226 6.42768 3.27893 10.533 3.27893C14.6383 3.27893 17.94 6.55226 17.94 10.5579C17.94 14.5636 14.6383 17.8369 10.533 17.8369C6.42768 17.8369 3.12598 14.5636 3.12598 10.5579Z" />
|
||||
</svg>
|
||||
<div className="search-box">
|
||||
<input
|
||||
ref={inputRef} // Attach the ref to the input field
|
||||
type="text"
|
||||
placeholder="cari..."
|
||||
placeholder="Cari musik..."
|
||||
value={songName}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="rectangle"
|
||||
style={{
|
||||
justifyContent: songName === "" && queue.length > 0 && queue.length < 3 || songName != '' ? 'flex-start' : 'center'
|
||||
}}
|
||||
>
|
||||
{songName == "" && queue.length < 1 && (
|
||||
<div className="middle-text">
|
||||
<span className="bold-text">Antrian kosong</span><br />
|
||||
<span className="normal-text">Pilih musikmu</span>
|
||||
<button className="search-button" onClick={handleButtonClick}>Cari musik</button>
|
||||
|
||||
</div>
|
||||
)}
|
||||
{songName != "" &&
|
||||
songs.map((song, index) => (
|
||||
<MusicComponent
|
||||
@@ -506,17 +521,19 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
|
||||
))
|
||||
)
|
||||
}
|
||||
{songName == "" && queue.length < 1 && (
|
||||
<div className="rectangle">
|
||||
<div className="diagonal-text">Antrian kosong - Pilih musikmu</div>
|
||||
</div>
|
||||
)}
|
||||
{songName == "" && queue.length > 0 && queue.length < 3 && (
|
||||
<div className="rectangle">
|
||||
<div className="diagonal-text">Drop Your Hits</div>
|
||||
|
||||
<div className="middle-text">
|
||||
<span className="normal-text">Tambahkan musikmu</span>
|
||||
<button className="search-button" onClick={handleButtonClick}>Cari musik</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div className={`expand-button ${expanded ? "expanded" : ""}`} onClick={toggleExpand}>
|
||||
|
||||
<h5>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// src/config.js
|
||||
|
||||
const API_BASE_URL = 'https://dev.api.kedaimaster.com';
|
||||
const API_BASE_URL = 'https://test.api.kedaimaster.com';
|
||||
|
||||
export default API_BASE_URL;
|
||||
|
||||
@@ -848,14 +848,15 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
|
||||
<div className={styles.swipeContainer}>
|
||||
<div className={styles.swipeCreditsContent}>
|
||||
{['AI - MUHAMMAD AINUL FIKRI',
|
||||
'BACKEND - ZADIT TAQWA W',
|
||||
'FRONTEND - NAUFAL UNGU W',
|
||||
'FRONTEND - PASHA UNGU W' ,
|
||||
'FRONTEND - ZADIT TAQWA W',
|
||||
'UI/UX - LUNA CHELISA A',
|
||||
'UI/UX - MAULINA AYU E',
|
||||
'UI/UX - NUR ARINDA P',
|
||||
'UI/UX - NAURA IZZATI B',].map((item, index) => (
|
||||
'BACKEND - ZADIT TAQWA W.',
|
||||
'FRONTEND - M. PASHA A. P.' ,
|
||||
'FRONTEND - NAUFAL DANIYAL P.',
|
||||
'FRONTEND - ZADIT TAQWA W.',
|
||||
'UI/UX - KEVIN DWI WIJAYA',
|
||||
'UI/UX - LUNA CHELISA A.',
|
||||
'UI/UX - MAULINA AYU E.',
|
||||
'UI/UX - NUR ARINDA P.',
|
||||
'UI/UX - NAURA IZZATI B.',].map((item, index) => (
|
||||
<div key={index} className={styles.swipeItem}>{item}</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -103,42 +103,46 @@
|
||||
|
||||
10%,
|
||||
15% {
|
||||
transform: translateY(-11.1%);
|
||||
transform: translateY(-10%);
|
||||
}
|
||||
|
||||
20%,
|
||||
25% {
|
||||
transform: translateY(-22.2%);
|
||||
transform: translateY(-20%);
|
||||
}
|
||||
|
||||
30%,
|
||||
35% {
|
||||
transform: translateY(-33.3%);
|
||||
transform: translateY(-30%);
|
||||
}
|
||||
|
||||
40%,
|
||||
45% {
|
||||
transform: translateY(-44.4%);
|
||||
transform: translateY(-40%);
|
||||
}
|
||||
|
||||
50%,
|
||||
55% {
|
||||
transform: translateY(-55.5%);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
60%,
|
||||
65% {
|
||||
transform: translateY(-66.6%);
|
||||
transform: translateY(-60%);
|
||||
}
|
||||
|
||||
70%,
|
||||
75% {
|
||||
transform: translateY(-77.7%);
|
||||
transform: translateY(-70%);
|
||||
}
|
||||
|
||||
80%,
|
||||
85% {
|
||||
transform: translateY(-88.8%);
|
||||
transform: translateY(-80%);
|
||||
}
|
||||
90%,
|
||||
95% {
|
||||
transform: translateY(-90%);
|
||||
}
|
||||
}
|
||||
/* Sub Heading */
|
||||
|
||||
@@ -217,12 +217,13 @@ const App = ({ cafeId,
|
||||
selectedSwitch={["yesterday", "weekly", "monthly", "yearly"].indexOf(
|
||||
filter
|
||||
)}
|
||||
borderColor={'#b3b1b1'}
|
||||
bgColor={'#f4efe6'}
|
||||
borderColor={'transparent'}
|
||||
borderWidth={0.1}
|
||||
onToggleCallback={onToggle}
|
||||
fontColor={"black"}
|
||||
fontColor={"#af9463"}
|
||||
selectedFontColor={"black"}
|
||||
selectedSwitchColor={"rgb(197, 197, 197)"}
|
||||
selectedSwitchColor={"white"}
|
||||
eachSwitchWidth={70}
|
||||
height={"25px"}
|
||||
fontSize={"12px"}
|
||||
@@ -280,8 +281,8 @@ const App = ({ cafeId,
|
||||
>
|
||||
<div style={{ marginRight: "5px", fontSize: "1.2em" }}>ⓘ</div>
|
||||
<h6 style={{ margin: 0, textAlign: "left" }}>
|
||||
Persentase pertumbuhan dihitung dengan membandingkan periode{" "}
|
||||
{comparisonText} terakhir dengan {comparisonText} hari sebelumnya.
|
||||
Persentase pertumbuhan dihitung dengan membandingkan {" "}
|
||||
{comparisonText} hari terakhir dengan {comparisonText} hari sebelumnya.
|
||||
</h6>
|
||||
</div>
|
||||
</div>
|
||||
@@ -320,7 +321,7 @@ const App = ({ cafeId,
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<BarChart transactionGraph={analytics?.transactionGraph} colors={colors}/>
|
||||
<BarChart transactionGraph={analytics?.transactionGraph} type={analytics?.type} aggregatedReports={analytics?.aggregatedReports} colors={colors}/>
|
||||
</div>
|
||||
<div class="ItemLister_PaymentOption__YZlDL"><div style={{ marginTop: '20px' }} onClick={handleClose} class="ItemLister_Pay2Button__+MIxX">Kembali</div></div>
|
||||
</div>
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
font-family: "Plus Jakarta Sans", sans-serif;
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-size: 32px;
|
||||
font-size: 6vw;
|
||||
color: black;
|
||||
text-align: left;
|
||||
margin-left: 20px;
|
||||
margin-top: 40px;
|
||||
margin-top: 57px;
|
||||
}
|
||||
|
||||
.Transactions-detail {
|
||||
|
||||
Reference in New Issue
Block a user