Skip to content

Commit

Permalink
Minor changes (#53)
Browse files Browse the repository at this point in the history
* Remove notification icon

* Fix password hiding

* Fix add address button size

* Temp disable delete button

* Remove unused import
  • Loading branch information
natesawant authored Dec 8, 2023
1 parent 76ae35a commit 1e20e6f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
5 changes: 1 addition & 4 deletions frontend/src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Fab, Link } from "@mui/material";
import { useState } from "react";
import NavDropDown from "./Dropdown/NavDropDown";
import NotifactionIcon from "../../assets/navbar/notifaction.png";
import ProfileIcon from "../../assets/navbar/profile.png";
import { useStateSelector } from "../../hooks/use-redux";
import router from "../../router";
Expand Down Expand Up @@ -30,9 +29,7 @@ export default function NavBar() {
Create a Job
</Link>
)}
<Fab size="small" className="!shadow-none !bg-transparent">
<img className="h-6" src={NotifactionIcon} />
</Fab>

<Fab
size="small"
className="!shadow-none !bg-transparent"
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Profile/EditAddresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function EditAddresses(props: {
saveEdit: (body: Partial<User>) => void;
}) {
const [currentAddresses, setCurrentAddresses] = React.useState<Address[]>(
props.addresses ? props.addresses.map((a: Address) => ({ ...a })) : [],
props.addresses ? props.addresses.map((a: Address) => ({ ...a })) : []
);

const section: string = "addresses";
Expand Down Expand Up @@ -94,7 +94,7 @@ export default function EditAddresses(props: {
<div className="flex h-full flex-col items-center justify-center">
<div className=" py-8">
<StyledButton
size={"sm"}
size={"md"}
color={"seconday"}
type="submit"
onClick={() => {
Expand Down Expand Up @@ -123,7 +123,7 @@ export default function EditAddresses(props: {
display={currentAddresses[props.index]?.name || "Add New Address"}
onChange={(delta: number) => {
props.setSection(
props.index + delta === currentAddresses.length ? section : "",
props.index + delta === currentAddresses.length ? section : ""
);
props.setIndex(props.index + delta);
}}
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/Registration/TextQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { TextField } from "@mui/material";
export default function TextQuestion({
question,
control,
password,
}: {
question: FormQuestion;
control: Control;
password?: boolean;
}) {
return (
<Controller
Expand All @@ -25,6 +27,7 @@ export default function TextQuestion({
? control.getFieldState(question.key).error?.message
: " "
}
type={password ? "password" : "text"}
onChange={(e) => onChange(e.target.value)}
label={question.prompt}
variant="outlined"
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/pages/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Profile(props: { state: UserSliceState }) {
const { addError, setOpen } = useApiError();
const dispatch = useDispatch();
const [pageStatus, setPageStatus] = React.useState<PageStatus>(
PageStatus.Loading,
PageStatus.Loading
);
const [addressIndex, setAddressIndex] = React.useState(0);
const [printerIndex, setPrinterIndex] = React.useState(0);
Expand Down Expand Up @@ -70,7 +70,7 @@ function Profile(props: { state: UserSliceState }) {
csrfToken: props.state.csrfToken,
ssoAccessToken: props.state.ssoAccessToken,
user: user,
}),
})
);
setSectionEdit("");
})
Expand Down Expand Up @@ -118,6 +118,7 @@ function Profile(props: { state: UserSliceState }) {
<div className="flex h-full flex-row justify-between items-center pb-2">
<div>Deactivate Account</div>
<StyledButton
disabled
size={"sm"}
color={"delete"}
onClick={() => {
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/pages/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { useApiError } from "../hooks/use-api-error.tsx";

const producerQuestions = allQuestions.sections;
const designerQuestions = allQuestions.sections.filter(
(section) => section.userType?.toLowerCase() !== "producer",
(section) => section.userType?.toLowerCase() !== "producer"
);

const QuestionForm = () => {
Expand All @@ -49,10 +49,10 @@ const QuestionForm = () => {
const [login] = authApi.useLoginMutation();
const dispatch = useStateDispatch();
const [totalSections, setTotalSections] = useState<number>(
allQuestions.sections.length,
allQuestions.sections.length
);
const [questions, setQuestions] = useState<FormSection[]>(
allQuestions.sections,
allQuestions.sections
);

const { addError, setOpen } = useApiError();
Expand Down Expand Up @@ -216,6 +216,15 @@ const QuestionForm = () => {
control={control}
/>
);
case "password":
return (
<TextQuestion
key={question.key + "master"}
question={question}
control={control}
password
/>
);
case "dropdown":
return (
<DropdownQuestion
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilities/FormQuestions/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const allQuestions: MultiForm = {
questions: [
{
prompt: "Password",
format: "text",
format: "password",
key: "password",
rules: {
required: true,
Expand Down

0 comments on commit 1e20e6f

Please sign in to comment.