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

Review Header #38

Closed
wants to merge 33 commits into from
Closed

Review Header #38

wants to merge 33 commits into from

Conversation

banushi-a
Copy link
Contributor

@banushi-a banushi-a commented Feb 15, 2024

No specific task number

Description

Added the header to the review form. I had to not use the FormCard for the header due to issues I was having with the unique sticky behavior.

Things to be reviewed

Log in as a user and go to /review to see the header.

To Do:

  • Fill out circles once that part of the form is done

Screenshots

Screenshot 2024-02-15 at 6 12 26 PM

When reviewing, double click and hit "inspect element" . Ensure the responsive icon is selected (in blue).

Screenshot 2024-02-15 at 6 32 46 PM

Next, tap on different screen sizes (the bar which says Mobile S - 320px can be changed) to see how the change looks on different screen sizes.

Screenshot 2024-02-15 at 6 32 54 PM

Checklist

  • Add task name to the PR title
  • Add ticket number to ("Closes #")
  • Move task to "In Review" on the Cooper Project Board
  • Add atleast one person to review your PR
  • Ask for review on Slack

banushi-a and others added 30 commits February 11, 2024 15:29
BREAKING CHANGE: modify schema
Copy link

vercel bot commented Feb 15, 2024

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

Name Status Preview Comments Updated (UTC)
cooper ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 15, 2024 11:36pm

Copy link
Collaborator

@RishikeshNK RishikeshNK left a comment

Choose a reason for hiding this comment

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

Looking great so far! we can make a few changes to make the header more responsive.

@@ -43,6 +43,7 @@
"superjson": "^2.2.1",
"tailwind-merge": "^2.2.1",
"tailwindcss-animate": "^1.0.7",
"yup": "^1.3.3",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was Yup installed accidentally? If we want any schema validation, we can use Zod which is currently being used for validating the tRPC endpoints and the form.

className="space-y-6"
<>
<header
className={`relative z-10 mt-8 flex justify-center ${isSticky ? "sticky top-[-2rem] sm:top-[-5rem]" : ""}`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

For chaining Tailwind utility classes, can we try using the cn(... inputs: ClassValue[]) function from ~/lib/utils.ts? All conflicts and composition logic can be handled by this function.

<h1 className="text-3xl font-semibold">Submit a Co-op Review</h1>
<p className="my-4">description about this form here.</p>
</div>
<div className={`mt-2 flex justify-around`}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move the header to a different component in order to keep the size of the review-form.tsx file minimal?

</Button>
<Button type="submit">Submit</Button>
<div
className={`space-4 relative flex min-w-[95vw] flex-col rounded-xl bg-white p-8 sm:min-w-[66vw] ${isSticky ? "outline" : ""}`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you increase the spacing between the circles on smaller devices? The second and third label is sticking to each other on smaller devices.

</Button>
<Button type="submit">Submit</Button>
<div
className={`space-4 relative flex min-w-[95vw] flex-col rounded-xl bg-white p-8 sm:min-w-[66vw] ${isSticky ? "outline" : ""}`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, is there anyway we can refactor this to use the FormCard component from ~/components/form-card?

const [headerPercentage, setHeaderPercentage] = useState<number>(40);
const [isSticky, setIsSticky] = useState<boolean>(false);
const [higlightedSectionIdx, setHighlightedSectionIdx] = useState<number>(0);
useEffect(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, this could be low-priority but can we refactor this to use the useScroll hook from framer-motion instead of manually handling the scroll progress in a useEffect?

@banushi-a banushi-a closed this Feb 24, 2024
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.

2 participants