Skip to content

Commit

Permalink
Max history
Browse files Browse the repository at this point in the history
  • Loading branch information
prokawsar committed Jul 15, 2024
1 parent 737294d commit 18ea1ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/routes/(app)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
getAllInputs()
}
const calculatePaperCost = () => {
const calculatePaperCost = async () => {
if (!paperCount.length || hasNullValue) return
perPaperResult.clear()
finalPrice = 0
Expand All @@ -63,12 +63,13 @@
perPaperResult = perPaperResult
// Saving to history
if ($totalHistoryStore <= MAX_HISTORY) {
if ($totalHistoryStore < MAX_HISTORY) {
addHistory({
name: customer_name,
final_price: finalPrice,
papers: paperCount
})
$totalHistoryStore = await getTotalHistory()
}
// mixpanel data prepare
const perPageData: number[] = []
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(app)/history/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
<title>History</title>
</svelte:head>

<section class="max-w-6xl mx-auto flex w-full max-h-[90%] flex-col gap-4 px-4 py-5">
<section class="max-w-6xl mx-auto flex w-full h-full max-h-[90%] flex-col gap-4 px-4 py-5">
<div class="flex gap-2 items-center justify-center w-full">
<h1 class="text-xl text-center">History</h1>
<p class="bg-gray-100 flex items-center justify-center rounded-full w-7 h-7">
{data.histories.length}
</p>
</div>
<div class="w-full bg-gradient-to-r from-transparent via-slate-600/10 to-transparent p-[1px]" />
<div class="flex flex-col w-full justify-between gap-4 h-[90%] items-center">
<div class="flex flex-col w-full justify-between gap-4 h-[80%] items-center">
<div class="relative flex flex-col h-full gap-2 overflow-y-auto w-full max-w-3xl py-2">
{#if !isLoading}
{#if data.histories.length}
Expand Down

0 comments on commit 18ea1ef

Please sign in to comment.