diff options
author | 2020-12-14 19:18:19 +0000 | |
---|---|---|
committer | 2020-12-14 19:18:19 +0000 | |
commit | a1963eb56f9682a6315a06a075d09314822dbfd9 (patch) | |
tree | d0856e1326516447a33951de623770787f6ef996 /src/components | |
parent | Merge pull request #29 from python-discord/dependabot/npm_and_yarn/ini-1.3.8 (diff) | |
parent | Simplify Axios client baseURL definition (diff) |
Merge pull request #30 from python-discord/ks123/discovery
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/FormListing.tsx | 10 | ||||
-rw-r--r-- | src/components/Loading.tsx | 17 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/components/FormListing.tsx b/src/components/FormListing.tsx index 2493608..c53cf67 100644 --- a/src/components/FormListing.tsx +++ b/src/components/FormListing.tsx @@ -9,15 +9,15 @@ import Tag from "./Tag"; import colors from "../colors"; -import { AllFormsForm } from "../api/forms"; +import { Form, FormFeatures } from "../api/forms"; interface FormListingProps { - form: AllFormsForm + form: Form } function FormListing({ form }: FormListingProps) { const listingStyle = css` - background-color: ${form.open ? colors.success : colors.darkButNotBlack}; + background-color: ${form.features.includes(FormFeatures.Open) ? colors.success : colors.darkButNotBlack}; width: 60%; padding: 20px; margin-top: 20px; @@ -39,13 +39,13 @@ function FormListing({ form }: FormListingProps) { let closedTag; - if (!form.open) { + if (!form.features.includes(FormFeatures.Open)) { closedTag = <Tag text="CLOSED" color={colors.error}/> }; return <Link to={`/form/${form.id}`} css={listingStyle}> <div> - <h3 css={{fontSize: "1.5em", marginBottom: "0"}}>{closedTag}{form.title} <FontAwesomeIcon icon={faArrowRight} css={{fontSize: "0.75em", paddingBottom: "1px"}}/></h3> + <h3 css={{fontSize: "1.5em", marginBottom: "0"}}>{closedTag}{form.name} <FontAwesomeIcon icon={faArrowRight} css={{fontSize: "0.75em", paddingBottom: "1px"}}/></h3> <p css={{marginTop: "5px"}}>{form.description}</p> </div> </Link> diff --git a/src/components/Loading.tsx b/src/components/Loading.tsx new file mode 100644 index 0000000..48dcdbc --- /dev/null +++ b/src/components/Loading.tsx @@ -0,0 +1,17 @@ +/** @jsx jsx */ +import { jsx } from "@emotion/core"; + +import { HashLoader } from "react-spinners"; + +import HeaderBar from "../components/HeaderBar"; + +function Loading() { + return <div> + <HeaderBar title={"Loading..."}/> + <div css={{display: "flex", justifyContent: "center"}}> + <HashLoader color="white"/> + </div> + </div> +} + +export default Loading; |