diff --git a/source/src/components/Card.tsx b/source/src/components/Card.tsx new file mode 100644 index 0000000..6dc9025 --- /dev/null +++ b/source/src/components/Card.tsx @@ -0,0 +1,29 @@ +import styled, { css } from "styled-components" + +import theming from "../styles/theming" + +export const cardCSS = css` + margin: auto; + background-color: ${(props) => + theming.theme(props.theme.currentTheme, { + light: "white", + dark: "#2F3136", + })}; + padding: 2rem; + border-radius: 6px; + box-shadow: ${(props) => + theming.theme(props.theme.currentTheme, { + light: "0 4px 10px rgb(0 0 0 / 5%), 0 0 1px rgb(0 0 0 / 10%);", + dark: "0 4px 10px rgb(0 0 0 / 30%), 0 0 1px rgb(0 0 0 / 30%);", + })}; + + @media screen and (max-width: ${theming.size.screen_size1}) { + padding: 1rem; + } +` + +const Card = styled.div` + ${cardCSS} +` + +export default Card diff --git a/source/src/components/Loading.tsx b/source/src/components/Loading.tsx index 97d8a15..1413918 100644 --- a/source/src/components/Loading.tsx +++ b/source/src/components/Loading.tsx @@ -4,9 +4,11 @@ import styled from "styled-components" +import MainContent from "./MainContent" + import theming from "../styles/theming" -const StyledContainer = styled.div` +const StyledContainer = styled(MainContent)` display: flex; flex-direction: column; justify-content: center; @@ -93,7 +95,7 @@ const StyledSVG = styled.svg` const Spinner = () => { return ( - + { return ( { navigate(process.env.PUBLIC_URL + props.postData.url) }} diff --git a/source/src/pages/NotFound.tsx b/source/src/pages/NotFound.tsx index 9c5cbd3..f5ef9eb 100644 --- a/source/src/pages/NotFound.tsx +++ b/source/src/pages/NotFound.tsx @@ -1,9 +1,11 @@ import styled from "styled-components" import { Helmet } from "react-helmet-async" +import MainContent from "../components/MainContent" + import theming from "../styles/theming" -const StyledNotFound = styled.div` +const StyledNotFound = styled(MainContent)` text-align: center; color: ${(props) => @@ -33,7 +35,7 @@ const NotFound = () => { - + 404
Page was not found :( diff --git a/source/src/pages/Page.tsx b/source/src/pages/Page.tsx index 0eaea8e..521fba7 100644 --- a/source/src/pages/Page.tsx +++ b/source/src/pages/Page.tsx @@ -17,10 +17,11 @@ import { faHourglass, } from "@fortawesome/free-solid-svg-icons" -import Tag from "../components/Tag" -import TagList from "../components/TagList" -import NotFound from "./NotFound" +import MainContent from "../components/MainContent" import Loading from "../components/Loading" +import TagList from "../components/TagList" +import Tag from "../components/Tag" +import NotFound from "./NotFound" import theming from "../styles/theming" @@ -29,6 +30,10 @@ import { useEffect } from "react" const map: Map = _map +const StyledPage = styled(MainContent)` + padding-top: 0; +` + const StyledTitle = styled.h1` margin-bottom: 1rem; ` @@ -308,7 +313,7 @@ const Page = () => { /> -
+ {isSeries ? ( { __html: fetchedPage.content, }} /> -
+ ) } diff --git a/source/src/pages/Search.tsx b/source/src/pages/Search.tsx index 5f11170..3f8d1b8 100644 --- a/source/src/pages/Search.tsx +++ b/source/src/pages/Search.tsx @@ -13,13 +13,14 @@ import _map from "../data/map.json" import searchData from "../data/search.json" import theming from "../styles/theming" -import "react-date-range/dist/styles.css" -import "react-date-range/dist/theme/default.css" - import PostCard from "../components/PostCard" +import MainContent from "../components/MainContent" import { Map } from "../types/typings" +import "react-date-range/dist/styles.css" +import "react-date-range/dist/theme/default.css" + const map: Map = _map const searchIndex = elasticlunr.Index.load(searchData as never) @@ -36,7 +37,7 @@ interface Query { query: string } -const StyledSearch = styled.div` +const StyledSearch = styled(MainContent)` text-align: center; ` @@ -289,7 +290,7 @@ const Search = () => { pomp | Search - +

Search

diff --git a/source/src/react-app-env.d.ts b/source/src/react-app-env.d.ts new file mode 100644 index 0000000..6431bc5 --- /dev/null +++ b/source/src/react-app-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/source/src/styles/globalStyle.tsx b/source/src/styles/globalStyle.tsx index 6aa0255..177b3fa 100644 --- a/source/src/styles/globalStyle.tsx +++ b/source/src/styles/globalStyle.tsx @@ -176,41 +176,6 @@ const whiteLinkCSS = css` } ` -const cardCSS = css` - .card { - margin: auto; - background-color: ${(props) => - theming.theme(props.theme.currentTheme, { - light: "white", - dark: "#2F3136", - })}; - padding: 2rem; - border-radius: 6px; - box-shadow: ${(props) => - theming.theme(props.theme.currentTheme, { - light: "0 4px 10px rgb(0 0 0 / 5%), 0 0 1px rgb(0 0 0 / 10%);", - dark: "0 4px 10px rgb(0 0 0 / 30%), 0 0 1px rgb(0 0 0 / 30%);", - })}; - - @media screen and (max-width: ${theming.size.screen_size1}) { - padding: 1rem; - } - } -` - -const mainContentCSS = css` - .main-content { - margin-top: 3rem; - width: 50%; - - @media screen and (max-width: ${theming.size.screen_size1}) { - width: auto; - margin: 1rem; - margin-top: 3rem; - } - } -` - const globalStyle = css` ${scrollbarCSS} ${codeCSS} @@ -218,8 +183,6 @@ const globalStyle = css` ${tableCSS} ${blockquoteCSS} ${whiteLinkCSS} - ${cardCSS} - ${mainContentCSS} body { overflow-x: hidden;