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

Join the Queue UI Updates (In Progress) #924

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 33 additions & 22 deletions src/components/includes/AddQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SessionAlertModal from "./SessionAlertModal";

import { collectionData, firestore, auth } from "../../firebase";
import { addQuestion } from "../../firebasefunctions/sessionQuestion";
import addFiles from "../../media/AddFilesButton.svg";

const LOCATION_CHAR_LIMIT = 40;
const WARNING_THRESHOLD = 10; // minutes left in queue
Expand Down Expand Up @@ -48,6 +49,7 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
const [tags, setTags] = useState<FireTag[]>([]);
// For hybrid sessions to keep track if student is in virtual location
const [isVirtual, setIsVirtual] = useState<boolean>(false);
// const [error, setError] = useState<boolean>(false);

const primaryTags = tags.filter((tag) => tag.level === 1);
const secondaryTags = tags.filter((tag) => tag.level === 2);
Expand Down Expand Up @@ -217,32 +219,37 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
<div className="tagsContainer">
{primaryTags.length !== 0 && (
<>
<hr />
<div className="tagsMiniContainer">
<p className="header">Select a Category</p>
<div className="QuestionTags">
{tags
.filter((tag) => tag.active && tag.level === 1)
.map((tag) => (
<SelectedTags
key={tag.tagId}
tag={tag}
isSelected={stage > INITIAL_STATE}
onClick={() => handlePrimarySelected(tag)}
check={tag.name === selectedPrimary?.name}
isPrimary={true}
select={true}
/>
))}
<div className="topRow">
<div className="disclaimerContainer">
<p className="text"><span className="required"> * </span>Required</p>
</div>
<div className="tagsMiniContainer">
<p className="header">Select a Category<span className="required"> * </span></p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Overall the code is good. An optimization I would make is probably factor out the asterisk into a reusable component like const Asterisk = () => <span className="required"> * </span>;. This way we don't have to repetitively nest span tags inside another jsx element.

<div className="category">
{tags
.filter((tag) => tag.active && tag.level === 1)
.map((tag) => (
<SelectedTags
key={tag.tagId}
tag={tag}
isSelected={stage > INITIAL_STATE}
onClick={() => handlePrimarySelected(tag)}
check={tag.name === selectedPrimary?.name}
isPrimary={true}
select={true}
/>
))}
</div>
</div>
</div>

</>
)}
{secondaryTags.length !== 0 && (
<>
<hr />
<div className={"tagsMiniContainer secondaryTags " + !!selectedPrimary}>
<p className="header">Select a Tag</p>
<p className="header">Select a Tag<span className="required"> * </span></p>
{selectedPrimary ? (
tags
.filter((tag) => tag.active && tag.level === 2)
Expand Down Expand Up @@ -285,6 +292,7 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
{LOCATION_CHAR_LIMIT - location.length !== 1 && "s"} left)
</span>
)}
<span className="required"> * </span>
</p>
}
{stage >= SECONDARY_SELECTED || activeTags.length === 0 ? (
Expand All @@ -308,7 +316,7 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
onChange={handleUpdateLocation}
placeholder={
session.modality === "in-person" || !isVirtual
? "What is your location?"
? "Enter where you are (room & location in room)"
: "What is your zoom link?"
}
/>
Expand All @@ -318,11 +326,10 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
<p className="placeHolder text">Finish selecting tags...</p>
)}
</div>
<hr />
</>
)}
<div className="tagsMiniContainer">
<p className="header">{"Question "}</p>
<p className="header">{"Question "} <span className="required"> * </span></p>
{stage >= LOCATION_INPUTTED ||
primaryTags.length === 0 ||
secondaryTags.length === 0 ||
Expand All @@ -331,7 +338,7 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
className="TextInput question"
value={question}
onChange={handleUpdateQuestion}
placeholder="What's your question about?"
placeholder="What would you like help or feedback on?"
/>
) : (
<textarea
Expand All @@ -347,6 +354,10 @@ const AddQuestion = ({ course, session, mobileBreakpoint, showProfessorStudentVi
/>
)}
</div>
<div className="tagsMiniContainer">
<p className="header">Your Files<span className="required"> * </span></p>
<img alt="" src={addFiles}/>
</div>
<div className="addButtonWrapper">
{stage > LOCATION_INPUTTED || primaryTags.length === 0 || secondaryTags.length === 0 ? (
<p className="AddButton active" onClick={() => handleJoinClick()}>
Expand Down
5 changes: 5 additions & 0 deletions src/media/AddFilesButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 46 additions & 8 deletions src/styles/session/AddQuestion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
width: 100%;
top: 30px;
bottom: 30px;
padding-bottom: 5px;
padding-right: 15px;
padding-left: 15px;
padding-top: 32px;
padding-bottom: 4px;
padding-right: 32px;
padding-left: 32px;
margin-bottom: 40px;


Expand Down Expand Up @@ -49,7 +50,7 @@
font-family: Roboto;
font-style: normal;
font-weight: 500;
font-size: 22px;
font-size: 24px;
color: #484848;
}

Expand All @@ -74,6 +75,29 @@
clear:both;
}

.topRow{
position: relative;
width: 100%;
padding-top: 24px;
padding-bottom: 24px;
}

.disclaimerContainer{
position: absolute;
right: 0;
top: 24px;
width: 100%;
font-family: Roboto;
font-weight: 500;
font-size: 9.87px;
line-height: 11.56px;
letter-spacing: 0%;
text-align: right;
.text{
color: #F67D7D;
}
}

.tagsMiniContainer {
padding: 10px 32px;
clear: both;
Expand All @@ -88,13 +112,27 @@
text-align: left;
margin-bottom:0.5em;
}
.required{
color: #F67D7D;
font-size: 14px;
font-weight: 500;
line-height: 16.41px;
}

.shaded{
background-color: rgba(246, 125, 125, 0.15);
}

.category{
padding-top: 12px;
}

.header {
height: 17px;
font-family: Roboto;
font-style: normal;
font-weight: 500;
font-size: 14.625px;
font-size: 14px;
line-height: 17px;
color: #696969;
margin-bottom: 14px;
Expand All @@ -112,7 +150,7 @@
font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 12.675px;
font-size: 12px;
color: #BBBBBB;
}

Expand All @@ -125,7 +163,7 @@
font-weight: normal;
border: 0px;
color: $text-grey;
font-size:15px;
font-size:12px;
padding: 8px;
border-radius: 3.3px;
resize: none;
Expand All @@ -144,7 +182,7 @@
font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 12.675px;
font-size: 12px;
color: #BBBBBB;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/styles/session/SelectedTags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $secondary-tag-selected: #ffdba6;
.tag {
font-weight: normal;
display: inline-block;
font-size: 13px;
font-size: 12px;
border: 0.5px solid;
padding: 2px 10px;
margin: 0 6px 0 0;
Expand Down Expand Up @@ -44,7 +44,7 @@ $secondary-tag-selected: #ffdba6;
font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 14.8909px;
font-size: 12px;
line-height: 17px;
color: #565656;

Expand Down
Loading