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

ui/ux: update week page #370

Merged
merged 11 commits into from
Jul 10, 2024
Merged

Conversation

ryandotfurrer
Copy link
Member

Closes #353

Image

  • Create breadcrumb link
  • Update Page title to Week #
  • Add date and times to each game above the teams
  • Remove submit button in favor of user clicking any team to submit their choice

ryandotfurrer and others added 7 commits July 2, 2024 21:24
… and altered linkcustom component

LinkCustom component accepted a prop of `children` that previsusly only accepted a type of `string`. I've updated this accept a type of React.ReactNode so passing icons as children would not throw an error.
… submit so it would send it's data to the database
@ryandotfurrer ryandotfurrer linked an issue Jul 4, 2024 that may be closed by this pull request
4 tasks
Copy link

vercel bot commented Jul 4, 2024

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

Name Status Preview Comments Updated (UTC)
gridiron-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:58pm
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 3:58pm

Copy link

appwrite bot commented Jul 4, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function deployment has failed. Please check the logs for more details and retry.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b failed Failed View Logs

Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.

💡 Did you know?
Cursor pagination performs better than offset pagination when loading further pages

@@ -28,12 +31,22 @@ import { ISchedule } from './WeekTeams.interface';
// eslint-disable-next-line no-unused-vars
const Week = ({ league, NFLTeams, week }: IWeekProps): JSX.Element => {
const [schedule, setSchedule] = useState<ISchedule[]>([]);
const [selectedLeague, setSelectedLeague] = useState<ILeague | undefined>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the state be initialized to string? i.e.: const [selectedLeague, setSelectedLeague] = useState<string>('');?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna leave this to @chris-nowicki, since he helped me with this by implementing it Though, initializing it to a string makes sense to me!

<nav className="py-6 text-orange-500 hover:no-underline">
<LinkCustom
className="text-orange-500 flex gap-3 items-center font-semibold text-xl hover:no-underline"
href="/league/all"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the hover:bg-zinc-800 transition from the WeeklyPickButton apply to this still when hovering over it on WeekTeams?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC it did in my testing, but now you're making me question myself! I'll confirm tomorrow (7/9/24) and report back.

@ryandotfurrer ryandotfurrer marked this pull request as draft July 8, 2024 15:58
…ge and components

made it so the user tapping or clicking on their team selection updates the database
getSchedule(week);
}, [week]);
setIsLoading(false);
}, [week, selectedLeague]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By adding selectedLeague, it's going to cause side effects. Every time selectedLeague() is called, it will run this useEffect.

@@ -28,12 +31,22 @@ import WeekTeams from './WeekTeams';
// eslint-disable-next-line no-unused-vars
const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
const [schedule, setSchedule] = useState<ISchedule[]>([]);
const [selectedLeague, setSelectedLeague] = useState<ILeague | undefined>();
const [isLoading, setIsLoading] = useState<boolean>(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We'll need to look into Suspense in the near future.

<form
className="mx-auto flex w-[90%] max-w-3xl flex-col items-center gap-8"
onSubmit={form.handleSubmit(onSubmit)}
<div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No to classess Div's. This should have a class that matches the component name.

* @param dateStr The date string to format.
* @returns The formatted date and time string.
*/
const formatDateTime = (dateStr: string): string => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not shorthand your variable names. When someone else is reading them, you want them to concise and ready to browse.

Suggested change
const formatDateTime = (dateStr: string): string => {
const formatDateTime = (dateString: string): string => {

}: IWeekTeamsProps): JSX.Element => (
<>
{schedule.map((scheduledGame) => (
<RadioGroup
onValueChange={field.onChange}
defaultValue={userPick}
key={scheduledGame.id}
className="grid w-full grid-cols-2 gap-4"
className="grid w-full grid-cols-2 gap-4 pb-8"
onChange={onWeeklyPickChange as FormEventHandler<HTMLDivElement>}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No go on assertions. Unless it's a special case, it's most likely your typing that is off. In this case, We need to update IWeekTeamsProps with the correct typing. We used the generic object to get by testing.

shashilo
shashilo previously approved these changes Jul 10, 2024
@shashilo shashilo merged commit 1df7007 into develop Jul 10, 2024
7 checks passed
@shashilo shashilo deleted the ryan/ux-update-weeks-page-to-match-design branch July 10, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX: Update Week's page to match design
4 participants