From 0d8a713a4a669e32d338f7046f821b0bf5f8aa9e Mon Sep 17 00:00:00 2001 From: "vivid-github[bot]" <129557859+vivid-github[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:24:31 +0000 Subject: [PATCH 1/3] Add new components --- components/Card.module.css | 66 ++++++++++++++++++++ components/Card.tsx | 122 +++++++++++++++++++++++++++++++++++++ components/CardPage.tsx | 11 ++++ components/sun.svg | 4 ++ components/sunImage.svg | 4 ++ 5 files changed, 207 insertions(+) create mode 100644 components/Card.module.css create mode 100644 components/Card.tsx create mode 100644 components/CardPage.tsx create mode 100644 components/sun.svg create mode 100644 components/sunImage.svg diff --git a/components/Card.module.css b/components/Card.module.css new file mode 100644 index 00000000..d7ee0958 --- /dev/null +++ b/components/Card.module.css @@ -0,0 +1,66 @@ +.title { + font-size: 37px; + font-weight: 500; +} +.sun { + width: 50px; + height: 50px; +} +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 25px; + width: 100%; + height: 93px; +} +.bodyText { + width: 100%; + font-size: 16px; + font-weight: 400; + letter-spacing: 0.5px; + line-height: 23px; +} +.body { + display: flex; + flex-direction: column; + align-items: flex-start; + height: fit-content; + padding: 25px; + width: 100%; +} +.theme { + font-size: 15px; + font-weight: 500; +} +.buttonText { + font-size: 15px; + font-weight: 500; +} +.button { + overflow: hidden; + display: flex; + align-items: center; + width: fit-content; + height: fit-content; + padding: 10px; + border-radius: 5px; +} +.footer { + overflow: hidden; + display: flex; + justify-content: space-between; + align-items: center; + height: fit-content; + padding: 25px; + width: 100%; +} +.cardComponent { + overflow: hidden; + display: flex; + flex-direction: column; + align-items: flex-start; + height: fit-content; + border-radius: 20px; + width: 360px; +} diff --git a/components/Card.tsx b/components/Card.tsx new file mode 100644 index 00000000..d0df248b --- /dev/null +++ b/components/Card.tsx @@ -0,0 +1,122 @@ +import styles from "./Card.module.css"; +import sunImage from "./sunImage.svg"; +import sun from "./sun.svg"; +export const Card = ({ + override, + mode, +}: { + override?: React.CSSProperties; + mode: string; +}) => { + const titleMode = + mode === "Dark" + ? { + color: "rgb(255, 255, 255)", + } + : { + color: "rgb(0, 0, 0)", + }; + const bodyTextMode = + mode === "Dark" + ? { + color: "rgb(255, 255, 255)", + } + : { + color: "rgb(0, 0, 0)", + }; + const themeMode = + mode === "Dark" + ? { + color: "rgb(255, 255, 255)", + } + : { + color: "rgb(0, 0, 0)", + }; + const buttonTextMode = + mode === "Dark" + ? { + color: "rgb(0, 0, 0)", + } + : { + color: "rgb(255, 255, 255)", + }; + const buttonMode = + mode === "Dark" + ? { + backgroundColor: "rgb(255, 255, 255)", + } + : { + backgroundColor: "rgb(7, 14, 19)", + }; + const cardMode = + mode === "Dark" + ? { + backgroundColor: "rgb(7, 14, 19)", + } + : { + backgroundColor: "rgb(255, 255, 255)", + }; + let sunSrc; + if (mode === "Light") { + sunSrc = sunImage; + } else { + sunSrc = sun; + } + return ( +
+ Trends +
+ ++ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididun... +
++ Theme +
++ Click me! +
+- Trends -
- -- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididun... -
-+ Trends +
+ ++ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididun... +
++ Theme +
+- Theme + Click me!
-- Click me! -
-- Trends -
- + className={styles.cardComponent} + style={{ + ...cardMode, + ...override, + }} + > +- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididun... -
-+ Trends +
+ ++ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididun... +
++ Theme +
+- Theme + Click me!
-- Click me! -
-