This commit is contained in:
zadit
2024-12-27 08:02:11 +07:00
parent cf38edac85
commit 675f4f2c42
13 changed files with 168 additions and 72 deletions

View File

@@ -43,6 +43,23 @@ const LinktreePage = ({ user, setModal }) => {
}, [location]);
useEffect(() => {
const url = new URL(window.location.href); // Get the current URL
const searchParams = new URLSearchParams(url.search); // Get the query parameters
console.log(selectedItemId)
if (selectedItemId != 0 && selectedItemId != -1) {
// Add cafeId to the query parameter
searchParams.set('cafeId', selectedItemId);
} else {
// Remove cafeId from the query parameter
searchParams.delete('cafeId');
}
// Update the URL with the modified query params
window.history.replaceState(null, '', `${url.pathname}?${searchParams.toString()}`);
}, [selectedItemId]);
// Handle user transactions
const handleMyTransactions = async () => {
try {
@@ -148,26 +165,23 @@ const LinktreePage = ({ user, setModal }) => {
};
const colors = [
// Complementary (for contrast with olive green)
"#FF6347", // Tomato red (complementary to olive green)
"#FF4500", // Orange red (complementary to olive green)
// Analogous to olive green
"#D0E14F", // Light green-yellow
"#A9C96E", // Muted olive green (your bg color itself)
"#A5B24F", // Earthy olive green
// Triadic (balanced and vibrant palette)
"#FF00FF", // Magenta (triadic color)
"#1E90FF", // Dodger blue (triadic color)
"#32CD32", // Lime green (triadic color)
// Neutral tones
"#FFDAB9", // Peach (light neutral tone)
"#4B0082", // Indigo (dark neutral tone)
"#8B4513", // Saddle brown (earthy neutral)
// Strong contrasting colors for visibility on white background
"#333333", // Dark Gray (great contrast for legibility)
"#555555", // Medium Gray (slightly lighter, still legible)
// Subtle accent colors (not too bright, but distinct)
"#4B9F8D", // Muted Teal (offers a soft contrast)
"#7F7F7F", // Slate Gray (elegant and balanced)
// Softer neutral colors (for less emphasis)
"#B0B0B0", // Light Gray (gentle tone for subtle slices)
"#D3D3D3", // Silver Gray (light, but still visible on white background)
// A touch of color for balance (but still muted)
"#9C6E5C", // Muted Brown (earthy, grounded tone)
"#A1A1A1", // Silver (neutral highlight)
];
const selectedItems = items.items?.find(item => (item.userId || item.cafeId) === selectedItemId);
@@ -268,8 +282,8 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
1 -205 -24 -27 -69 -23 -89 7 -20 31 -17 172 5 198 17 22 59 22 83 0z"/>
</g>
</svg>
<p>Total pemasukan</p>
<p>{items?.totalIncome}</p>
<p> pemasukan</p>
</div>
<div className={styles.cardItem}>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
@@ -312,7 +326,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
1 -205 -24 -27 -69 -23 -89 7 -20 31 -17 172 5 198 17 22 59 22 83 0z"/>
</g>
</svg>
<p>Total keuntungan</p>
<p> keuntungan</p>
<p>{items?.totalIncome * 0.02}</p>
</div>
</div>
@@ -413,6 +427,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
API_BASE_URL + "/" + (JSON.parse(filteredItems.welcomePageConfig)?.image || '') : 'https://png.pngtree.com/png-vector/20221125/ourmid/pngtree-no-image-available-icon-flatvector-illustration-pic-design-profile-vector-png-image_40966566.jpg'
}
/>
<p>{selectedItems?.totalIncome * 0.02}</p>
<p>{filteredItems.name}</p>
</div>
</div>
@@ -462,8 +477,8 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
1 -205 -24 -27 -69 -23 -89 7 -20 31 -17 172 5 198 17 22 59 22 83 0z"/>
</g>
</svg>
<p>Total pemasukan</p>
<p>{formatIncome(items?.totalIncome)}</p>
<p> pemasukan</p>
</div>
<div className={styles.cardItem}>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
@@ -506,8 +521,8 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
1 -205 -24 -27 -69 -23 -89 7 -20 31 -17 172 5 198 17 22 59 22 83 0z"/>
</g>
</svg>
<p>Total pengeluaran</p>
<p>{formatIncome(items?.totalOutcome)}</p>
<p> pengeluaran</p>
</div>
<div className={styles.cardItem}>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
@@ -550,8 +565,8 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
1 -205 -24 -27 -69 -23 -89 7 -20 31 -17 172 5 198 17 22 59 22 83 0z"/>
</g>
</svg>
<p>Total tanggungan</p>
<p>{formatIncome(items?.totalIncome * 0.02)}</p>
<p> tanggungan</p>
</div>
</div>
) : (
@@ -651,6 +666,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
API_BASE_URL + "/" + (JSON.parse(selectedItems.welcomePageConfig)?.image || '') : 'https://png.pngtree.com/png-vector/20221125/ourmid/pngtree-no-image-available-icon-flatvector-illustration-pic-design-profile-vector-png-image_40966566.jpg'
}
/>
<p>&nbsp;</p>
<p>{selectedItems?.name}</p>
</div>
</div>
@@ -664,7 +680,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
<div className={styles.dashboardBody}>
<button className={styles.goCafeButton} style={{ visibility: (selectedItems?.cafeId || selectedSubItems.find(cafe => cafe.cafeId == selectedSubItemId)?.cafeId) == null ? 'hidden' : 'visible' }} onClick={() => window.location.href = window.location.origin + '/' + (selectedItems?.cafeId || selectedSubItems.find(cafe => cafe.cafeId == selectedSubItemId)?.cafeId)}>Kunjungi kedai</button>
<h3>terlakuu</h3>
<h3 style={{color: 'black'}}>terlaku</h3>
<div
style={{
display: "flex",
@@ -694,7 +710,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
>
</div>
<h5 style={{ margin: 0, textAlign: "left" }}>{item.percentage == 'Infinity' || isNaN(item.percentage) ? 0 : item.percentage}% &nbsp; {item.value} </h5>
<h5 style={{ margin: 0, textAlign: "left" , color: 'black'}}>{item.percentage == 'Infinity' || isNaN(item.percentage) ? 0 : item.percentage}% &nbsp; {item.value} </h5>
</div>
))}
{segments.length < 1 &&
@@ -737,7 +753,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
</div>
<div className={styles.cafeListWrapper}>
<div className={styles.cafeListHeader}>
Semua {user.roleId < 1 ? 'penyewa' : 'kedai yang dikau miliki'}
Semua {user.roleId < 1 ? 'penyewa' : 'kedai anda'}
</div>
<div className={styles.cafeList}>
</div>
@@ -826,6 +842,27 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
<div className={styles.centeredLinktreePage}>
<div className={styles.dashboardLine}></div>
<div className={styles.dashboardContainer}>
{API_BASE_URL == 'https://test.api.kedaimaster.com' ?
<div className={styles.mainHeading}>
KEDAIMASTER CREDITS
<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) => (
<div key={index} className={styles.swipeItem}>{item}</div>
))}
</div>
</div>
diskon 50%
</div>
:
<div className={styles.mainHeading}>
COBA KEDAIMASTER
<div className={styles.swipeContainer}>
@@ -835,9 +872,9 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
))}
</div>
</div>
diskon 0%
diskon 50%
</div>
}
<div className={styles.subHeading}>
Solusi berbasis web untuk memudahkan pengelolaan kedai, dengan fitur yang mempermudah pemilik, kasir, dan tamu berinteraksi.
</div>