From 53ee9d18f4c0c87dbfdcd7df27661bb9705b004e Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Thu, 27 Jul 2023 22:07:49 +0100 Subject: [PATCH] Extracts doc content into own component --- src/components/misc/DocContent.tsx | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/components/misc/DocContent.tsx diff --git a/src/components/misc/DocContent.tsx b/src/components/misc/DocContent.tsx new file mode 100644 index 0000000..8cdbc3b --- /dev/null +++ b/src/components/misc/DocContent.tsx @@ -0,0 +1,56 @@ +import styled from 'styled-components'; +import docs, { type Doc } from 'utils/docs'; +import colors from 'styles/colors'; +import Heading from 'components/Form/Heading'; + +const JobDocsContainer = styled.div` +p.doc-desc, p.doc-uses, ul { + margin: 0.25rem auto 1.5rem auto; +} +ul { + padding: 0 0.5rem 0 1rem; +} +ul li a { + color: ${colors.primary}; +} +summary { color: ${colors.primary};} +h4 { + border-top: 1px solid ${colors.primary}; + color: ${colors.primary}; + opacity: 0.75; + padding: 0.5rem 0; +} +`; + +const DocContent = (id: string) => { + const doc = docs.filter((doc: Doc) => doc.id === id)[0] || null; + return ( + doc? ( + {doc.title} + About +

{doc.description}

+ Use Cases +

{doc.use}

+ Links + +
+ Example + Screenshot +
+
) + : ( + +

No Docs provided for this widget yet

+
+ )); +}; + +export default DocContent;