-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1483 from NYPL/MLN-1304
Added inactive school message in all the tabs
- Loading branch information
Showing
15 changed files
with
66 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ import { | |
Heading, | ||
Hero, | ||
useColorModeValue, | ||
Banner | ||
} from "@nypl/design-system-react-components"; | ||
|
||
export default function AppBreadcrumbs(props) { | ||
|
@@ -83,15 +82,6 @@ export default function AppBreadcrumbs(props) { | |
} | ||
}; | ||
|
||
const inactiveSchoolMessage = () => { | ||
console.log(props.is_school_active) | ||
if (props.is_school_active === false) { | ||
return (<Banner className="inactiveSchool" content={<> | ||
Your school is inactive, so your account is restricted. Please contact [email protected]. | ||
</>} type="warning"/>) | ||
} | ||
} | ||
|
||
const HeroDataValue = (levelString) => { | ||
switch (levelString) { | ||
case "participating-schools": | ||
|
@@ -146,7 +136,6 @@ export default function AppBreadcrumbs(props) { | |
/> | ||
} | ||
/> | ||
{inactiveSchoolMessage()} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import HaveQuestions from "./../HaveQuestions/HaveQuestions"; | |
import { Link as ReactRouterLink, useParams, useLocation } from "react-router-dom"; | ||
import axios from "axios"; | ||
import { titleCase } from "title-case"; | ||
import { renderInactiveSchoolMessage } from '../Utils/SchoolStatusMessage'; | ||
import { | ||
Card, | ||
CardHeading, | ||
|
@@ -231,15 +232,6 @@ export default function TeacherSetBooks() { | |
); | ||
}; | ||
|
||
const inactiveSchoolMessage = () => { | ||
console.log(isSchoolActive === false) | ||
if (isSchoolActive === false) { | ||
return (<Banner className="inactiveSchool" content={<> | ||
Your school is inactive, so your account is restricted. Please contact [email protected]. | ||
</>} type="warning"/>) | ||
} | ||
} | ||
|
||
const BookImage = (data) => { | ||
if (isLoading) { | ||
return ( | ||
|
@@ -313,9 +305,9 @@ export default function TeacherSetBooks() { | |
/> | ||
} | ||
/> | ||
{inactiveSchoolMessage()} | ||
</> | ||
</> | ||
} | ||
contentTop={renderInactiveSchoolMessage(isSchoolActive)} | ||
contentPrimary={ | ||
<> | ||
<Flex alignItems="baseline"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react"; | |
import HaveQuestions from "./../HaveQuestions/HaveQuestions"; | ||
import ShowBookImage from "./../ShowBookImage"; | ||
import BookTitles from "./../BookTitles"; | ||
import { renderInactiveSchoolMessage } from '../Utils/SchoolStatusMessage'; | ||
import { | ||
Link as ReactRouterLink, | ||
useParams, | ||
|
@@ -533,14 +534,6 @@ export default function TeacherSetDetails(props) { | |
} | ||
}; | ||
|
||
const inactiveSchoolMessage = () => { | ||
if (currentUserStatus && isSchoolActive === false) { | ||
return (<Banner className="inactiveSchool" content={<> | ||
Your school is inactive, so your account is restricted. Please contact [email protected]. | ||
</>} type="warning" />) | ||
} | ||
} | ||
|
||
const teacherSetAvailability = () => { | ||
if (isLargerThanMobile && teacherSet.availability !== undefined) { | ||
return ( | ||
|
@@ -802,11 +795,10 @@ export default function TeacherSetDetails(props) { | |
/> | ||
} | ||
/> | ||
{inactiveSchoolMessage()} | ||
</> | ||
} | ||
contentTop={ | ||
<> | ||
<>{renderInactiveSchoolMessage(isSchoolActive)} | ||
{errorMsg()} | ||
</> | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
import { Banner } from "@nypl/design-system-react-components"; | ||
|
||
export const renderInactiveSchoolMessage = (isSchoolActive) => { | ||
if (isSchoolActive === false) { | ||
return ( | ||
<Banner | ||
content={<> | ||
Your school is inactive, so your account is restricted. Please contact [email protected]. | ||
</>} | ||
type="warning" | ||
/> | ||
); | ||
} | ||
return null; // Return null if the school is active | ||
}; | ||
|
File renamed without changes.