Skip to content

Commit

Permalink
fix: styling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahong75 committed Oct 29, 2023
1 parent cffbe7b commit 05d6a79
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 24 deletions.
26 changes: 15 additions & 11 deletions src/components/CategoryCards/CategoryCards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ import CategoryCard from "./CategoryCard";
function CategoryCards(props) {
return (
<>
{Object.keys(primaryCategoryNames).sort((a, b) => primaryCategoryNames[a].localeCompare(primaryCategoryNames[b])).map((categoryInitials) => {
const name = primaryCategoryNames[categoryInitials].trim();
return (
<CategoryCard
routerQuery={props.routerQuery}
initials={categoryInitials}
title={name}
key={name}
/>
);
})}
{Object.keys(primaryCategoryNames)
.sort((a, b) =>
primaryCategoryNames[a].localeCompare(primaryCategoryNames[b])
)
.map((categoryInitials) => {
const name = primaryCategoryNames[categoryInitials].trim();
return (
<CategoryCard
routerQuery={props.routerQuery}
initials={categoryInitials}
title={name}
key={name}
/>
);
})}
</>
);
}
Expand Down
13 changes: 11 additions & 2 deletions src/components/SearchBar/CurrentSearchInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { CloseIcon } from "@chakra-ui/icons";
import { Box, HStack, IconButton, Tag, Text, Wrap } from "@chakra-ui/react";
import {
Box,
HStack,
IconButton,
Tag,
Text,
Wrap,
useTheme,
} from "@chakra-ui/react";

const CurrentSearchInfo = ({
handleSearch,
Expand All @@ -9,6 +17,7 @@ const CurrentSearchInfo = ({
setResetSearch,
setTagToClear,
}) => {
const theme = useTheme();
const clearTags = () => {
setResetSearch(true);
handleSearch({ searchString: searchString, tags: [] });
Expand All @@ -26,7 +35,7 @@ const CurrentSearchInfo = ({
return (
<Box mt={5} mb={0}>
{searchString !== "" && (
<Text fontSize="lg" fontWeight="500">
<Text fontSize="lg" fontWeight="500" style={theme.textStyles.search}>
You searched for &quot;{searchString}&quot; in {location}
</Text>
)}
Expand Down
8 changes: 4 additions & 4 deletions src/components/SearchBar/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
TabPanel,
TabPanels,
Tabs,
Tag,
Text,
useDisclosure,
useTheme,
} from "@chakra-ui/react";
import { useEffect, useState } from "react";
import { Form, useForm, useFormState } from "react-final-form";
import Tag from "../Tag";

const SearchBarComponent = (props) => {
const {
Expand All @@ -34,6 +35,7 @@ const SearchBarComponent = (props) => {

const { values } = useFormState();
const { mutators } = useForm();
const theme = useTheme();

const { isOpen, onToggle } = useDisclosure();
const searchPlaceholder = "Search within " + pageType;
Expand Down Expand Up @@ -105,9 +107,7 @@ const SearchBarComponent = (props) => {
value={searchInput}
onChange={handleSearchInputChange}
placeholder={searchPlaceholder}
fontWeight="400"
fontSize="16px"
fontFamily="'Europa-Regular', sans-serif"
style={theme.textStyles.searchBox}
width="25rem"
borderRadius="15px"
border="2px solid lightGrey"
Expand Down
3 changes: 2 additions & 1 deletion src/pages/_app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import Head from "next/head";
import PropTypes from "prop-types";
import React from "react";
import NavBar from "src/components/NavBar/NavBar";
import Footer from "../components/NavBar/Footer";
import "src/styles/fonts.css";
import { SWRConfig } from "swr";
import Footer from "../components/NavBar/Footer";

import fetchJson from "src/lib/utils/fetchJson";
import { southfaceTheme } from "src/styles/theme";
Expand Down
6 changes: 5 additions & 1 deletion src/pages/_document.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Document, { Head, Html, Main, NextScript } from "next/document";
import React from "react";
import Document, { Html, Head, Main, NextScript } from "next/document";

class MyDocument extends Document {
static async getInitialProps(ctx) {
Expand All @@ -17,6 +17,10 @@ class MyDocument extends Document {
type="image/png"
href="/static/favicon.png"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap"
rel="stylesheet"
/>
</Head>
<body>
<Main />
Expand Down
17 changes: 15 additions & 2 deletions src/pages/library/[buildingType]/[primaryCategory]/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,26 @@ const LibraryCategoryPage = (props) => {
paddingY="8rem"
marginX="8rem"
>
<Text fontSize="2xl" textAlign="center" color="grey" mb={5}>
<Text
fontSize="2xl"
textAlign="center"
mb={5}
color={theme.colors.boldGrey}
fontWeight="400"
fontFamily={theme.fonts.heading}
>
Sorry! We couldn&apos;t find any standards matching your search.
Try changing your spelling, removing filters, or searching for
something else.
</Text>
<Link href={`/library/${props.params.buildingType}`}>
<Button variant="Blue" size="md">
<Button
variant="Blue"
size="md"
fontFamily={theme.fonts.headingBold}
fontWeight="700"
fontSize="16px"
>
Return to {capitalizeAndRemoveDash(props.params.buildingType)}
</Button>
</Link>
Expand Down
18 changes: 15 additions & 3 deletions src/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,27 @@ export const southfaceTheme = extendTheme({
fontWeight: "400",
fontStyle: "normal",
headingBold: `'Europa-Regular', sans-serif`,
fontColor: "#6D6E70",
color: "#6D6E70",
fontSize: "16px",
},
nameBold: {
fontWeight: "700",
fontStyle: "normal",
headingBold: `'Europa-Bold', sans-serif`,
fontColor: "#6D6E70",
color: "#6D6E70",
fontSize: "16px",
},

// Search text
search: {
fontWeight: "400",
fontFamily: "'Europa-Regular', sans-serif",
color: "#6D6E70",
},

searchBox: {
fontWeight: "300",
fontFamily: "'Europa-Light', sans-serif",
color: "#6D6E70",
},
},
});

0 comments on commit 05d6a79

Please sign in to comment.