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

Implement Contact Us Modal (Can't Find Apartment + Ask Question) #363

Merged
merged 8 commits into from
May 24, 2024

Conversation

ggsawatyanon
Copy link
Contributor

@ggsawatyanon ggsawatyanon commented Apr 22, 2024

Summary

This pull request is the first step towards implementing the "Contact Us" feature with a "Can't Find Your Apartment" modal and "Ask Us a Question" modal

  • implemented ContactModal which displays the three types of modals ("Contact Us", "Can't Find Your Apartment", "Ask Us a Question")
  • made the Upload Photos feature a utility component so that it can be reusable
  • implemented frontend of Contact Us and Can't Find Your Apartment

Test Plan

image image

Notes

This is a WIP PR so I will implement the backend and Ask Us a Question modal in the future.

Breaking Changes

@dti-github-bot
Copy link
Member

dti-github-bot commented Apr 22, 2024

[diff-counting] Significant lines: 1235. This diff might be too big! Developer leads are invited to review the code.

@ggsawatyanon ggsawatyanon changed the title [WIP] Implement Contact Us Modal (Can't Find Apartment + Ask Question) Implement Contact Us Modal (Can't Find Apartment + Ask Question) May 6, 2024
@ggsawatyanon
Copy link
Contributor Author

Summary

  • Implemented preliminary admin UI
  • Implemented backend to post can't find your apartment forms and contact forms
  • Implemented backend to retrieve data and display in admin UI
  • Implemented admin page navbar to view reviews related info and contact related info
  • FAQ Page button now also opens the contact modal

Testplan

image image

Mobile display:
image

Notes

This is a preliminary admin view, in the future, I will add the functionality to delete contact info.

const token = await user!.getIdToken(true);
const data = await apartmentFormDataToReview(apartmentForm);
if (data.name === '' || includesProfanity(data.name) || includesProfanity(data.address)) {
data.name === '' ? setEmptyNameError(true) : setEmptyNameError(false);
Copy link
Member

Choose a reason for hiding this comment

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

Minor suggestion, this could be simplified to: setEmptyNameError(data.name === ''). Although it doesn't need changing since your current code is good for readability.

@@ -20,13 +16,14 @@ import { DetailedRating, Review } from '../../../../common/types/db-types';
import { createAuthHeaders, uploadFile } from '../../utils/firebase';
import ReviewRating from './ReviewRating';
import { includesProfanity } from '../../utils/profanity';
import Toast from './Toast';
import Toast from '../utils/Toast';
import styles from './ReviewModal.module.scss';
import DropDown from '../utils/DropDown';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import { ReactComponent as XIcon } from '../../assets/xIcon.svg';
Copy link
Member

Choose a reason for hiding this comment

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

this line can be removed

{currModal === 'apartment' && cantFindApartmentModal}
{currModal === 'question' && questionModal}

{currModal != 'contact' && (
Copy link
Member

Choose a reason for hiding this comment

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

can be changed to !== to resolve compile warning

kea-roy
kea-roy previously approved these changes May 20, 2024
Copy link
Member

@kea-roy kea-roy left a comment

Choose a reason for hiding this comment

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

Hey Grace,

Great work on the pull request! You've made significant changes and contributions to the website in this PR. All your code follows outstanding code practices and conventions, you made use of many of React's features to reduce re-rendering. I've made a few comments on some minor tweaks that could be adjusted.

During testing, I noticed there is horizontal scrolling in the modal, I presume this was intentional for smaller/mobile devices?
Screenshot 2024-05-20 at 05 30 40

Great work on this PR!

@ggsawatyanon ggsawatyanon merged commit 139f383 into main May 24, 2024
4 checks passed
@ggsawatyanon ggsawatyanon deleted the cantFindApartment branch May 24, 2024 09:37
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.

None yet

3 participants