Skip to content

Commit

Permalink
fix: syllabus minor styling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
YHhaoareyou committed May 29, 2022
1 parent 626ceca commit 4bc712d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 24 deletions.
4 changes: 2 additions & 2 deletions syllabus/src/components/CourseItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const CourseItem = ({
}}
className="bg-white hover:bg-light-bgSide dark:bg-dark-bgMain dark:border-dark-text3 dark:shadow-none dark:hover:bg-dark-bgSide"
>
<StyledHeading className="dark:text-dark-main">
<StyledHeading className="dark:text-dark-text1">
{highlightedTitle}
</StyledHeading>
{expandable && (
Expand Down Expand Up @@ -369,7 +369,7 @@ const CourseItem = ({

<DescriptionWrapper
isLarger={isRelatedCourse}
className="dark:text-dark-text1"
className="dark:text-dark-text2"
>
<Description>{yearTerm}</Description>
<Description>
Expand Down
9 changes: 7 additions & 2 deletions syllabus/src/components/labs/Lab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ const ReviewsModal = styled.div`
`}
`;

const LabHeader = styled.div`
padding: 1em;
`;

const ReviewsWrapper = styled(SimpleBar)`
height: 100%;
padding: 1em;
Expand Down Expand Up @@ -260,11 +264,12 @@ const Lab = ({ name, reviews, school }) => {

{open && (
<ReviewsModal className="bg-light-bgMain text-light-text2 dark:bg-dark-bgMain dark:text-dark-text2">
<ReviewsWrapper>
<LabHeader>
<CloseButton onClick={() => setOpen(false)}>×</CloseButton>

<ReviewProfName>{name}</ReviewProfName>
</LabHeader>

<ReviewsWrapper>
<SectionHeader>{t("labs.review.Basics")}</SectionHeader>
{itemTable("theme")}
{itemTable("coreTime")}
Expand Down
8 changes: 8 additions & 0 deletions syllabus/src/components/syllabus/SchoolFilterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ const WiderPopup = styled(Popup)<ThemeComponentProps>`
`;

const StyledTab = styled(Tab)<ThemeComponentProps>`
.tabular.menu {
display: flex;
flex-direction: row;
.item {
flex: 1;
}
}
${(props) =>
props.$isDark &&
`
Expand Down
32 changes: 13 additions & 19 deletions syllabus/src/components/timetable/Timetable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ const ScrollableTimetable = styled("div")`
-webkit-overflow-scrolling: touch;
`;

const StyledMessage = styled(Message)<StyledMessageProps>`
${(props) => props.$isDark && "opacity: 0.6;"}
const StyledWarningMessage = styled(Message)<StyledMessageProps>`
${(props) => props.$isDark && `background-color: ${timetableColors.dark.deeperBrown} !important;`}
${(props) => props.$isDark && `color: ${timetableColors.dark.lightBrown} !important;`}
`;

const StyledSuccessMessage = styled(Message)<StyledMessageProps>`
${(props) => props.$isDark && `background-color: ${timetableColors.dark.deepGreen} !important;`}
${(props) => props.$isDark && `color: ${timetableColors.dark.lightGreen} !important;`}
`;

interface Props extends WithTranslation {
Expand Down Expand Up @@ -122,27 +128,15 @@ const Timetable = ({ addedCoursesAndPrefs, t }: Props) => {
</h5>
<br />
<Section>
<Message
<StyledWarningMessage
warning
header={
<h5
style={
theme === "dark"
? { color: timetableColors.light.lightBrown }
: {}
}
>
<h5>
<b>{t("timetable.You haven't added any courses")}</b>
</h5>
}
content={
<p
style={
theme === "dark"
? { color: timetableColors.light.lightBrown }
: {}
}
>
<p>
{t("timetable.Go to")}{" "}
<a href="/syllabus">{t("timetable.Syllabus")} </a>{" "}
{t("timetable.and try adding one!")}
Expand All @@ -153,9 +147,9 @@ const Timetable = ({ addedCoursesAndPrefs, t }: Props) => {
/>
</Section>
<Section>
<StyledMessage success size="mini" $isDark={theme === "dark"}>
<StyledSuccessMessage success size="mini" $isDark={theme === "dark"}>
<p>{t("timetable.SaveSpace")}</p>
</StyledMessage>
</StyledSuccessMessage>
</Section>
</Article>
</Wrapper>
Expand Down
2 changes: 1 addition & 1 deletion syllabus/src/containers/SyllabusContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class SyllabusContainer extends React.Component<
/>
) : (
<div style={{ padding: "2em" }}>
<Message info>{t("message.choose school request")}</Message>
<Message info style={theme === "dark" ? { opacity: 0.7 } : {}}>{t("message.choose school request")}</Message>
<SchoolFilterContainer
checkedSchools={[]}
handleToggleFilter={() => {}}
Expand Down

0 comments on commit 4bc712d

Please sign in to comment.