Skip to content

Commit

Permalink
Update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmbrown committed Feb 1, 2025
1 parent 060722d commit 6756dc8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
15 changes: 0 additions & 15 deletions src/components/ui/FeedItem.jsx

This file was deleted.

13 changes: 13 additions & 0 deletions src/components/ui/NoteItem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default function NoteItem({ note }) {
const title = note.data.title
const pubDate = new Date(note.data.pubDate).toDateString().slice(4, 15)

return (
<a href={`/notes/${note.id}`}>
<div class="flex flex-col justify-between md:flex-row md:mb-3 mb-3 bg-[#1E262F] p-6 text-lg rounded-lg">
<div class="mr-2">{title}</div>
<div class="text-[#7E8C9A] shrink-0">{pubDate}</div>
</div>
</a>
)
}
1 change: 0 additions & 1 deletion src/components/ui/TagItem.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
export default function TagItem({ tag }) {
return (
<a href={`/tags/${tag}`}>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Main from '../layouts/Main.astro'
import { getCollection } from 'astro:content'
import FeedItem from '../components/ui/FeedItem'
import NoteItem from '../components/ui/NoteItem'
const allNotes = await getCollection('notes')
allNotes.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
Expand All @@ -25,6 +25,6 @@ allNotes.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
</div>

{allNotes.slice(0, 5).map((note) =>
<FeedItem client:load note={note} />
<NoteItem client:load note={note} />
)}
</Main>
4 changes: 2 additions & 2 deletions src/pages/tags/[tag].astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Main from '../../layouts/Main.astro'
import { getCollection } from 'astro:content'
import FeedItem from '../../components/ui/FeedItem'
import NoteItem from '../../components/ui/NoteItem'
export async function getStaticPaths() {
const allNotes = await getCollection('notes')
Expand Down Expand Up @@ -30,6 +30,6 @@ const title = `Tag: ${tag}`
>
<div class="mb-6 text-xl">{filteredNotes.length} notes tagged with <span class="font-bold">{tag}</span>:</div>
{filteredNotes.map((note) =>
<FeedItem client:load note={note} />
<NoteItem client:load note={note} />
)}
</Main>

0 comments on commit 6756dc8

Please sign in to comment.