Skip to content

Commit f86f006

Browse files
committed
format all files to match (mostly ' => ")
1 parent f7940d8 commit f86f006

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1380
-989
lines changed

playwright.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// playwright.config.ts
2-
import { defineConfig } from '@playwright/test'
2+
import { defineConfig } from "@playwright/test"
33

44
export default defineConfig({
5-
reporter: [['html', { open: 'never' }]],
6-
testDir: 'tests/e2e',
5+
reporter: [["html", { open: "never" }]],
6+
testDir: "tests/e2e",
77
use: {
8-
screenshot: 'only-on-failure',
9-
trace: 'retain-on-failure',
10-
video: 'retain-on-failure',
8+
screenshot: "only-on-failure",
9+
trace: "retain-on-failure",
10+
video: "retain-on-failure",
1111
},
1212
})

src/components/Badge.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { type JSX, useState } from 'react'
2-
import { twMerge } from 'tailwind-merge'
3-
import type { VariantProps } from 'tailwind-variants'
4-
import { badgeCVA, typeColors, typeIcons } from '@/components/design'
5-
import type { CommentTableRow } from '@/entrypoints/background'
1+
import { type JSX, useState } from "react"
2+
import { twMerge } from "tailwind-merge"
3+
import type { VariantProps } from "tailwind-variants"
4+
import { badgeCVA, typeColors, typeIcons } from "@/components/design"
5+
import type { CommentTableRow } from "@/entrypoints/background"
66

7-
import { CodePreview } from './BadgePopups/CodePreview'
8-
import { ImagePreview } from './BadgePopups/ImagePreview'
9-
import { LinkPreview } from './BadgePopups/LinkPreview'
10-
import { OpenTabPopup } from './BadgePopups/OpenTabPopup'
11-
import { TextPreview } from './BadgePopups/TextPreview'
12-
import { TimePreview } from './BadgePopups/TimePreview'
7+
import { CodePreview } from "./BadgePopups/CodePreview"
8+
import { ImagePreview } from "./BadgePopups/ImagePreview"
9+
import { LinkPreview } from "./BadgePopups/LinkPreview"
10+
import { OpenTabPopup } from "./BadgePopups/OpenTabPopup"
11+
import { TextPreview } from "./BadgePopups/TextPreview"
12+
import { TimePreview } from "./BadgePopups/TimePreview"
1313

1414
const typePopups = {
1515
code: CodePreview,
@@ -18,7 +18,9 @@ const typePopups = {
1818
open: OpenTabPopup,
1919
text: TextPreview,
2020
time: TimePreview,
21-
} satisfies Partial<Record<keyof typeof typeIcons, (props: BadgePopupProps) => JSX.Element>>
21+
} satisfies Partial<
22+
Record<keyof typeof typeIcons, (props: BadgePopupProps) => JSX.Element>
23+
>
2224

2325
export interface BadgePopupProps {
2426
row: CommentTableRow
@@ -34,11 +36,13 @@ const Badge = ({ text, type, data }: BadgeProps) => {
3436
const Icon = typeIcons[type]
3537
const [showTooltip, setShowTooltip] = useState(false)
3638
const PopupComponent =
37-
showTooltip && type in typePopups && typePopups[type as keyof typeof typePopups]
39+
showTooltip &&
40+
type in typePopups &&
41+
typePopups[type as keyof typeof typePopups]
3842
return (
3943
<button
40-
type='button'
41-
className='relative'
44+
type="button"
45+
className="relative"
4246
onMouseEnter={() => setShowTooltip(true)}
4347
onMouseLeave={() => setShowTooltip(false)}
4448
>
@@ -47,17 +51,17 @@ const Badge = ({ text, type, data }: BadgeProps) => {
4751
badgeCVA({
4852
clickable: type in typePopups,
4953
type,
50-
}),
54+
})
5155
)}
5256
>
53-
{type === 'blank' || <Icon className='h-3 w-3' />}
57+
{type === "blank" || <Icon className="h-3 w-3" />}
5458
{text || type}
5559
</span>
5660
{PopupComponent && data && (
5761
<div
5862
className={twMerge(
59-
'absolute top-full z-10 w-30 rounded border px-2 py-1 text-left text-xs shadow-lg',
60-
typeColors[type],
63+
"absolute top-full z-10 w-30 rounded border px-2 py-1 text-left text-xs shadow-lg",
64+
typeColors[type]
6165
)}
6266
>
6367
<PopupComponent row={data} />

src/components/BadgePopups/CodePreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function CodePreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/81' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/81"
9+
className="underline"
10+
>
811
#81
912
</a>
1013
: show every codeblock in the draft

src/components/BadgePopups/ImagePreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function ImagePreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/80' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/80"
9+
className="underline"
10+
>
811
#80
912
</a>
1013
: show every image in the draft

src/components/BadgePopups/LinkPreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function LinkPreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/79' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/79"
9+
className="underline"
10+
>
811
#79
912
</a>
1013
: show text, url, and preview info for every link in the draft

src/components/BadgePopups/OpenTabPopup.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
2-
import { openOrFocusComment } from '@/entrypoints/popup/popup'
1+
import type { BadgePopupProps } from "@/components/Badge"
2+
import { openOrFocusComment } from "@/entrypoints/popup/popup"
33

44
export function OpenTabPopup({ row }: BadgePopupProps) {
55
const handleClick = () => {
@@ -9,8 +9,8 @@ export function OpenTabPopup({ row }: BadgePopupProps) {
99
return (
1010
<button
1111
onClick={handleClick}
12-
className='w-full cursor-pointer text-left hover:bg-opacity-80'
13-
type='button'
12+
className="w-full cursor-pointer text-left hover:bg-opacity-80"
13+
type="button"
1414
>
1515
<p>Tab is already open.</p>
1616
<p>Click to activate.</p>

src/components/BadgePopups/TextPreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function TextPreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/82' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/82"
9+
className="underline"
10+
>
811
#82
912
</a>
1013
: show the syntax-highlighted markdown of the latest draft

src/components/BadgePopups/TimePreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function TimePreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/83' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/83"
9+
className="underline"
10+
>
811
#83
912
</a>
1013
: show the revision history of the comment

src/components/BulkActionsBar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ type BulkActionsBarProps = {
33
}
44
export function BulkActionsBar({ selectedIds }: BulkActionsBarProps) {
55
return (
6-
<div className='-translate-x-1/2 fixed bottom-6 left-1/2 z-50 flex transform items-center gap-3 rounded-md border border-blue-200 bg-blue-50 p-3 shadow-lg'>
7-
<span className='font-medium text-sm'>{selectedIds.size} selected</span>
8-
<button type='button' className='text-blue-600 text-sm hover:underline'>
6+
<div className="-translate-x-1/2 fixed bottom-6 left-1/2 z-50 flex transform items-center gap-3 rounded-md border border-blue-200 bg-blue-50 p-3 shadow-lg">
7+
<span className="font-medium text-sm">{selectedIds.size} selected</span>
8+
<button type="button" className="text-blue-600 text-sm hover:underline">
99
Copy
1010
</button>
11-
<button type='button' className='text-blue-600 text-sm hover:underline'>
11+
<button type="button" className="text-blue-600 text-sm hover:underline">
1212
Preview
1313
</button>
14-
<button type='button' className='text-blue-600 text-sm hover:underline'>
14+
<button type="button" className="text-blue-600 text-sm hover:underline">
1515
Discard
1616
</button>
17-
<button type='button' className='text-blue-600 text-sm hover:underline'>
17+
<button type="button" className="text-blue-600 text-sm hover:underline">
1818
Open
1919
</button>
2020
</div>

src/components/CommentRow.tsx

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Badge from '@/components/Badge'
2-
import { timeAgo } from '@/components/misc'
3-
import type { CommentTableRow } from '@/entrypoints/background'
4-
import { openOrFocusComment } from '@/entrypoints/popup/popup'
5-
import { EnhancerRegistry } from '@/lib/registries'
1+
import Badge from "@/components/Badge"
2+
import { timeAgo } from "@/components/misc"
3+
import type { CommentTableRow } from "@/entrypoints/background"
4+
import { openOrFocusComment } from "@/entrypoints/popup/popup"
5+
import { EnhancerRegistry } from "@/lib/registries"
66

77
const enhancers = new EnhancerRegistry()
88

@@ -14,60 +14,86 @@ type CommentRowProps = {
1414
handleTrash: (row: CommentTableRow) => void
1515
}
1616

17-
export function CommentRow({ row, selectedIds, toggleSelection }: CommentRowProps) {
17+
export function CommentRow({
18+
row,
19+
selectedIds,
20+
toggleSelection,
21+
}: CommentRowProps) {
1822
const enhancer = enhancers.enhancerFor(row.spot)
1923

2024
const handleTitleClick = () => {
2125
openOrFocusComment(row.spot.unique_key)
2226
}
2327
return (
24-
<tr className='hover:bg-gray-50'>
25-
<td className='px-3 py-3'>
28+
<tr className="hover:bg-gray-50">
29+
<td className="px-3 py-3">
2630
<input
27-
type='checkbox'
31+
type="checkbox"
2832
checked={selectedIds.has(row.spot.unique_key)}
2933
onChange={() => toggleSelection(row.spot.unique_key)}
30-
className='rounded'
34+
className="rounded"
3135
/>
3236
</td>
33-
<td className='px-3 py-3'>
34-
<div className='space-y-1'>
37+
<td className="px-3 py-3">
38+
<div className="space-y-1">
3539
{/* Context line */}
36-
<div className='flex items-center justify-between gap-1.5 text-gray-600 text-xs'>
37-
<div className='flex min-w-0 flex-1 items-center gap-1.5'>
40+
<div className="flex items-center justify-between gap-1.5 text-gray-600 text-xs">
41+
<div className="flex min-w-0 flex-1 items-center gap-1.5">
3842
{enhancer.tableUpperDecoration(row.spot)}
3943
</div>
40-
<div className='flex flex-shrink-0 items-center gap-1'>
44+
<div className="flex flex-shrink-0 items-center gap-1">
4145
{row.latestDraft.stats.links.length > 0 && (
42-
<Badge type='link' text={row.latestDraft.stats.links.length} data={row} />
46+
<Badge
47+
type="link"
48+
text={row.latestDraft.stats.links.length}
49+
data={row}
50+
/>
4351
)}
4452
{row.latestDraft.stats.images.length > 0 && (
45-
<Badge type='image' text={row.latestDraft.stats.images.length} data={row} />
53+
<Badge
54+
type="image"
55+
text={row.latestDraft.stats.images.length}
56+
data={row}
57+
/>
4658
)}
4759
{row.latestDraft.stats.codeBlocks.length > 0 && (
48-
<Badge type='code' text={row.latestDraft.stats.codeBlocks.length} data={row} />
60+
<Badge
61+
type="code"
62+
text={row.latestDraft.stats.codeBlocks.length}
63+
data={row}
64+
/>
4965
)}
50-
<Badge type='text' text={row.latestDraft.stats.charCount} data={row} />
51-
<Badge type='time' text={timeAgo(row.latestDraft.time)} data={row} />
52-
{row.isOpenTab && <Badge type='open' data={row} />}
66+
<Badge
67+
type="text"
68+
text={row.latestDraft.stats.charCount}
69+
data={row}
70+
/>
71+
<Badge
72+
type="time"
73+
text={timeAgo(row.latestDraft.time)}
74+
data={row}
75+
/>
76+
{row.isOpenTab && <Badge type="open" data={row} />}
5377
</div>
5478
</div>
5579

5680
{/* Title */}
57-
<div className='flex items-center gap-1'>
81+
<div className="flex items-center gap-1">
5882
<button
59-
type='button'
83+
type="button"
6084
onClick={handleTitleClick}
61-
className='cursor-pointer truncate text-left font-medium text-sm hover:underline'
85+
className="cursor-pointer truncate text-left font-medium text-sm hover:underline"
6286
>
6387
{enhancer.tableTitle(row.spot)}
6488
</button>
65-
<Badge type={row.isSent ? 'sent' : 'unsent'} />
66-
{row.isTrashed && <Badge type='trashed' />}
89+
<Badge type={row.isSent ? "sent" : "unsent"} />
90+
{row.isTrashed && <Badge type="trashed" />}
6791
</div>
6892
{/* Draft */}
69-
<div className='truncate text-sm'>
70-
<span className='text-gray-500'>{row.latestDraft.content.substring(0, 100)}</span>
93+
<div className="truncate text-sm">
94+
<span className="text-gray-500">
95+
{row.latestDraft.content.substring(0, 100)}
96+
</span>
7197
</div>
7298
</div>
7399
</td>

0 commit comments

Comments
 (0)