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

Directory and Post Modal with design changes #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

06unnati
Copy link

@06unnati 06unnati commented Feb 3, 2025

Tracking Info

Resolves #21 #23

Changes

  • Created the modals themselves, making sure to have the colors match the figma design.

Testing

  • I ran npm run dev and went to the local link to see what the output was.

Confirmation of Change

Screenshot (282)
Screenshot (283)

@06unnati 06unnati requested a review from Miyuki-L as a code owner February 3, 2025 06:18
@Miyuki-L Miyuki-L mentioned this pull request Feb 4, 2025
Copy link
Member

@Miyuki-L Miyuki-L left a comment

Choose a reason for hiding this comment

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

Great First task. Just a few things to change up and fix since some of the code isn't working as intended.

Copy link
Member

Choose a reason for hiding this comment

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

Let's move the components folder outside of apps. so it'll be src/components


/* Button hover effect */
.modal-actions button:hover {
background-color: #f0f0f0;
Copy link
Member

Choose a reason for hiding this comment

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

don't think this is the correct color hover color
Let's check with the designers the hover color of the cancel button

image

Cancel button is missing a boarder

border-radius: 4px;
cursor: pointer;
font-size: 16px; /* Set size for buttons */
color: #333; /* Set color for buttons */
Copy link
Member

Choose a reason for hiding this comment

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

Double check the colors with design #333 doesn't seem to be one of the colors the designers used

ALso leveraged the color variables defined in global.css instead of using the colors directly when possible

message: errorMessages.message?._errors[0],
});
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

https://react-hook-form.com/get-started

Can we use react-hook-form?
It'll work with zod to do the error checking so you don't have to do this. most of this

We don't want to be disabling linter errors these ones are avoidable

<button type="button" onClick={onClose}>
Cancel
</button>
<button type="submit">Submit</button>
Copy link
Member

Choose a reason for hiding this comment

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

Thus button has the wrong hover color

Copy link
Member

Choose a reason for hiding this comment

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

Same thing, we shouldn't be disabeling the linter here

react-hook-form should help with the errors

type="text"
value={website}
onChange={(e) => {
setInstitution(e.target.value);
Copy link
Member

Choose a reason for hiding this comment

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

wrong_ set function

onChange={(e) => {
setInstitution(e.target.value);
}}
placeholder="Phone"
Copy link
Member

Choose a reason for hiding this comment

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

wrong place holder text

onChange={handleCountryChange}
className={country ? "country-selected" : ""}
>
<option value="" disabled>
Copy link
Member

Choose a reason for hiding this comment

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

image
active /selected country text color is wrong

<button
type="button"
className="save-button"
onClick={() => {
Copy link
Member

Choose a reason for hiding this comment

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

save button doesn't trigger the console.log nor the form submit.

you need type='submit' for the submission

@raymondwusuper
Copy link
Contributor

Somehow keep getting dependency incompatibilities with postcss and tailwind, probably just an issue on my end

Copy link
Member

@Miyuki-L Miyuki-L left a comment

Choose a reason for hiding this comment

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

Almost there
Great new Post just needs a few changes

The directory personal info modal needs a bit more of a styling change to make sure it fits within the screen

Copy link
Member

Choose a reason for hiding this comment

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

missing react-hook-form

need to npm install react-hook-form in the frontend folder

Copy link
Member

Choose a reason for hiding this comment

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

Also missing @hookform/resolvers package

}

h2 {
@apply text-mainHeading;
Copy link
Member

Choose a reason for hiding this comment

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

heading text should be black

box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-button {
Copy link
Member

Choose a reason for hiding this comment

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

image
the close button is outside of the modal

you are likely missing a position rule on this element or its parent element

take a look at how Kiruthika wrote hers yours. The same css rules should apply to ours. (position absolute on the close and position relative on the container of the close button) (line 29 and 35)

label {
display: block;
margin-bottom: 3px;
color: #333;
Copy link
Member

Choose a reason for hiding this comment

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

figma has the text as black

width: 100%;
padding: 10px;
font-size: 1rem;
border: 1px solid #ccc;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think ccc is the right color code for the border i think its #b4b4b4`

<div className="modal-overlay">
<div className="modal-container">
<h2>Create New Post</h2>
<form onSubmit={handleSubmit(submitForm)}>
Copy link
Member

Choose a reason for hiding this comment

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

change the on submit to
(e) => { e.preventDefault(); void handleSubmit(onSubmit)(e); }

which should take care of one of the linter errors.

But the code above in a function name it then pass it to the form to make it more readable use a useCallback on it too


if (!isOpen) return null;

const submitForm = (data: PostFormData) => {
Copy link
Member

Choose a reason for hiding this comment

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

wrap in usecallback

<div className="form-group">
<label htmlFor="post-message">Message</label>
<textarea id="post-message" {...register("message")} placeholder="Message" />
{errors.message && <p className="error-message">{errors.message.message}</p>}
Copy link
Member

Choose a reason for hiding this comment

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

error mesage mising error styling color use
image

Copy link
Member

Choose a reason for hiding this comment

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

same as the directory modal change the way the

tag is there so its always there thus leaving space for the error message so the screen/rendering doesn't move as much when the message shows

<button className="close-button" onClick={onClose}>
&times;
</button>
<h2>Edit Directory Info</h2>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h2>Edit Directory Info</h2>
<h2>Edit Personal Info</h2>

lets match the design text

Copy link
Member

Choose a reason for hiding this comment

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

image
text color should be black when you type something in

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.

Directory Info Personal Modal
3 participants