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 {
9
9
const { title, href } = Astro .props
10
10
---
11
11
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" >
14
14
<div >
15
15
<h2 >{ title } </h2 >
16
16
</div >
@@ -20,8 +20,17 @@ const { title, href } = Astro.props
20
20
21
21
<style lang =" scss" >
22
22
.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
+ }
26
35
}
27
36
</style >
Original file line number Diff line number Diff line change @@ -4,19 +4,12 @@ import type { CollectionEntry } from 'astro:content'
4
4
import PostItem from ' @/components/post/PostItem.astro'
5
5
6
6
export interface Props {
7
- posts: CollectionEntry <any >[];
7
+ posts: CollectionEntry <any >[]
8
8
}
9
9
10
10
const { posts = [] } = Astro .props
11
11
---
12
12
13
13
<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 } ` } />)}
22
15
</div >
Original file line number Diff line number Diff line change 1
1
---
2
2
import { getCollection } from ' astro:content'
3
3
4
+ import LeetCodeDifficulty from ' @/components/LeetCodeDifficulty.astro'
4
5
import PostList from ' @/components/post/PostList.astro'
5
6
import siteConfig from ' @/configs/site'
6
7
import AppLayout from ' @/layouts/AppLayout.astro'
@@ -17,6 +18,11 @@ const posts = await getCollection('leetcode-solutions')
17
18
headerCssClasses =" max-w-xl px-8"
18
19
>
19
20
<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 >
20
26
<PostList posts ={ posts } />
21
27
</main >
22
28
</AppLayout >
You can’t perform that action at this time.
0 commit comments