Skip to content

Commit

Permalink
changes discussed in meeting; need to change popup to not be full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshGurnani committed May 24, 2024
1 parent ad0a2b5 commit 1cd5ee7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 42 deletions.
4 changes: 3 additions & 1 deletion frontend/src/app/staff/vsr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export default function VSRTableView() {
{/* {searchOnOwnRow ? <SearchKeyword onUpdate={fetchSearchedVSRs} /> : null} */}

<span className={styles.filterChips}>
<p className={styles.appliedText}>Applied Filters: </p>
{(filteredZipCodes && filteredZipCodes.length > 0) || filteredIncome ? (
<p className={styles.appliedText}>Applied Filters: </p>
) : null}
{filteredZipCodes?.map((zipCode) => (
<FilterChip
label={"Zip Code: " + zipCode}
Expand Down
40 changes: 13 additions & 27 deletions frontend/src/components/VSRTable/FilterModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ const FilterModal = ({ isOpen, onClose, onInputEntered, onResetFilters }: Filter
}
};

const handleZipCodeEnter = () => {
if (currentZipCode.trim()) {
setZipCodes((prevZipCodes) => [...prevZipCodes, currentZipCode.trim()]);
setCurrentZipCode(""); // Clear the text field after adding the zipcode
}
};

return (
<>
<BaseModal
Expand All @@ -80,25 +73,16 @@ const FilterModal = ({ isOpen, onClose, onInputEntered, onResetFilters }: Filter
required
></MultipleChoice>
<br />
<div className={styles.zipCodeContainer}>
<TextField
label="Zip Code(s)"
variant="outlined"
type="number"
placeholder="e.g. 92093"
onChange={handleZipCodeChange}
onKeyDown={handleKeyDown}
value={currentZipCode}
required={false}
/>
<Button
variant="primary"
outlined={false}
text="Enter"
onClick={handleZipCodeEnter}
className={styles.enterButton}
/>
</div>
<TextField
label="Zip Code(s)"
variant="outlined"
type="number"
placeholder="e.g. 92093"
onChange={handleZipCodeChange}
onKeyDown={handleKeyDown}
value={currentZipCode}
required={false}
/>
<br />
<div className={styles.filterChips}>
{zipCodes?.map((zipCode) => (
Expand Down Expand Up @@ -127,7 +111,9 @@ const FilterModal = ({ isOpen, onClose, onInputEntered, onResetFilters }: Filter
outlined={false}
text="Apply Filters"
onClick={handleApplyFilter}
className={styles.button}
className={`${styles.button} ${
zipCodes.length > 0 || currentZipCode !== "" || income !== "" ? "" : styles.disabled
}`}
/>
</div>
}
Expand Down
16 changes: 2 additions & 14 deletions frontend/src/components/VSRTable/FilterModal/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@
margin: 0 0 16px;
}

.zipCodeContainer {
display: flex;
flex-direction: row;
gap: 32px;
align-items: flex-end;
}

.enterButton {
width: 20%;
padding: 12px 24px;
text-align: center;
font-family: "Lora";
font-size: 18px;
font-weight: 700;
.disabled {
background-color: grey !important;
}

0 comments on commit 1cd5ee7

Please sign in to comment.