File tree Expand file tree Collapse file tree 3 files changed +22
-14
lines changed
Expand file tree Collapse file tree 3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ export interface Props {
99const { title, href } = Astro .props
1010---
1111
12- <a href ={ href } >
13- <div class =" post-item flex items-center justify-between" >
12+ <a href ={ href } class = " post-item " >
13+ <div class =" flex items-center justify-between" >
1414 <div >
1515 <h2 >{ title } </h2 >
1616 </div >
@@ -20,8 +20,17 @@ const { title, href } = Astro.props
2020
2121<style lang =" scss" >
2222 .post-item {
23- @apply mx-3 my-2 p-3;
24- @apply border-2 border-solid border-style-primary;
25- @apply hover:bg-style-primary text-style-secondary hover:text-style-primary-inverted;
23+ &:first-child {
24+ @apply mt-4;
25+ }
26+ &:last-child {
27+ @apply mb-4;
28+ }
29+
30+ & > div {
31+ @apply mx-4 p-4;
32+ @apply border-2 border-solid border-style-primary;
33+ @apply hover:bg-style-primary text-style-secondary hover:text-style-primary-inverted;
34+ }
2635 }
2736</style >
Original file line number Diff line number Diff line change @@ -4,19 +4,12 @@ import type { CollectionEntry } from 'astro:content'
44import PostItem from ' @/components/post/PostItem.astro'
55
66export interface Props {
7- posts: CollectionEntry <any >[];
7+ posts: CollectionEntry <any >[]
88}
99
1010const { posts = [] } = Astro .props
1111---
1212
1313<div role =" list" class =" grid grid-cols-1 gap-4" >
14- {
15- posts .map ((p ) => (
16- <PostItem
17- title = { ` ${p .data .title } ` }
18- href = { ` /${p .slug } ` }
19- />
20- ))
21- }
14+ { posts .map ((p ) => <PostItem title = { ` ${p .data .title } ` } href = { ` /${p .slug } ` } />)}
2215</div >
Original file line number Diff line number Diff line change 11---
22import { getCollection } from ' astro:content'
33
4+ import LeetCodeDifficulty from ' @/components/LeetCodeDifficulty.astro'
45import PostList from ' @/components/post/PostList.astro'
56import siteConfig from ' @/configs/site'
67import AppLayout from ' @/layouts/AppLayout.astro'
@@ -17,6 +18,11 @@ const posts = await getCollection('leetcode-solutions')
1718 headerCssClasses =" max-w-xl px-8"
1819>
1920 <main class =" mx-auto my-4 p-4 max-w-xl text-site-header-text" >
21+ <div class =" grid grid-flow-col auto-cols-max gap-2 m-4 justify-center" >
22+ <LeetCodeDifficulty difficulty =" Easy" />
23+ <LeetCodeDifficulty difficulty =" Medium" />
24+ <LeetCodeDifficulty difficulty =" Hard" />
25+ </div >
2026 <PostList posts ={ posts } />
2127 </main >
2228</AppLayout >
You can’t perform that action at this time.
0 commit comments