Skip to content

Commit

Permalink
Added teacher-set details
Browse files Browse the repository at this point in the history
  • Loading branch information
deepikagonuguntla committed Dec 23, 2024
1 parent 7028f55 commit db79f76
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions app/javascript/components/Accounts/Accounts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,29 @@ export default function Accounts() {
}
};

const handleCancel = (hold) => {
const href = "/holds/" + hold["access_key"] + "/cancel";
window.location.href = href;
}

const orderCancelConfirmation = (hold) => {
return (
<div id={"cancel_" + hold["access_key"]}>
<ButtonGroup buttonWidth="full">
<Button id="account-page-cancel-button" buttonType="noBrand">
<Link
className="accountPageCancelOrder"
href={"/holds/" + hold["access_key"] + "/cancel"}
>
{" "}
Cancel{" "}
</Link>
<Button id="account-page-cancel-button" buttonType="noBrand"
onClick={() => handleCancel(hold)}>
Cancel
</Button>
</ButtonGroup>
</div>
);
};

const handleOrder = (hold ) => {
const href = "/teacher_set_details/" + hold.teacher_set_id;
window.location.href = href;
}

const orderTeacherSet = (hold) => {
return (
<div id={"cancel_" + hold["access_key"]}>
Expand All @@ -215,15 +220,10 @@ export default function Accounts() {
id="account-page-order-button"
buttonType="secondary"
whiteSpace="nowrap"
onClick={() => handleOrder(hold)}
style={{color: "var(--nypl-colors-ui-black)"}}
>
<Link
id="account-page-order-link"
className={`${colorMode} accountPageTeacherSetOrder`}
href={"/teacher_set_details/" + hold.teacher_set_id}
>
{" "}
Order again{" "}
</Link>
Order again
</Button>
</ButtonGroup>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function TeacherSetDetails(props) {
const [isLoading, setIsLoading] = useState(true);
const [currentUserStatus, setCurrentUserStatus] = useState();
const [disabledButton, setDisabledButton] = useState(false);
const [isSchoolActive, setIsSchoolActive] = useState(false);
const [isSchoolActive, setIsSchoolActive] = useState("");
const heroBgColor = useColorModeValue(
"var(--nypl-colors-brand-primary)",
"var(--nypl-colors-dark-ui-bg-hover)"
Expand Down Expand Up @@ -534,7 +534,7 @@ export default function TeacherSetDetails(props) {
};

const inactiveSchoolMessage = () => {
if (!isSchoolActive) {
if (isSchoolActive !== "" && isSchoolActive == false) {
return (<Banner content={<>
Your school is inactive, so your account is restricted. Please contact [email protected].
</>} type="warning" />)
Expand Down

0 comments on commit db79f76

Please sign in to comment.