Skip to content

Commit 77ed19a

Browse files
committed
feat: update StatusIcon to display 'not-moderated' status and refactor usage in app and template cards
1 parent 09b6611 commit 77ed19a

5 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/components/AppCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const AppCard: React.FC<AppCardProps> = ({ app, onDelete, isDeleting, showDelete
2929
<div className="d-flex justify-content-between align-items-center mb-2">
3030
<div className="d-flex align-items-center">
3131
<StatusIcon type="created" value={formatDate(app.created_at)} id={String(app.id)} />
32-
{app.moderated && <StatusIcon type="moderated" id={String(app.id)} />}
32+
<StatusIcon type={app.moderated ? 'moderated' : 'not-moderated'} id={String(app.id)} />
3333
</div>
3434
</div>
3535
</div>

src/components/StatusIcon.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react'
22
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
3-
import { CheckCircleFill, Calendar3 } from 'react-bootstrap-icons'
3+
import { CheckCircleFill, Calendar3, Circle } from 'react-bootstrap-icons'
44

55
interface StatusIconProps {
66
/** Type of status icon to display */
7-
type: 'moderated' | 'created'
7+
type: 'moderated' | 'created' | 'not-moderated'
88
/** Value to display in the tooltip (e.g., date for 'created' type) */
99
value?: string
1010
/** Unique ID for the tooltip */
@@ -33,6 +33,12 @@ const StatusIcon: React.FC<StatusIconProps> = ({ type, value, id, size = 16 }):
3333
tooltip: 'Verified by moderators',
3434
className: 'moderation-badge',
3535
}
36+
case 'not-moderated':
37+
return {
38+
icon: <Circle className="text-secondary" size={size} />,
39+
tooltip: 'Not moderated yet',
40+
className: 'moderation-badge',
41+
}
3642
case 'created':
3743
return {
3844
icon: <Calendar3 size={size} />,

src/components/TemplateCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const TemplateCard: React.FC<TemplateCardProps> = ({ template }) => {
2828
<div className="d-flex justify-content-between align-items-center mb-2">
2929
<div className="d-flex align-items-center">
3030
<StatusIcon type="created" value={formatDate(template.created_at)} id={String(template.id)} />
31-
{template.moderated && <StatusIcon type="moderated" id={String(template.id)} />}
31+
<StatusIcon type={template.moderated ? 'moderated' : 'not-moderated'} id={String(template.id)} />
3232
</div>
3333
</div>
3434
</div>

src/pages/ViewApp.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ export function ViewApp(): React.JSX.Element {
196196
</Link>
197197
<h2 className="m-0 d-flex align-items-center">
198198
{app.name}
199-
{app.moderated && (
200-
<span className="ms-2">
201-
<StatusIcon type="moderated" id={String(app.id)} size={24} />
202-
</span>
203-
)}
199+
<span className="ms-2">
200+
<StatusIcon type={app.moderated ? 'moderated' : 'not-moderated'} id={String(app.id)} size={24} />
201+
</span>
204202
</h2>
205203
{/* Buttons for desktop view - hidden on mobile */}
206204
<div className="ms-auto d-none d-md-flex">

src/pages/ViewTemplate.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,9 @@ export function ViewTemplate(): React.JSX.Element {
131131
</Link>
132132
<h2 className="m-0 d-flex align-items-center">
133133
{template.title}
134-
{template.moderated && (
135-
<span className="ms-2">
136-
<StatusIcon type="moderated" id={String(template.id)} size={24} />
137-
</span>
138-
)}
134+
<span className="ms-2">
135+
<StatusIcon type={template.moderated ? 'moderated' : 'not-moderated'} id={String(template.id)} size={24} />
136+
</span>
139137
</h2>
140138
{isOwner && (
141139
<div className="ms-auto">

0 commit comments

Comments
 (0)