ok
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "groovebrew-mockup",
|
"name": "groovebrew-mockup",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://dev.kedaimaster.com",
|
"homepage": "https://kedaimaster.com",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// src/config.js
|
// src/config.js
|
||||||
|
|
||||||
const API_BASE_URL = 'https://dev.api.kedaimaster.com';
|
const API_BASE_URL = 'https://api.kedaimaster.com';
|
||||||
|
|
||||||
export default API_BASE_URL;
|
export default API_BASE_URL;
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ const RoundedRectangle = ({
|
|||||||
loading = false,
|
loading = false,
|
||||||
children, // Assuming this is a React component or JSX
|
children, // Assuming this is a React component or JSX
|
||||||
isChildren,
|
isChildren,
|
||||||
width='calc(100% / 2 - 10px)'
|
width = 'calc(100% / 2 - 10px)'
|
||||||
}) => {
|
}) => {
|
||||||
const containerStyle = {
|
const containerStyle = {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
alignItems: "flex-start",
|
alignItems: "flex-start",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
width: !children && !isChildren && width,
|
width: width,
|
||||||
height: "auto",
|
height: "auto",
|
||||||
borderRadius: "15px",
|
borderRadius: "15px",
|
||||||
padding: "20px",
|
padding: "20px",
|
||||||
@@ -104,7 +104,7 @@ const RoundedRectangle = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const App = ({ forCafe = true, cafeId="",
|
const App = ({ forCafe = true, cafeId = -1,
|
||||||
handleClose, otherCafes }) => {
|
handleClose, otherCafes }) => {
|
||||||
const [selectedCafeId, setSelectedCafeId] = useState(cafeId);
|
const [selectedCafeId, setSelectedCafeId] = useState(cafeId);
|
||||||
const [analytics, setAnalytics] = useState({});
|
const [analytics, setAnalytics] = useState({});
|
||||||
@@ -112,7 +112,7 @@ const App = ({ forCafe = true, cafeId="",
|
|||||||
const [filter, setFilter] = useState("yesterday");
|
const [filter, setFilter] = useState("yesterday");
|
||||||
|
|
||||||
const fetchData = async (filter) => {
|
const fetchData = async (filter) => {
|
||||||
if(selectedCafeId == '-1') return;
|
if (selectedCafeId == '-1') return;
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// Fetch the analytics data with the selected filter
|
// Fetch the analytics data with the selected filter
|
||||||
@@ -210,7 +210,7 @@ const App = ({ forCafe = true, cafeId="",
|
|||||||
|
|
||||||
|
|
||||||
console.log(selectedCafeId)
|
console.log(selectedCafeId)
|
||||||
console.log(segments)
|
console.log(segments)
|
||||||
|
|
||||||
const formatIncome = (amount) => {
|
const formatIncome = (amount) => {
|
||||||
if (amount >= 1_000_000_000) {
|
if (amount >= 1_000_000_000) {
|
||||||
@@ -298,7 +298,7 @@ console.log(segments)
|
|||||||
setTexts((prevTexts) => {
|
setTexts((prevTexts) => {
|
||||||
const newTexts = [...prevTexts];
|
const newTexts = [...prevTexts];
|
||||||
console.log(prevTexts.length)
|
console.log(prevTexts.length)
|
||||||
const nextText = fullTexts[fullTexts.findIndex(item => item[0] === texts[2])+1][0]; // Get the next item in the full list
|
const nextText = fullTexts[fullTexts.findIndex(item => item[0] === texts[2]) + 1][0]; // Get the next item in the full list
|
||||||
newTexts.shift(); // Remove the first element
|
newTexts.shift(); // Remove the first element
|
||||||
newTexts.push(nextText); // Add the next item to the end
|
newTexts.push(nextText); // Add the next item to the end
|
||||||
setSelectedSwitch(1); // Change the selected index
|
setSelectedSwitch(1); // Change the selected index
|
||||||
@@ -342,19 +342,19 @@ console.log(segments)
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
position: forCafe? 'fixed': 'relative',
|
position: forCafe ? 'fixed' : 'relative',
|
||||||
height: '100vh',
|
height: '100vh',
|
||||||
width: '100vw',
|
width: '100vw',
|
||||||
top: 0,
|
top: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
overflowY: forCafe? 'auto' : 'none',
|
overflowY: forCafe ? 'auto' : 'none',
|
||||||
color: 'black',
|
color: 'black',
|
||||||
marginTop: forCafe ? 0 : '-22vh'
|
marginTop: forCafe ? 0 : '-22vh'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', padding: forCafe? '0px 20px' : '0px 15px', justifyContent: forCafe? 'flex-start':'space-between' }}>
|
<div style={{ display: 'flex', alignItems: 'center', padding: forCafe ? '0px 20px' : '0px 15px', justifyContent: forCafe ? 'flex-start' : 'space-between' }}>
|
||||||
{forCafe && <div style={{marginTop: '49px', marginRight: '10px'}} onClick={handleClose}><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 512 512"><path d="M48,256c0,114.87,93.13,208,208,208s208-93.13,208-208S370.87,48,256,48,48,141.13,48,256Zm212.65-91.36a16,16,0,0,1,.09,22.63L208.42,240H342a16,16,0,0,1,0,32H208.42l52.32,52.73A16,16,0,1,1,238,347.27l-79.39-80a16,16,0,0,1,0-22.54l79.39-80A16,16,0,0,1,260.65,164.64Z"/></svg></div>}
|
{forCafe && <div style={{ marginTop: '49px', marginRight: '10px' }} onClick={handleClose}><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 512 512"><path d="M48,256c0,114.87,93.13,208,208,208s208-93.13,208-208S370.87,48,256,48,48,141.13,48,256Zm212.65-91.36a16,16,0,0,1,.09,22.63L208.42,240H342a16,16,0,0,1,0,32H208.42l52.32,52.73A16,16,0,1,1,238,347.27l-79.39-80a16,16,0,0,1,0-22.54l79.39-80A16,16,0,0,1,260.65,164.64Z" /></svg></div>}
|
||||||
<div style={{ marginTop: '10px' }}>
|
<div style={{ marginTop: '10px' }}>
|
||||||
{!forCafe &&
|
{!forCafe &&
|
||||||
|
|
||||||
@@ -374,15 +374,15 @@ console.log(segments)
|
|||||||
// fontSize={"12px"}
|
// fontSize={"12px"}
|
||||||
// />
|
// />
|
||||||
|
|
||||||
<div className={styles.dateSelectorWrapper} style={{fontSize: '13px'}}>
|
<div className={styles.dateSelectorWrapper} style={{ fontSize: '13px' }}>
|
||||||
{texts.map((item, indexx) => {
|
{texts.map((item, indexx) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={indexx}
|
key={indexx}
|
||||||
className={`${styles.dateSelector} ${styles.dateSelectorActive}`} style={{position: 'relative', width: 'calc(32vw - 30px)'}}
|
className={`${styles.dateSelector} ${styles.dateSelectorActive}`} style={{ position: 'relative', width: 'calc(32vw - 30px)' }}
|
||||||
onClick={()=>onItemToggle(indexx)}
|
onClick={() => onItemToggle(indexx)}
|
||||||
>
|
>
|
||||||
<div style={{position: 'absolute', bottom: 0, left: '10%', right: '10%', borderBottom: selectedSwitch == indexx ? `1px solid green` : 'none'}}></div>
|
<div style={{ position: 'absolute', bottom: 0, left: '10%', right: '10%', borderBottom: selectedSwitch == indexx ? `1px solid green` : 'none' }}></div>
|
||||||
<div
|
<div
|
||||||
style={{ color: 'black' }}>
|
style={{ color: 'black' }}>
|
||||||
{item}
|
{item}
|
||||||
@@ -395,6 +395,7 @@ console.log(segments)
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{!forCafe && selectedCafeId != -1 &&
|
||||||
<div style={{
|
<div style={{
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
marginTop: '30px'
|
marginTop: '30px'
|
||||||
@@ -522,6 +523,32 @@ console.log(segments)
|
|||||||
<PeriodCharts type={filter} aggregatedCurrentReports={analytics?.aggregatedCurrentReports} aggregatedPreviousReports={analytics?.aggregatedPreviousReports} colors={colors} />
|
<PeriodCharts type={filter} aggregatedCurrentReports={analytics?.aggregatedCurrentReports} aggregatedPreviousReports={analytics?.aggregatedPreviousReports} colors={colors} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
{!forCafe && selectedCafeId == -1 &&
|
||||||
|
<div style={{
|
||||||
|
textAlign: "center",
|
||||||
|
marginTop: '30px'
|
||||||
|
}}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexWrap: "wrap",
|
||||||
|
justifyContent: "center",
|
||||||
|
padding: "20px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
<RoundedRectangle
|
||||||
|
title={"Masukkan nama kedai"}
|
||||||
|
width="calc(100% - 10px)"
|
||||||
|
><input style={{width: '70%', fontSize: '25px'}}/></RoundedRectangle>
|
||||||
|
<RoundedRectangle
|
||||||
|
title={"Buat kedai"}
|
||||||
|
width="calc(100% - 10px)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user