Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add shadcn/ui; create navbar; implement calendar #17

Merged
merged 38 commits into from
Jul 13, 2024

Conversation

d4vidsha
Copy link
Owner

@d4vidsha d4vidsha commented Jul 1, 2024

Changes

  • Replace Chakra UI with own UI library utilising a lot from shadcn/ui.
  • Implement dark mode using shadcn/ui Vite tutorial.
  • Create storybook for Spinner component among others.
  • Create navbar equivalent which replaces existing sidebar navigator.
  • Create user menu equivalent using shadcn/ui components.
  • Make calendar tab full width.
  • Make calendar dark mode.
  • Automatically switch theme using an event listener.
  • Make calendar functional using date-fns library.

@d4vidsha d4vidsha self-assigned this Jul 1, 2024
@d4vidsha d4vidsha added the enhancement New feature or request label Jul 6, 2024
@d4vidsha d4vidsha changed the title feat: add shadcn/ui feat: add shadcn/ui; create navbar; implement calendar Jul 6, 2024
@d4vidsha d4vidsha mentioned this pull request Jul 6, 2024
@d4vidsha
Copy link
Owner Author

d4vidsha commented Jul 6, 2024

Most changes in latest commit follows this pattern:

text-gray-900 => text-foreground 
bg-white => bg-card
border-gray-300 => NOTHING
border-gray-200 => NOTHING
border-gray-100 => NOTHING
divide-gray-100 => NOTHING
text-gray-400 hover:text-gray-500 => text-accent-foreground
[NOT DOING] text-gray-400 => text-accent-foreground
bg-gray-50 => bg-accent
bg-gray-300 => bg-muted

Both the x-axis (dates) and y-axis (times) now reflect the current
calendar by default. It uses the date-fns library to get "today" and any
surrounding days. Do note that days with less than 24 hours (e.g. from
daylight savings) have not been tested yet and is an edge case that has
been ignored for the time-being.
Given an id, title, start time and duration, the calendar events will be
displayed on the calendar page. As of now, the calendar events are
mocked to be scheduled on the current day of the week. In future, this
can easily be modified. Additionally, the mobile view now reflects the
current week.
@d4vidsha
Copy link
Owner Author

@ichirodev I saw your message from the stream, this is the current working branch which you can check out!

We replace the Menu from Tailwind's Headless UI with Radix UI equivalent
using our own components taken from shadcn/ui. This commit adds state
for the different views (i.e. day, week, month and year views).
Creating this component follows best practices of TypeScript React. This
is technically considered my first ever conscious commit with passing
down props to a React component. I have ensured to use the correct types
in the associated `ViewMenuProps` interface.
https://tailwindcss.com/docs/content-configuration#dynamic-class-names
As per the link above, dynamic classnames during previous implementation
was flawed and failed to generate those css classes. To remedy this, we
use a new columnPosition array that contains all the iterable
classnames, such as col-start-1, col-start-2, etc.
This is a very rudimentary approach taken. It can work for most cases
but edge cases have not been considered. For example, the day of the
month may sometimes be correct and other times incorrect. We can
implement that a little later down the line. In this commit, we also
minify the three-dot dropdown menu using shadcn/ui components and
removing our dependence on Tailwind's Headless UI and Heroicons.
The brand icon was updated to the first calendar icon found online. In
future, if things take off we can change this to something that's
better. Additionally, we now have new sections in README.md: "Repository
Activity", "Star History", and login credentials for the demo. There is
also a new table of contents and motive for the app.
@d4vidsha d4vidsha marked this pull request as ready for review July 13, 2024 10:04
@d4vidsha d4vidsha merged commit fda92df into main Jul 13, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant