Skip to content

Commit b6a68ba

Browse files
committed
Ui enhancments
1 parent 84972cd commit b6a68ba

7 files changed

Lines changed: 150 additions & 58 deletions

File tree

‎frontend/src/feature/quote/card/quote.card.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ setDownloading(true)
9292
{quote.tags.map((tag, index) => (
9393
<Badge
9494
variant={'outline'}
95-
className=" bg-primary/10 border-primary/20 text-primary/70"
95+
className=" text-[0.5rem] bg-primary/10 border-primary/20 text-primary/70"
9696
key={tag.id}
9797
>
9898
#{tag.name}

‎frontend/src/feature/quote/list.quote.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function ListQuote(props: Props) {
6969
</Masonry>
7070

7171
<p className="text-center text-muted-foreground p-4">
72-
--- end of quotes ---
72+
--- end of notes ---
7373
</p>
7474
</div>
7575
)

‎frontend/src/hook/get-all-quote-details.hook.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export const useGetAllQuoteDetails = () => {
88
})
99
console.log({data, error})
1010
const errorString = (typeof error=="string") ? error: error?.message
11-
return { data, isLoading , error: errorString, refetch}
11+
return { data: data?.reverse(), isLoading , error: errorString, refetch}
1212
}

‎frontend/src/page/quote/filter.tsx‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
PopoverContent,
77
PopoverTrigger,
88
} from "@/components/ui/popover"
9+
import { Separator } from "@/components/ui/separator"
910

1011
interface TagFilterProps {
1112
tags: string[]
@@ -44,16 +45,21 @@ export function TagFilter({ tags, value, onChange }: TagFilterProps) {
4445
</Button>
4546
</PopoverTrigger>
4647

47-
<PopoverContent className="w-64">
48-
<div className="flex flex-wrap gap-2">
48+
<PopoverContent className="w-40">
49+
<div className="sticky top-0 z-10 backdrop-blur-sm">
50+
<div className=" ">Filter by tags</div>
51+
<Separator className="bg-border" />
52+
</div>
53+
54+
<div className="flex flex-col overflow-auto h-64 gap-2">
4955
{tags.map(tag => (
5056
<Button
5157
key={tag}
5258
size="sm"
5359
variant={value.includes(tag) ? "default" : "outline"}
5460
onClick={() => toggleTag(tag)}
5561
>
56-
{tag}
62+
#{tag}
5763
</Button>
5864
))}
5965

‎frontend/src/page/quote/quote-list.page.tsx‎

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -118,31 +118,19 @@ export function QuoteListPage() {
118118
/* ------------------ ui ------------------ */
119119

120120
return (
121-
<div className="p-2 gap-4 flex flex-col">
121+
<div className=" flex flex-col">
122122
{/* Sticky Header */}
123123
<div
124-
className="gap-4 flex flex-col sticky top-0 z-20 bg-background rounded-b-xl"
124+
className="gap-2 p-2 flex flex-col sticky top-0 z-20 bg-background rounded-b"
125125
>
126126
<div className="flex justify-between">
127-
{/*
128-
<Button
129-
size="icon"
130-
variant="outline"
131-
className="rounded-full"
132-
onClick={toggleDarkMode}
133-
>
134-
{darkMode ? <LightbulbOff /> : <Lightbulb />}
135-
</Button>
136-
*/}
137-
<TagFilter
138-
tags={allTags}
139-
value={activeTags}
140-
onChange={setActiveTags}
141-
/>
142-
127+
<TagFilter
128+
tags={allTags}
129+
value={activeTags}
130+
onChange={setActiveTags}
131+
/>
143132
<SettingComponent/>
144133
</div>
145-
146134
{/* Search */}
147135
<InputGroup>
148136
<InputGroupInput
@@ -154,34 +142,11 @@ export function QuoteListPage() {
154142
<SearchIcon />
155143
</InputGroupAddon>
156144
</InputGroup>
157-
158-
{/* Tags
159-
*/}
160-
{/*
161-
<div className="flex gap-2 flex-wrap">
162-
<p>Filter by tags: </p>
163-
{[...new Set(quotesStored?.flatMap(q =>
164-
q.tags?.map(t => t.name) ?? []
165-
))].map(tag => (
166-
<Button
167-
key={tag}
168-
size="sm"
169-
variant={
170-
activeTags.includes(tag) ? 'default' : 'outline'
171-
}
172-
onClick={() => toggleTag(tag)}
173-
>
174-
{tag}
175-
</Button>
176-
))}
177-
</div>
178-
*/}
179-
180-
145+
181146
</div>
182147

183148
{/* Content */}
184-
<main>
149+
<main className="px-2">
185150
<ListQuote
186151
loading={isLoading}
187152
quotes={quotes}

‎frontend/src/page/quote/quote.page.tsx‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ import { getAllQuotes, addQuote, updateQuote, deleteQuote, getAllQuote } from '@
1818
import { addOrGetTag } from '@/db/tag.db'
1919
import { useBlocker } from "@tanstack/react-router"
2020
import ChooseBackground from "@/feature/quote/drawer/choose-background.drawer"
21-
import {ShareBackground } from "@/feature/quote/dialog/share.dialog"
22-
2321
import { toPng } from "html-to-image"
24-
import { ListTags } from "@/feature/quote/list.tags";
2522

2623
interface Props {
2724
mode: "add" | "edit";
@@ -210,8 +207,7 @@ const exportAsImage = async () => {
210207
<ArrowLeftIcon />
211208
</Button>
212209
</Link>
213-
<div className='flex gap-4 '>
214-
<ShareBackground quoteFormData={quoteData}/>
210+
<div>
215211
<ChooseBackground onValueUpdate={onValueUpdate}/>
216212
</div>
217213
</div>
@@ -229,11 +225,12 @@ const exportAsImage = async () => {
229225
(
230226
<div className="grid gap-4">
231227
<div className="grid gap-3">
228+
{/*
232229
<Label htmlFor="name-1">Quote</Label>
230+
*/}
233231
<Tiptap
234232
key={quoteData?.id ?? "new"}
235233
value={quoteData?.text}
236-
quoteFormData={quoteData}
237234
onValueUpdate={onValueUpdate} />
238235
</div>
239236
</div>
@@ -278,8 +275,6 @@ const exportAsImage = async () => {
278275

279276
</div>
280277

281-
282-
283278
{/*
284279
<Separator className=" bg-border" />
285280
*/}

‎pnpm-lock.yaml‎

Lines changed: 126 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)