Skip to content

Commit

Permalink
Add layout updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MathyouMB committed Jun 27, 2023
1 parent 105b8cb commit c99f8f1
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 40 deletions.
1 change: 1 addition & 0 deletions src/components/islands/Search/Search.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
display: flex;
justify-content: space-between;
font-size: 1.2rem;
border: 1px solid rgb(235, 235, 235);

i {
color: rgb(160, 160, 160);
Expand Down
21 changes: 7 additions & 14 deletions src/components/resources/Navbar/Navbar.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
import { Search } from "../../islands";
import "./Navbar.style.scss";
const { searchList } = Astro.props;
---

<div class="resources-navbar">
Expand All @@ -9,21 +11,12 @@ import "./Navbar.style.scss";
<img src="/images/ccss-logo-2022.png" alt="logo" />
</a>
</div>
<div class="resources-navbar__menu">
<!-- TODO: render nav elements from content data -->
<!-- <ul>
<li>
<a href="/about">About</a>
</li>
<li>
<a href="/events">Events</a>
</li>
<li>
<a href="/resources">Resources</a>
</li>
</ul> -->
<div class="resources-navbar__center">
<div class="resources-navbar__menu">
<Search client:load searchList={searchList} />
</div>
</div>
<div class="resources-navbar__search">
<div class="resources-navbar__right">
<!-- TODO: add search -->
<!--<input type="text" placeholder="Search" />-->
</div>
Expand Down
19 changes: 10 additions & 9 deletions src/components/resources/Navbar/Navbar.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1rem;
padding: 0.75rem 0.75rem;
background-color: white;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
width: 100vw;
Expand Down Expand Up @@ -37,13 +37,14 @@
}
}

&__search {
input {
border: 1px solid #a9a9a9;
padding: 0.5rem 1rem;
border-radius: 0.625rem;
outline: none;
min-width: 15rem;
}
&__center {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}

&__right {
width: 15rem;
}
}
9 changes: 1 addition & 8 deletions src/components/resources/Sidebar/Sidebar.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
position: fixed;
width: 260px;
flex-shrink: 0;
background-color: rgb(255, 255, 255);
background-color: #fafafa;
height: 100vh;
overflow: auto;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 1rem;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
padding-right: 0rem;

&__logo {
img {
padding: 1rem;
width: 14rem;
}
}
}

.sidebar-item {
Expand Down
5 changes: 0 additions & 5 deletions src/components/resources/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import "./Sidebar.style.scss";
export default function Sidebar() {
return (
<div className="sidebar">
<div className="sidebar__logo">
<a href="/">
<img src="/images/ccss-logo-2022.png" alt="logo" />
</a>
</div>
{items.map((item, index) => (
<SidebarItem key={index} item={item} />
))}
Expand Down
2 changes: 2 additions & 0 deletions src/components/resources/Sidebar/SidebarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export default function SidebarItem(props: SidebarItemProps) {
</button>
</div>
<div className="sidebar-content">
{/* TODO: don't hardcode this */}
<div style={{ marginBottom: "0.5rem" }}></div>
{props.item.children.map((child, index) => (
<SidebarItem key={index} item={child} />
))}
Expand Down
4 changes: 4 additions & 0 deletions src/layouts/Resource.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Base from "../layouts/Base.astro";
import { Navbar, Sidebar } from "../components/resources";
import "./Resource.style.scss";
import { getCollection } from "astro:content";
const { frontmatter } = Astro.props;
const metadata = {
Expand All @@ -10,9 +11,12 @@ const metadata = {
url: "",
image: "/",
};
const resourcePages = await getCollection("resources");
---

<Base {metadata}>
<Navbar searchList={resourcePages} />
<div class="resources-layout__container">
<Sidebar client:load />
<div class="resources-layout__content">
Expand Down
1 change: 1 addition & 0 deletions src/layouts/Resource.style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.resources-layout__container {
display: flex;
min-height: 100%;
margin-top: 5.1rem;
}

.resources-layout__content {
Expand Down
4 changes: 0 additions & 4 deletions src/pages/resources.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import { getCollection } from "astro:content";
import { Navbar } from "../components/resources";
import { TopicCard } from "../components/core";
import { Search } from "../components/islands";
import Base from "../layouts/Base.astro";
Expand All @@ -17,9 +16,6 @@ const resourcePages = await getCollection("resources");
---

<Base {metadata}>
<Navbar />
<!-- TODO: remove this demo margin -->
<div style="margin-top:5rem"></div>
<div class="resources-page__heading">
<p class="resources-page__heading-title">Resources</p>
<p class="resources-page__heading-subtitle">
Expand Down

0 comments on commit c99f8f1

Please sign in to comment.