generated from include-davis/Next.js-App-Router-Starter
-
Notifications
You must be signed in to change notification settings - Fork 2
377 backend schedule logic fix #421
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4faebc0
put may 9 and may 10 events on same page but different sections, chan…
hadiafifah 05d8e46
Add my code for home page schedule fetching
ReehalS 3f079d9
The first comment
ReehalS 3e534aa
fixed second sub issue
hadiafifah e0b7940
refactored page.tsx and split into reusable components
hadiafifah 48bb990
added day nav button animation
hadiafifah 335b9ea
moved hooks
michelleyeoh 1d87401
merge branch of main
michelleyeoh cbe82ea
comment out images temp
michelleyeoh b536d03
Merge branch 'main' of https://github.com/HackDavis/hackdavis-hub int…
michelleyeoh bbe08b9
Merge branch 'main' of https://github.com/HackDavis/hackdavis-hub int…
michelleyeoh d98b173
moved type file
michelleyeoh f558cde
update ui to figma reqests
michelleyeoh e82bce0
address fixes
michelleyeoh 42707f7
typo and remove border
michelleyeoh 3a946f6
add shared now hook and fix fixes
michelleyeoh 0c66556
update now time caculation to pst
michelleyeoh a20dfac
ts fix
michelleyeoh a5aa451
margin fix
michelleyeoh 3f63544
remove dedundant hook call
michelleyeoh 2a1c7ea
added more margin
michelleyeoh 728c81e
save event seconds and populate events
michelleyeoh f2ba101
revert loading condition
michelleyeoh fc1754a
update pst weekend and hard coded 9
michelleyeoh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/(pages)/(hackers)/_components/Schedule/DayNavButtons.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import { useState } from 'react'; | ||
| import { DAY_KEYS, DAY_LABELS, DayKey } from './constants'; | ||
|
|
||
| interface DayNavButtonsProps { | ||
| activeDay: DayKey; | ||
| onSelectDay: (day: DayKey) => void; | ||
| className?: string; | ||
| buttonClassName?: string; | ||
| } | ||
|
|
||
| export default function DayNavButtons({ | ||
| activeDay, | ||
| onSelectDay, | ||
| className, | ||
| buttonClassName, | ||
| }: DayNavButtonsProps) { | ||
| const [hoveredDay, setHoveredDay] = useState<DayKey | null>(null); | ||
| const previewDay = | ||
| hoveredDay && hoveredDay !== activeDay ? hoveredDay : activeDay; | ||
|
|
||
| return ( | ||
| <div className={className}> | ||
| {DAY_KEYS.map((dayKey) => ( | ||
| <button | ||
| key={dayKey} | ||
| onClick={() => onSelectDay(dayKey)} | ||
| onMouseEnter={() => setHoveredDay(dayKey)} | ||
| onMouseLeave={() => setHoveredDay(null)} | ||
| onFocus={() => setHoveredDay(dayKey)} | ||
| onBlur={() => setHoveredDay(null)} | ||
| type="button" | ||
| className={`relative w-fit bg-transparent border-none p-0 text-left font-dm-mono text-base md:text-lg font-medium tracking-[0.36px] leading-[100%] inline-flex items-center ${ | ||
| activeDay === dayKey ? 'text-[#3F3F3F]' : 'text-[#ACACB9]' | ||
| } ${buttonClassName ?? ''}`} | ||
| > | ||
| <span | ||
| className={`hidden md:block absolute left-0 top-1/2 -translate-y-1/2 origin-left transition-all duration-200 ease-out ${ | ||
| previewDay === dayKey | ||
| ? 'scale-x-100 opacity-100' | ||
| : 'scale-x-0 opacity-0' | ||
| }`} | ||
| aria-hidden | ||
| > | ||
| {'\u2022'} | ||
| </span> | ||
| <span className="font-dm-mono pl-5">{DAY_LABELS[dayKey]}</span> | ||
| </button> | ||
| ))} | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.