formkit / tempo

📆 Parse, format, manipulate, and internationalize dates and times in JavaScript and TypeScript.
https://tempo.formkit.com
MIT License
2.37k stars 33 forks source link

[Feature]: Add Theme toggle in `Header` #20

Closed hrynevychroman closed 8 months ago

hrynevychroman commented 8 months ago

This PR fixes #8

Added Select for change All new Date() code variables to custom, default value is new Date() previously:

image

Added Theme DropDown so we can dynamically change theme on site:

image

Resolve issue with logical understanding of this comment https://github.com/formkit/tempo/issues/8#issuecomment-1960649906:

image

All UI elements was added from https://github.com/radix-vue/shadcn-vue to ship it fast and with no errors 🙂

vercel[bot] commented 8 months ago

@romanhrynevych is attempting to deploy a commit to the Formkit Team on Vercel.

A member of the Team first needs to authorize it.

justin-schroeder commented 8 months ago

Appreciate all the work here @romanhrynevych – for the most part this looks good — although im not sure we really want new Date() to resolve to a user selected value instead of the current active time — my intuition is that might be more confusing for users. I think #8 would be better resolved by using a few explicit values here:

image

This will also save a bunch on page weight since we wont need a datepicker. Also, FWIW, if we were going to use a datepicker, we’d use FormKit’s: https://formkit.com/inputs/datepicker which actually uses Tempo to power it.

So in summary, if you break this up into 2 small PRs I’ll gladly merged:

  1. Light mode/dark mode toggle.
  2. A few hard-coded times in the example.

Thanks!

hrynevychroman commented 8 months ago

@justin-schroeder this PR will fix your first issue with

  1. Light mode/dark mode toggle.
justin-schroeder commented 8 months ago

Sorry friend — haha — just don’t think I really want to add shadcn and all the related css and ~30 components to make that dropdown. Can we just do a little hand coding for that one?

hrynevychroman commented 8 months ago

Sorry friend — haha — just don’t think I really want to add shadcn and all the related css and ~30 components to make that dropdown. Can we just do a little hand coding for that one?

ah, ok, I will remove shadcn and add native css select

hrynevychroman commented 8 months ago

@justin-schroeder removed shadcn, add ToggleButton in SuperHeader

image image
vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tempo-docs ❌ Failed (Inspect) Feb 23, 2024 8:04pm
justin-schroeder commented 8 months ago

@romanhrynevych looks like it needs an pnpm install and commit of the lockfile