-
Notifications
You must be signed in to change notification settings - Fork 0
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: create supervisor component #21
Conversation
28cd685
to
1680903
Compare
Well, I think we need to refactor the supervisor component in design first and then implement it on frontend. |
Damn, I wish it was mentioned in the issue that the design is going to be changed 🙃 I will start working on saving conversations. |
😭😭 |
9a26830
to
24c1833
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (responsiveness): expanding the accordion on mobile causes <body>
overflow
suggestion: This whole component isn't bad and we can use it after we address my comments, but we're already using shadcn/ui components throughout our app, and I don't see why we wouldn't use shadcn's accordion (with adjusted code to match our design of course) for this case as well. We would benefit from nice animations and it would ensure that this part of the app is accessible.
src/components/supervisor.tsx
Outdated
<div | ||
className={cn( | ||
"inline-flex w-full flex-col gap-4 rounded-2xl p-4", | ||
(highlight ?? false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (non-blocking): This highlight doesn't make any sense. I don't think there's any reason to pass a highlight prop to this component. Though admittedly this can't be really deduced from our figma design on first glance, I think it makes most sense to highlight the currently active/expanded accordion - thing is, in the current implementation we can have multiple expanded accordions at once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the design did not really show that the expanded accordion is highlighted - I thought that only the first one is highlighted, will change that
src/components/supervisor.tsx
Outdated
<Button | ||
size="icon" | ||
variant="transparent" | ||
title="Rozwiń" | ||
onClick={() => { | ||
setIsOpen(!isOpen); | ||
}} | ||
> | ||
{isOpen ? <ChevronUp size={36} /> : <ChevronDown size={36} />} | ||
</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (non-blocking): Having to specifically click this small button to toggle the accordion is bad UX. I suggest making the div with the professor's name and faculty the actual button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will change that
@@ -20,6 +20,7 @@ export default { | |||
"chat-bot": "#1D2150", | |||
"chat-user": "#34386A", | |||
"chat-background": "#060C28", | |||
"message-primary": "#5D70B8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Currently, message-primary
is used for the chat bot's message, yet we also have a chat-bot
variable. This appears to be caused by the fact that on our homepage, chat-bot
is used as the bot's message background color. If we stay with message-primary
(see below), I think the homepage could be adjusted so that it represents how the chat actually looks (bot message uses the brighter message-primary
as its background color)
Though on another hand, this color doesn't pass WCAG AAA contrast check given the white foreground (https://webaim.org/resources/contrastchecker/), while chat-bot
passes all checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this color because it was used in the design, we have to choose another color for it then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, that's not a mistake on your part. We'll address this design problem later
src/components/supervisor.tsx
Outdated
<div className="flex items-center justify-between gap-4"> | ||
<div className="flex flex-col gap-1"> | ||
<p className="text-xl font-bold">{name}</p> | ||
<p>{faculty}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: Since the API returns faculties in english, we will probably have to setup some sort of a "dictionary" within the app, which will have english-polish faculty name pairs that we will then use in api requests and the ui respectively
Hey @maciejkrol18 , can you take a look at it again? It is now using the accordion from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, everything looks and works nice. I'll let you do the honors of merging
edit: and the honors of resolving conflicts
<PromochatorIcon | ||
imageWidth={36} | ||
imageHeight={36} | ||
imageClassName="py-2 px-1" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: This icon gets really tiny on mobile. Just noting this since this whole markup is just for showcasing the component, this should be handled in #45
@@ -20,6 +20,7 @@ export default { | |||
"chat-bot": "#1D2150", | |||
"chat-user": "#34386A", | |||
"chat-background": "#060C28", | |||
"message-primary": "#5D70B8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, that's not a mistake on your part. We'll address this design problem later
Depends on #23
Adds a supervisor component.