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.

Fix keyboard shortcuts

Tim Wilson7efc2b4aef65
diff --git a/apps/web/lib/analytics/constants.ts b/apps/web/lib/analytics/constants.ts
index 1c5922c923..18e5eb2ae4 100644
--- a/apps/web/lib/analytics/constants.ts
+++ b/apps/web/lib/analytics/constants.ts
@@ -15,32 +15,32 @@ export const INTERVAL_DISPLAYS = [
{
display: "Last 24 hours",
value: "24h",
- shortcut: "D",
+ shortcut: "d",
},
{
display: "Last 7 days",
value: "7d",
- shortcut: "W",
+ shortcut: "w",
},
{
display: "Last 30 days",
value: "30d",
- shortcut: "M",
+ shortcut: "m",
},
{
display: "Last 3 months",
value: "90d",
- shortcut: "T",
+ shortcut: "t",
},
{
display: "Year to Date",
value: "ytd",
- shortcut: "Y",
+ shortcut: "y",
},
{
display: "Last 12 months",
value: "1y",
- shortcut: "L",
+ shortcut: "l",
},
{
display: "All Time",
diff --git a/packages/ui/src/date-picker/presets.tsx b/packages/ui/src/date-picker/presets.tsx
index c8a5dc8f8b..d8553e466b 100644
--- a/packages/ui/src/date-picker/presets.tsx
+++ b/packages/ui/src/date-picker/presets.tsx
@@ -74,14 +74,8 @@ const Presets = <TPreset extends Preset, TValue>({
.filter((preset) => preset.shortcut)
.map((preset) => preset.shortcut) as string[],
(e) => {
- console.log("shortcut", e.key);
const preset = presets.find((preset) => preset.shortcut === e.key);
- if (preset) {
- onSelect(preset);
- }
- },
- {
- enabled: true,
+ if (preset) onSelect(preset);
},
);
@@ -114,7 +108,7 @@ const Presets = <TPreset extends Preset, TValue>({
<Lock className="h-3.5 w-3.5" aria-hidden="true" />
) : preset.shortcut ? (
<kbd className="text-gray-4000 rounded bg-gray-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-gray-200">
- {preset.shortcut}
+ {preset.shortcut.toUpperCase()}
</kbd>
) : null}
{preset.requiresUpgrade && preset.tooltipContent && (