Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Code formatting updates across web app and UI packages

Kiran K668a2ceab6e2
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
index 454365ce22..9db7d85c9b 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
@@ -4,11 +4,11 @@ import { mutatePrefix } from "@/lib/swr/mutate";
import { PartnerProps } from "@/lib/types";
import { useConfirmModal } from "@/ui/modals/confirm-modal";
import { CountryCombobox } from "@/ui/partners/country-combobox";
-import { useCountryChangeWarningModal } from "@/ui/partners/use-country-change-warning-modal";
import {
PartnerPlatformsForm,
usePartnerPlatformsForm,
} from "@/ui/partners/partner-platforms-form";
+import { useCountryChangeWarningModal } from "@/ui/partners/use-country-change-warning-modal";
import { CustomToast } from "@/ui/shared/custom-toast";
import { AlertCircleFill } from "@/ui/shared/icons";
import { PartnerProfileType } from "@dub/prisma/client";
diff --git a/apps/web/app/api/ai/sync-embeddings/fetch-plausible-pageviews.ts b/apps/web/app/api/ai/sync-embeddings/fetch-plausible-pageviews.ts
index 6c3773f543..a15a501719 100644
--- a/apps/web/app/api/ai/sync-embeddings/fetch-plausible-pageviews.ts
+++ b/apps/web/app/api/ai/sync-embeddings/fetch-plausible-pageviews.ts
@@ -22,10 +22,13 @@ export async function fetchPlausiblePageviews(): Promise<Map<string, number>> {
date_range: "12mo",
dimensions: ["event:page"],
filters: [
- ["or", [
- ["contains", "event:page", ["/docs"]],
- ["contains", "event:page", ["/help"]],
- ]],
+ [
+ "or",
+ [
+ ["contains", "event:page", ["/docs"]],
+ ["contains", "event:page", ["/help"]],
+ ],
+ ],
],
}),
});
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty/bounty-criteria-manual-submission.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty/bounty-criteria-manual-submission.tsx
index 8f518cf9a3..98352ff4a9 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty/bounty-criteria-manual-submission.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty/bounty-criteria-manual-submission.tsx
@@ -13,8 +13,8 @@ import {
InlineBadgePopoverMenu,
} from "@/ui/shared/inline-badge-popover";
import { Button, MoneyBills2, NumberStepper, Switch } from "@dub/ui";
-import { motion } from "motion/react";
import { cn, currencyFormatter } from "@dub/utils";
+import { motion } from "motion/react";
import { Controller } from "react-hook-form";
import { BountyAmountInput } from "./bounty-amount-input";
import { useBountyFormContext } from "./bounty-form-context";
@@ -185,7 +185,10 @@ export function BountyCriteriaManualSubmission() {
<motion.div
className="overflow-hidden"
initial={false}
- animate={{ height: requireImage ? "auto" : 0, opacity: requireImage ? 1 : 0 }}
+ animate={{
+ height: requireImage ? "auto" : 0,
+ opacity: requireImage ? 1 : 0,
+ }}
transition={{
height: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
opacity: { duration: 0.2 },
@@ -229,7 +232,10 @@ export function BountyCriteriaManualSubmission() {
<motion.div
className="overflow-hidden"
initial={false}
- animate={{ height: requireUrl ? "auto" : 0, opacity: requireUrl ? 1 : 0 }}
+ animate={{
+ height: requireUrl ? "auto" : 0,
+ opacity: requireUrl ? 1 : 0,
+ }}
transition={{
height: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
opacity: { duration: 0.2 },
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/groups-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/groups-table.tsx
index 1926a50428..9ad8bb7fe8 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/groups-table.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/groups-table.tsx
@@ -161,10 +161,7 @@ export function GroupsTable() {
enableHiding: false,
header: () => <EditColumnsButton table={table} />,
cell: ({ row }) => (
- <RowMenuButton
- row={row}
- currentDefaultGroup={currentDefaultGroup}
- />
+ <RowMenuButton row={row} currentDefaultGroup={currentDefaultGroup} />
),
},
],
@@ -343,15 +340,15 @@ function RowMenuButton({
}}
disabledTooltip={permissionsError || undefined}
/>
- <MenuItem
- icon={Trash}
- label="Delete group"
- variant="danger"
- onSelect={() => setShowDeleteGroupModal(true)}
- disabledTooltip={permissionsError || undefined}
- />
- </>
- )}
+ <MenuItem
+ icon={Trash}
+ label="Delete group"
+ variant="danger"
+ onSelect={() => setShowDeleteGroupModal(true)}
+ disabledTooltip={permissionsError || undefined}
+ />
+ </>
+ )}
</Command.Group>
</Command.List>
</Command>
diff --git a/apps/web/ui/modals/confirm-set-default-group-modal.tsx b/apps/web/ui/modals/confirm-set-default-group-modal.tsx
index a8a31db7b2..36d108af4c 100644
--- a/apps/web/ui/modals/confirm-set-default-group-modal.tsx
+++ b/apps/web/ui/modals/confirm-set-default-group-modal.tsx
@@ -63,9 +63,7 @@ function ConfirmSetDefaultGroupModal({
/>
<div className="relative flex items-center justify-center gap-4">
<div className="flex items-center gap-2">
- <GroupColorCircle
- group={currentDefaultGroup}
- />
+ <GroupColorCircle group={currentDefaultGroup} />
<span className="text-content-emphasis text-sm font-medium">
{currentDefaultGroup.name}
</span>
@@ -126,7 +124,10 @@ export function useConfirmSetDefaultGroupModal() {
[],
);
- const closeConfirmSetDefaultGroupModal = useCallback(() => setState(null), []);
+ const closeConfirmSetDefaultGroupModal = useCallback(
+ () => setState(null),
+ [],
+ );
return {
openConfirmSetDefaultGroupModal,
diff --git a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx b/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
index 2e615e0db7..6d03baaa34 100644
--- a/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
+++ b/apps/web/ui/partners/bounties/claim-bounty-modal.tsx
@@ -180,11 +180,9 @@ function ClaimBountyModalContent({ bounty }: ClaimBountyModalProps) {
// Get max values from bounty submission requirements, fallback to constants
const imageMax = bounty.submissionRequirements?.image?.max;
- const maxFiles =
- imageMax ?? BOUNTY_MAX_SUBMISSION_FILES;
+ const maxFiles = imageMax ?? BOUNTY_MAX_SUBMISSION_FILES;
const urlMax = bounty.submissionRequirements?.url?.max;
- const maxUrls =
- urlMax ?? BOUNTY_MAX_SUBMISSION_URLS;
+ const maxUrls = urlMax ?? BOUNTY_MAX_SUBMISSION_URLS;
const formatRequirementText = (max?: number | null) =>
max != null && max > 1 ? ` (1 required, max of ${max})` : " (1 required)";
diff --git a/apps/web/ui/partners/use-country-change-warning-modal.tsx b/apps/web/ui/partners/use-country-change-warning-modal.tsx
index e624f42332..1da7d2a8ac 100644
--- a/apps/web/ui/partners/use-country-change-warning-modal.tsx
+++ b/apps/web/ui/partners/use-country-change-warning-modal.tsx
@@ -26,7 +26,7 @@ export function useCountryChangeWarningModal() {
setShowModal={setShowModalState}
onClose={handleCancel}
>
- <div className="border-border-subtle bg-white border-b p-5 text-left">
+ <div className="border-border-subtle border-b bg-white p-5 text-left">
<h3 className="text-content-emphasis text-base font-semibold">
Updating your country
</h3>
@@ -34,9 +34,9 @@ export function useCountryChangeWarningModal() {
<div className="text-content-subtle bg-neutral-50 p-5 text-sm">
<p>
- You must select the country where you legally reside for tax
- purposes. Providing incorrect information may result in account
- suspension, loss of payouts, and legal action.
+ You must select the country where you legally reside for tax purposes.
+ Providing incorrect information may result in account suspension, loss
+ of payouts, and legal action.
</p>
<p className="mt-4">
Dub is not responsible for legal or tax consequences resulting from
@@ -44,7 +44,7 @@ export function useCountryChangeWarningModal() {
</p>
</div>
- <div className="border-border-subtle bg-neutral-50 flex items-center justify-end gap-2 border-t px-5 py-4">
+ <div className="border-border-subtle flex items-center justify-end gap-2 border-t bg-neutral-50 px-5 py-4">
<Button
variant="secondary"
className="h-8 w-fit px-3"
@@ -66,13 +66,10 @@ export function useCountryChangeWarningModal() {
setShowModalState(true);
}, []);
- const acknowledgeAndContinue = useCallback(
- (callback?: () => void) => {
- onAcknowledgeRef.current = callback ?? null;
- setShowModalState(true);
- },
- [],
- );
+ const acknowledgeAndContinue = useCallback((callback?: () => void) => {
+ onAcknowledgeRef.current = callback ?? null;
+ setShowModalState(true);
+ }, []);
return {
modal,
diff --git a/apps/web/ui/support/chat-bubble.tsx b/apps/web/ui/support/chat-bubble.tsx
index d31403ad99..272691af08 100644
--- a/apps/web/ui/support/chat-bubble.tsx
+++ b/apps/web/ui/support/chat-bubble.tsx
@@ -20,7 +20,7 @@ export function SupportChatBubble() {
if (session?.user?.["id"]) {
try {
localStorage.removeItem(`dub-support-chat:${session.user["id"]}`);
- } catch { }
+ } catch {}
}
setResetKey((k) => k + 1);
};
diff --git a/apps/web/ui/support/chat-interface.tsx b/apps/web/ui/support/chat-interface.tsx
index 1f087eb475..698fd96118 100644
--- a/apps/web/ui/support/chat-interface.tsx
+++ b/apps/web/ui/support/chat-interface.tsx
@@ -100,7 +100,7 @@ export function ChatInterface({
if (stored.selection) setSelection(stored.selection);
if (stored.messages?.length) setMessages(stored.messages);
if (stored.ticketSubmitted) setTicketSubmitted(true);
- } catch { }
+ } catch {}
}, [storageKey, setMessages]);
useEffect(() => {
@@ -113,7 +113,7 @@ export function ChatInterface({
storageKey,
JSON.stringify({ ...stored, selection }),
);
- } catch { }
+ } catch {}
}, [selection, storageKey]);
useEffect(() => {
@@ -126,14 +126,14 @@ export function ChatInterface({
storageKey,
JSON.stringify({ ...stored, messages, ticketSubmitted }),
);
- } catch { }
+ } catch {}
}, [messages, ticketSubmitted, status, storageKey]);
const clearPersistedSession = () => {
if (storageKey) {
try {
localStorage.removeItem(storageKey);
- } catch { }
+ } catch {}
}
};
@@ -428,8 +428,8 @@ export function ChatInterface({
status === "streaming" && index === messages.length - 1;
const sources = !isCurrentlyStreaming
? extractSources(
- message.parts as { type: string;[key: string]: unknown }[],
- )
+ message.parts as { type: string; [key: string]: unknown }[],
+ )
: [];
const hasTextPart = message.parts?.some(
@@ -445,11 +445,7 @@ export function ChatInterface({
if (!hasVisibleContent && !message.parts?.length) return null;
return (
- <SupportMessage
- key={message.id}
- avatar={assistantAvatar}
- animate
- >
+ <SupportMessage key={message.id} avatar={assistantAvatar} animate>
{!hasVisibleContent ? (
(() => {
const isCreatingTicket = message.parts?.some(
diff --git a/apps/web/ui/support/code-block.tsx b/apps/web/ui/support/code-block.tsx
index b42dac1902..cd26fcde0a 100644
--- a/apps/web/ui/support/code-block.tsx
+++ b/apps/web/ui/support/code-block.tsx
@@ -1,7 +1,7 @@
"use client";
-import { cn } from "@dub/utils";
import { Check, Copy, Download } from "@dub/ui/icons";
+import { cn } from "@dub/utils";
import {
isValidElement,
useCallback,
@@ -52,20 +52,43 @@ async function highlightCode(
}
const LANG_EXTENSIONS: Record<string, string> = {
- javascript: "js", js: "js",
- typescript: "ts", ts: "ts",
- tsx: "tsx", jsx: "jsx",
- python: "py", py: "py",
- bash: "sh", sh: "sh", shell: "sh", shellscript: "sh", zsh: "zsh",
- ruby: "rb", rb: "rb",
- go: "go", rust: "rs", rs: "rs",
- css: "css", scss: "scss", sass: "sass",
- html: "html", xml: "xml",
- json: "json", yaml: "yaml", yml: "yml",
- toml: "toml", sql: "sql",
- php: "php", java: "java", kotlin: "kt", swift: "swift",
- c: "c", cpp: "cpp", cs: "cs",
- markdown: "md", md: "md",
+ javascript: "js",
+ js: "js",
+ typescript: "ts",
+ ts: "ts",
+ tsx: "tsx",
+ jsx: "jsx",
+ python: "py",
+ py: "py",
+ bash: "sh",
+ sh: "sh",
+ shell: "sh",
+ shellscript: "sh",
+ zsh: "zsh",
+ ruby: "rb",
+ rb: "rb",
+ go: "go",
+ rust: "rs",
+ rs: "rs",
+ css: "css",
+ scss: "scss",
+ sass: "sass",
+ html: "html",
+ xml: "xml",
+ json: "json",
+ yaml: "yaml",
+ yml: "yml",
+ toml: "toml",
+ sql: "sql",
+ php: "php",
+ java: "java",
+ kotlin: "kt",
+ swift: "swift",
+ c: "c",
+ cpp: "cpp",
+ cs: "cs",
+ markdown: "md",
+ md: "md",
};
function CopyButton({ code }: { code: string }) {
diff --git a/apps/web/ui/support/message.tsx b/apps/web/ui/support/message.tsx
index 272c00c881..a5e8341b8a 100644
--- a/apps/web/ui/support/message.tsx
+++ b/apps/web/ui/support/message.tsx
@@ -53,7 +53,7 @@ export function SupportMessage({
className={cn(
"text-sm",
isUser &&
- "rounded-2xl rounded-br bg-neutral-900 px-3 py-2 text-white",
+ "rounded-2xl rounded-br bg-neutral-900 px-3 py-2 text-white",
)}
>
{children}
diff --git a/apps/web/ui/support/program-combobox.tsx b/apps/web/ui/support/program-combobox.tsx
index fbff2c5467..cc9243c311 100644
--- a/apps/web/ui/support/program-combobox.tsx
+++ b/apps/web/ui/support/program-combobox.tsx
@@ -67,7 +67,9 @@ export function ProgramCombobox({
placeholder={isReady ? "Select program" : ""}
searchPlaceholder="Search programs..."
matchTriggerWidth
- popoverProps={{ contentClassName: "w-[var(--radix-popover-trigger-width)]" }}
+ popoverProps={{
+ contentClassName: "w-[var(--radix-popover-trigger-width)]",
+ }}
open={open}
onOpenChange={setOpen}
buttonProps={{
diff --git a/apps/web/ui/support/source-citations.tsx b/apps/web/ui/support/source-citations.tsx
index 65ccb73e9c..900a35fe79 100644
--- a/apps/web/ui/support/source-citations.tsx
+++ b/apps/web/ui/support/source-citations.tsx
@@ -64,12 +64,11 @@ export function SourceCitations({ sources }: { sources: SourceCitation[] }) {
}
export function extractSources(
- parts: { type: string;[key: string]: unknown }[],
+ parts: { type: string; [key: string]: unknown }[],
): SourceCitation[] {
const seen = new Set<string>();
const sources: SourceCitation[] = [];
-
for (const part of parts) {
if (part.type !== "tool-findRelevantDocs") continue;
if ((part as any).state !== "output-available") continue;
diff --git a/apps/web/ui/support/status-indicator.tsx b/apps/web/ui/support/status-indicator.tsx
index 3b80f5b2fb..174b8f33b4 100644
--- a/apps/web/ui/support/status-indicator.tsx
+++ b/apps/web/ui/support/status-indicator.tsx
@@ -9,12 +9,7 @@ type StatusIndicatorProps = {
export function StatusIndicator({ label, className }: StatusIndicatorProps) {
return (
- <span
- className={cn(
- "animate-pulse text-xs text-neutral-400",
- className,
- )}
- >
+ <span className={cn("animate-pulse text-xs text-neutral-400", className)}>
{label}
</span>
);
diff --git a/apps/web/ui/support/ticket-upload.tsx b/apps/web/ui/support/ticket-upload.tsx
index 85ed7cef67..b4964628d6 100644
--- a/apps/web/ui/support/ticket-upload.tsx
+++ b/apps/web/ui/support/ticket-upload.tsx
@@ -143,7 +143,7 @@ export function TicketUpload({
if (submitted) {
return (
- <div className="flex items-center gap-3 pb-3 px-3">
+ <div className="flex items-center gap-3 px-3 pb-3">
<div className="flex size-6 shrink-0 items-center justify-center rounded-full bg-green-100 text-xs font-bold text-green-600">
✓
</div>
@@ -184,9 +184,7 @@ export function TicketUpload({
</div>
<div className="flex items-center justify-between">
- <p className="text-xs font-medium text-neutral-500">
- Attachments
- </p>
+ <p className="text-xs font-medium text-neutral-500">Attachments</p>
<p className="text-xs text-neutral-400">
Images, PDF · max {MAX_FILE_SIZE_MB}MB · up to {MAX_FILES} files
</p>
diff --git a/apps/web/ui/support/workspace-combobox.tsx b/apps/web/ui/support/workspace-combobox.tsx
index 9647ee650f..f91d33e106 100644
--- a/apps/web/ui/support/workspace-combobox.tsx
+++ b/apps/web/ui/support/workspace-combobox.tsx
@@ -58,7 +58,9 @@ export function WorkspaceCombobox({
placeholder={workspaces === undefined ? "" : "Select workspace"}
searchPlaceholder="Search workspaces..."
matchTriggerWidth
- popoverProps={{ contentClassName: "w-[var(--radix-popover-trigger-width)]" }}
+ popoverProps={{
+ contentClassName: "w-[var(--radix-popover-trigger-width)]",
+ }}
open={open}
onOpenChange={setOpen}
buttonProps={{
diff --git a/packages/ui/src/carousel/nav-bar.tsx b/packages/ui/src/carousel/nav-bar.tsx
index 58e6256c8e..25ad5ac19b 100644
--- a/packages/ui/src/carousel/nav-bar.tsx
+++ b/packages/ui/src/carousel/nav-bar.tsx
@@ -89,8 +89,8 @@ export const CarouselNavBar = ({
transition={{
type: "tween",
duration:
- (autoplay?.options.delay ?? AUTOPLAY_DEFAULT_DELAY) as number /
- 1000,
+ ((autoplay?.options.delay ??
+ AUTOPLAY_DEFAULT_DELAY) as number) / 1000,
}}
className="animate-fill-width h-full w-full rounded-full bg-black"
/>