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.

simplify SmartDateTimePicker className

Steven Teya33f88d8083e
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/campaigns/[campaignId]/campaign-editor.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/campaigns/[campaignId]/campaign-editor.tsx
index 0b7267a464..6974b184d7 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/campaigns/[campaignId]/campaign-editor.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/campaigns/[campaignId]/campaign-editor.tsx
@@ -418,7 +418,7 @@ export function CampaignEditor({ campaign }: { campaign: Campaign }) {
value={field.value}
onChange={field.onChange}
placeholder='E.g. "tomorrow at 5pm" or "in 2 hours"'
- className="[&>div]:hover:border-border-subtle [&>div]:mt-0 [&>div]:h-8 [&>div]:min-h-8 [&>div]:border-transparent [&>div]:shadow-none [&>div]:focus-within:border-black/75 [&>div]:focus-within:ring-black/75 [&>div]:hover:cursor-pointer [&>div]:hover:bg-neutral-100"
+ className="hover:border-border-subtle mt-0 h-8 min-h-8 border-transparent shadow-none focus-within:border-black/75 focus-within:ring-black/75 hover:cursor-pointer hover:bg-neutral-100"
/>
</DisabledInputWrapper>
)}
diff --git a/packages/ui/src/smart-datetime-picker.tsx b/packages/ui/src/smart-datetime-picker.tsx
index e9f6d8b415..f6ef1a7247 100644
--- a/packages/ui/src/smart-datetime-picker.tsx
+++ b/packages/ui/src/smart-datetime-picker.tsx
@@ -1,4 +1,9 @@
-import { formatDateTime, getDateTimeLocal, parseDateTime } from "@dub/utils";
+import {
+ cn,
+ formatDateTime,
+ getDateTimeLocal,
+ parseDateTime,
+} from "@dub/utils";
import { useEffect, useId, useRef } from "react";
interface SmartDateTimePickerProps {
@@ -33,7 +38,7 @@ export function SmartDateTimePicker({
}, [autoFocus]);
return (
- <div className={className}>
+ <div className="flex flex-col gap-2">
{label && (
<div className="flex items-center gap-2">
<label
@@ -44,7 +49,12 @@ export function SmartDateTimePicker({
</label>
</div>
)}
- <div className="mt-2 flex w-full items-center justify-between rounded-md border border-neutral-300 bg-white shadow-sm transition-all focus-within:border-neutral-800 focus-within:outline-none focus-within:ring-1 focus-within:ring-neutral-500">
+ <div
+ className={cn(
+ "flex w-full items-center justify-between rounded-md border border-neutral-300 bg-white shadow-sm transition-all focus-within:border-neutral-800 focus-within:outline-none focus-within:ring-1 focus-within:ring-neutral-500",
+ className,
+ )}
+ >
<input
ref={inputRef}
id={`${id}-datetime`}