From e3b0505411c8b197a46180032bfe8bce3c3217f9 Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Mon, 13 Jan 2025 11:46:08 -0500 Subject: [PATCH 1/2] Implement MainLayout for navigation structure and initial feed page --- src/assets/bell.svg | 3 + src/assets/copy-plus.svg | 6 ++ src/assets/feed.svg | 3 + src/assets/heart-handshake.svg | 6 ++ src/assets/message.svg | 3 + src/assets/search.svg | 3 + src/assets/user-circle.svg | 6 ++ src/components/LoadingSpinner.astro | 1 + src/layouts/MainLayout.astro | 74 +++++++++++++++++++ .../{Layout.astro => MenuLayout.astro} | 0 src/pages/feed.astro | 54 ++++++++++++++ src/pages/index.astro | 9 +-- src/pages/login.astro | 23 +++--- src/styles/global.css | 9 +++ 14 files changed, 181 insertions(+), 19 deletions(-) create mode 100644 src/assets/bell.svg create mode 100644 src/assets/copy-plus.svg create mode 100644 src/assets/feed.svg create mode 100644 src/assets/heart-handshake.svg create mode 100644 src/assets/message.svg create mode 100644 src/assets/search.svg create mode 100644 src/assets/user-circle.svg create mode 100644 src/layouts/MainLayout.astro rename src/layouts/{Layout.astro => MenuLayout.astro} (100%) create mode 100644 src/pages/feed.astro diff --git a/src/assets/bell.svg b/src/assets/bell.svg new file mode 100644 index 0000000..6245733 --- /dev/null +++ b/src/assets/bell.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/copy-plus.svg b/src/assets/copy-plus.svg new file mode 100644 index 0000000..4b9a40f --- /dev/null +++ b/src/assets/copy-plus.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/feed.svg b/src/assets/feed.svg new file mode 100644 index 0000000..12a7dbe --- /dev/null +++ b/src/assets/feed.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/heart-handshake.svg b/src/assets/heart-handshake.svg new file mode 100644 index 0000000..c2e5188 --- /dev/null +++ b/src/assets/heart-handshake.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/message.svg b/src/assets/message.svg new file mode 100644 index 0000000..44fdf79 --- /dev/null +++ b/src/assets/message.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/search.svg b/src/assets/search.svg new file mode 100644 index 0000000..548bc4a --- /dev/null +++ b/src/assets/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/user-circle.svg b/src/assets/user-circle.svg new file mode 100644 index 0000000..d14ca89 --- /dev/null +++ b/src/assets/user-circle.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/components/LoadingSpinner.astro b/src/components/LoadingSpinner.astro index b25de6a..8605726 100644 --- a/src/components/LoadingSpinner.astro +++ b/src/components/LoadingSpinner.astro @@ -10,6 +10,7 @@ const { size = "10px" } = Astro.props; border: calc(var(--spinner-size) / 2) solid #f3f3f375; border-radius: 50%; border-top: calc(var(--spinner-size) / 2) solid white; + box-sizing: content-box; height: var(--spinner-size); width: var(--spinner-size); } diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro new file mode 100644 index 0000000..92e3466 --- /dev/null +++ b/src/layouts/MainLayout.astro @@ -0,0 +1,74 @@ +--- +import Icon from "../components/icon.astro"; +import "../styles/global.css"; + +const { title } = Astro.props; +--- + + + + + + + + + {title} + + +
+ +
+ + + + + diff --git a/src/layouts/Layout.astro b/src/layouts/MenuLayout.astro similarity index 100% rename from src/layouts/Layout.astro rename to src/layouts/MenuLayout.astro diff --git a/src/pages/feed.astro b/src/pages/feed.astro new file mode 100644 index 0000000..ae5e5b7 --- /dev/null +++ b/src/pages/feed.astro @@ -0,0 +1,54 @@ +--- +import Icon from "../components/icon.astro"; +import MainLayout from "../layouts/MainLayout.astro"; +--- + + + +
+
+ + diff --git a/src/pages/index.astro b/src/pages/index.astro index dec3ba8..7c96b31 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,13 +1,10 @@ --- import Icon from "../components/icon.astro"; -import Layout from "../layouts/Layout.astro"; +import MenuLayout from "../layouts/MenuLayout.astro"; import LoadingSpinner from "../components/LoadingSpinner.astro"; - -// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build -// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh. --- - +
@@ -20,7 +17,7 @@ import LoadingSpinner from "../components/LoadingSpinner.astro"; window.location.href = "login.html"; }, 1000); - + diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index 92e3466..5792a45 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -1,5 +1,5 @@ --- -import Icon from "../components/icon.astro"; +import Icon from "../components/Icon.astro"; import "../styles/global.css"; const { title } = Astro.props; diff --git a/src/pages/feed.astro b/src/pages/feed.astro index ae5e5b7..6235e4d 100644 --- a/src/pages/feed.astro +++ b/src/pages/feed.astro @@ -1,6 +1,28 @@ --- -import Icon from "../components/icon.astro"; +import Icon from "../components/Icon.astro"; +import Post from "../components/Post.astro"; import MainLayout from "../layouts/MainLayout.astro"; + +const components = [ + { + title: "This is a post", + description: "This is the prototype for the feed.", + }, + { + title: "This is another post", + description: "The feed will be like LinkedIn's feed.", + date: "2021-10-02", + }, + { + title: "This is a third post", + description: "Users will share their projects, thoughts, and more.", + date: "2021-10-03", + }, + { + title: "This is a fourth post", + description: "Users will be able to like, comment, and share posts.", + }, +]; --- @@ -11,7 +33,17 @@ import MainLayout from "../layouts/MainLayout.astro";
-
+
+ { + components.map((component) => ( + + )) + } +