From 9dbf6cdf56dbd0d35a73318c4d3ec5e3aec50e4f Mon Sep 17 00:00:00 2001 From: Abolfazl Jamshidi Date: Tue, 4 Jun 2024 16:35:16 +0330 Subject: [PATCH 1/2] add articles page --- .../(articles)/_components/ArticlesList.tsx | 2 +- src/app/(articles)/articles/page.tsx | 13 +++++++++- src/components/ui/Header.tsx | 26 ++++++++++--------- src/components/ui/Section.tsx | 8 ++++-- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/app/(articles)/_components/ArticlesList.tsx b/src/app/(articles)/_components/ArticlesList.tsx index 850673f..9b1285c 100644 --- a/src/app/(articles)/_components/ArticlesList.tsx +++ b/src/app/(articles)/_components/ArticlesList.tsx @@ -2,7 +2,7 @@ import ArticleItem from "./ArticleItem"; const ArticlesList = () => { return ( -
+
diff --git a/src/app/(articles)/articles/page.tsx b/src/app/(articles)/articles/page.tsx index e160a2a..de050e9 100644 --- a/src/app/(articles)/articles/page.tsx +++ b/src/app/(articles)/articles/page.tsx @@ -1,5 +1,16 @@ +import Header from "@/components/ui/Header"; +import ArticlesList from "../_components/ArticlesList"; +import Section from "@/components/ui/Section"; + const Page = () => { - return
articles ...
; + return ( +
+
+
+ +
+
+ ); }; export default Page; diff --git a/src/components/ui/Header.tsx b/src/components/ui/Header.tsx index ef1ee1f..4a13a61 100644 --- a/src/components/ui/Header.tsx +++ b/src/components/ui/Header.tsx @@ -15,8 +15,8 @@ const alexandria = Alexandria({ interface IHeaderProps { title: string; - linkText: string; - href: string; + linkText?: string; + href?: string; } const Header: React.FC = ({ title, linkText, href }) => { @@ -29,16 +29,18 @@ const Header: React.FC = ({ title, linkText, href }) => {
- - {linkText} - - + {linkText && href && ( + + {linkText} + + + )} ); }; diff --git a/src/components/ui/Section.tsx b/src/components/ui/Section.tsx index 1cd83a0..2fdfd39 100644 --- a/src/components/ui/Section.tsx +++ b/src/components/ui/Section.tsx @@ -4,17 +4,19 @@ interface ISectionProps { children: ReactNode; hasEllipse?: boolean; type?: "primary" | "common"; + className?: string; } const Section: React.FC = ({ children, hasEllipse = false, type = "common", + className, }) => { if (type === "primary") { return (
{children}
@@ -23,7 +25,9 @@ const Section: React.FC = ({ if (type === "common") { return ( -
+
{children}
); From 2286197940385c40e08ac71bd90649de07f95f70 Mon Sep 17 00:00:00 2001 From: Abolfazl Jamshidi Date: Tue, 4 Jun 2024 17:16:53 +0330 Subject: [PATCH 2/2] feat: add newsletter submit box --- src/app/(articles)/articles/page.tsx | 4 ++ src/app/globals.css | 2 + src/components/ui/Newsletter.tsx | 55 ++++++++++++++++++++++++++++ tailwind.config.ts | 2 + 4 files changed, 63 insertions(+) create mode 100644 src/components/ui/Newsletter.tsx diff --git a/src/app/(articles)/articles/page.tsx b/src/app/(articles)/articles/page.tsx index de050e9..8690f74 100644 --- a/src/app/(articles)/articles/page.tsx +++ b/src/app/(articles)/articles/page.tsx @@ -2,6 +2,8 @@ import Header from "@/components/ui/Header"; import ArticlesList from "../_components/ArticlesList"; import Section from "@/components/ui/Section"; +import Newsletter from "@/components/ui/Newsletter"; + const Page = () => { return (
@@ -9,6 +11,8 @@ const Page = () => {
+ + ); }; diff --git a/src/app/globals.css b/src/app/globals.css index db1afd8..d5db70c 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -32,6 +32,7 @@ html { rgba(113, 39, 186, 0.5) 0%, rgba(113, 39, 186, 0) 100% ); + --bg-tertiary: #fcf9ff; } /* If the user's system preference is dark */ @@ -51,6 +52,7 @@ html { --gray-1: white; --purple-2: "#4E4458"; --border-color: "#ABB2BF"; + --bg-tertiary: #14161a80; } } diff --git a/src/components/ui/Newsletter.tsx b/src/components/ui/Newsletter.tsx new file mode 100644 index 0000000..87812cb --- /dev/null +++ b/src/components/ui/Newsletter.tsx @@ -0,0 +1,55 @@ +/* eslint-disable no-irregular-whitespace */ +import { Alexandria, Ubuntu } from "next/font/google"; + +const alexandria = Alexandria({ + subsets: ["latin"], + weight: ["300", "400", "600", "700"], + preload: true, +}); + +const ubuntu = Ubuntu({ + subsets: ["latin"], + weight: ["300"], + preload: true, +}); + +const Newsletter = () => { + return ( +
+
+

+ Subscribe to my newsletter +

+

+ Monthly personal reading and updates on topics like tech, design, + productivity, programming, and more! +

+ +
+
+ +
+
+ +
+
+ + + Join the 110 other readers. + +
+
+ ); +}; + +export default Newsletter; diff --git a/tailwind.config.ts b/tailwind.config.ts index 6cfeb1b..28e955b 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -14,6 +14,7 @@ const config: Config = { "purple-2": "var(--purple-2)", "border-articles": "var(--border-color)", "text-secondary": "var(--text-secondary)", + "tertiary-bg": "var(--bg-tertiary)", "purple-5": "#553F72", "gray-1": "var(--gray-1)", "gray-2": "#ABB2BF", @@ -46,6 +47,7 @@ const config: Config = { }, borderRadius: { 5: "5px", + 10: "10px", 20: "20px", 40: "40px", 80: "80px",