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.

Misc. tweaks

Tim Wilson5369458ba14e
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx
index 51741749c9..9aea03af44 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/add-hostname-modal.tsx
@@ -93,7 +93,7 @@ const AddHostnameForm = ({
<div className="flex items-center justify-between gap-2 border-t border-neutral-200 px-6 py-5">
<div>{processing && <LoadingDots />}</div>
- <div className="items-centerend flex gap-2">
+ <div className="flex items-center gap-2">
<Button
onClick={() => onCancel?.()}
variant="secondary"
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
index 0d7dad74cb..3ac34e7a5d 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
@@ -16,7 +16,7 @@ const OutboundDomainTrackingSection = () => {
return (
<div className="flex flex-1 flex-col rounded-lg border border-neutral-200 bg-neutral-50">
- <div className="gap-4m flex items-center justify-between p-3">
+ <div className="flex items-center justify-between gap-4 p-3">
<div className="flex min-w-0 items-center gap-4">
<div className="overflow-hidden">
<label
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
index bd93d57af2..b6134f5fe3 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
@@ -12,7 +12,7 @@ import ConnectionInstructions from "./connection-instructions";
import ConversionTrackingSection from "./conversion-tracking-section";
import OutboundDomainTrackingSection from "./outbound-domain-tracking-section";
import { SiteVisitTrackingSection } from "./site-visit-tracking-section";
-import Step, { BaseStepProps } from "./step";
+import Step, { BaseStepProps, type Step as StepType } from "./step";
import TrackLeadsGuidesSection from "./track-lead-guides-section";
import TrackSalesGuidesSection from "./track-sales-guides-section";
@@ -159,12 +159,12 @@ const SaleEventsStep = ({
};
export default function WorkspaceAnalytics() {
- const [expandedStep, setExpandedStep] = useLocalStorage<Step | null>(
+ const [expandedStep, setExpandedStep] = useLocalStorage<StepType | null>(
"analytics-settings",
"connect",
);
- const toggleStep = (step: Step) => {
+ const toggleStep = (step: StepType) => {
if (expandedStep === step) {
setExpandedStep(null);
} else {
@@ -172,7 +172,7 @@ export default function WorkspaceAnalytics() {
}
};
- const closeStep = (step: Step) => {
+ const closeStep = (step: StepType) => {
if (expandedStep === step) {
setExpandedStep(null);
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/step.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/step.tsx
index a7e51873af..50fbf87efa 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/step.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/step.tsx
@@ -7,7 +7,7 @@ import { cn, isClickOnInteractiveChild } from "@dub/utils";
import { AnimatePresence, motion } from "motion/react";
import { ReactNode } from "react";
-type Step = "connect" | "lead" | "sale";
+export type Step = "connect" | "lead" | "sale";
export type BaseStepProps = {
expanded?: boolean;
@@ -50,7 +50,7 @@ const Step = ({
{title}
</div>
{subtitle && (
- <div className="test-sm text-content-subtle font-medium">
+ <div className="text-content-subtle text-sm font-medium">
{subtitle}
</div>
)}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-sales-guides-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-sales-guides-section.tsx
index 98e96942b5..a79b1218c4 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-sales-guides-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/track-sales-guides-section.tsx
@@ -7,7 +7,7 @@ import { guides as allGuides } from "@/ui/guides/integrations";
import { GuidesMarkdown } from "@/ui/guides/markdown";
import { useSelectedGuide } from "./use-selected-guide";
-const TrackSalesGuidesSection = ({}: {}) => {
+const TrackSalesGuidesSection = () => {
const guides = allGuides.filter((guide) => guide.type === "track-sale");
const { selectedGuide, setSelectedGuide } = useSelectedGuide({ guides });
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-dynamic-guide.ts b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-dynamic-guide.ts
index a17a03e383..ffeab429af 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-dynamic-guide.ts
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-dynamic-guide.ts
@@ -8,7 +8,7 @@ export function useDynamicGuide(
{ guide }: { guide: string },
swrOpts?: SWRConfiguration,
) {
- const { guideMarkdown: guideMarkdownRaw, error } = useGuide(guide);
+ const { guideMarkdown: guideMarkdownRaw, error } = useGuide(guide, swrOpts);
const { primaryDomain } = useDomains();
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
index 005ce8c692..0fd947a5bc 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
@@ -6,6 +6,9 @@ export function useSelectedGuide({ guides }: { guides: IntegrationGuide[] }) {
const { searchParams, queryParams } = useRouterStuff();
const paramGuide = searchParams.get("guide");
+ if (guides.length === 0)
+ throw new Error("useSelectedGuide requires a non-empty guides array");
+
const [selectedGuide, setSelectedGuide] = useState<IntegrationGuide>(
guides[0],
);
diff --git a/apps/web/ui/guides/guide-selector.tsx b/apps/web/ui/guides/guide-selector.tsx
index bab20b4b3f..c38a56bcad 100644
--- a/apps/web/ui/guides/guide-selector.tsx
+++ b/apps/web/ui/guides/guide-selector.tsx
@@ -67,7 +67,7 @@ export function GuideSelector({
badge: guide.recommended ? "Recommended" : undefined,
description: guide.subtitle,
}));
- }, [guides, value]);
+ }, [guides]);
const selectedOption = useMemo(() => {
if (!value) return null;
diff --git a/apps/web/ui/guides/icons/stripe.tsx b/apps/web/ui/guides/icons/stripe.tsx
index 4091ec18bd..4ab1cf66ec 100644
--- a/apps/web/ui/guides/icons/stripe.tsx
+++ b/apps/web/ui/guides/icons/stripe.tsx
@@ -19,8 +19,8 @@ export function Stripe(props: SVGProps<SVGSVGElement>) {
stroke="#E5E5E5"
/>
<path
- fill-rule="evenodd"
- clip-rule="evenodd"
+ fillRule="evenodd"
+ clipRule="evenodd"
d="M9 11.8726L23 9V20.0943L9 23V11.9057V11.8726Z"
fill="white"
/>
diff --git a/packages/ui/src/icons/lock-small.tsx b/packages/ui/src/icons/lock-small.tsx
index 62577815c6..2992298b4c 100644
--- a/packages/ui/src/icons/lock-small.tsx
+++ b/packages/ui/src/icons/lock-small.tsx
@@ -13,11 +13,11 @@ export function LockSmall(props: SVGProps<SVGSVGElement>) {
<g clipPath="url(#clip0_2161_2140)">
<path
d="M5.5 4C5.224 4 5 3.776 5 3.5V2C5 1.44867 4.55133 1 4 1C3.44867 1 3 1.44867 3 2V3.5C3 3.776 2.776 4 2.5 4C2.224 4 2 3.776 2 3.5V2C2 0.897333 2.89733 0 4 0C5.10267 0 6 0.897333 6 2V3.5C6 3.776 5.776 4 5.5 4Z"
- fill="black"
+ fill="currentColor"
/>
<path
d="M6.16665 3H1.83331C1.00598 3 0.333313 3.67267 0.333313 4.5V6.5C0.333313 7.32733 1.00598 8 1.83331 8H6.16665C6.99398 8 7.66665 7.32733 7.66665 6.5V4.5C7.66665 3.67267 6.99398 3 6.16665 3ZM4.49998 5.83333C4.49998 6.10933 4.27598 6.33333 3.99998 6.33333C3.72398 6.33333 3.49998 6.10933 3.49998 5.83333V5.16667C3.49998 4.89067 3.72398 4.66667 3.99998 4.66667C4.27598 4.66667 4.49998 4.89067 4.49998 5.16667V5.83333Z"
- fill="black"
+ fill="currentColor"
/>
</g>
<defs>
diff --git a/packages/utils/src/functions/index.ts b/packages/utils/src/functions/index.ts
index 5ea4ca5f59..a0a17a2b42 100644
--- a/packages/utils/src/functions/index.ts
+++ b/packages/utils/src/functions/index.ts
@@ -30,7 +30,6 @@ export * from "./regex-escape";
export * from "./resize-image";
export * from "./smart-truncate";
export * from "./stable-sort";
-export * from "./text-fetcher";
export * from "./time-ago";
export * from "./trim";
export * from "./truncate";
diff --git a/packages/utils/src/functions/text-fetcher.ts b/packages/utils/src/functions/text-fetcher.ts
deleted file mode 100644
index 02b81f5114..0000000000
--- a/packages/utils/src/functions/text-fetcher.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-interface SWRError extends Error {
- info: any;
- status: number;
-}
-
-export async function textFetcher(
- input: RequestInfo,
- init?: RequestInit & { headers?: Record<string, string> },
-): Promise<string> {
- const res = await fetch(input, {
- ...init,
- ...(init?.headers && { headers: init.headers }),
- });
-
- if (!res.ok) {
- const message =
- (await res.json())?.error?.message ||
- "An error occurred while fetching the data.";
- const error = new Error(message) as SWRError;
- error.info = message;
- error.status = res.status;
-
- throw error;
- }
-
- return res.text();
-}