aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/layout')
-rw-r--r--src/components/organisms/layout/cards-list.tsx1
-rw-r--r--src/components/organisms/layout/posts-list.module.scss9
-rw-r--r--src/components/organisms/layout/posts-list.tsx4
3 files changed, 10 insertions, 4 deletions
diff --git a/src/components/organisms/layout/cards-list.tsx b/src/components/organisms/layout/cards-list.tsx
index 1558d7c..0168bb2 100644
--- a/src/components/organisms/layout/cards-list.tsx
+++ b/src/components/organisms/layout/cards-list.tsx
@@ -77,7 +77,6 @@ const CardsList: FC<CardsListProps> = ({
<List
kind="flex"
items={getCards(items)}
- withMargin={false}
className={`${styles.wrapper} ${styles[kindModifier]} ${className}`}
/>
);
diff --git a/src/components/organisms/layout/posts-list.module.scss b/src/components/organisms/layout/posts-list.module.scss
index a006914..b09bb12 100644
--- a/src/components/organisms/layout/posts-list.module.scss
+++ b/src/components/organisms/layout/posts-list.module.scss
@@ -3,6 +3,10 @@
@use "@styles/abstracts/placeholders";
.section {
+ &:not(:last-of-type) {
+ margin-bottom: var(--spacing-md);
+ }
+
@include mix.media("screen") {
@include mix.dimensions("md") {
display: grid;
@@ -17,8 +21,11 @@
@extend %reset-ordered-list;
.item {
- margin-bottom: var(--spacing-md);
border-bottom: fun.convert-px(1) solid var(--color-border);
+
+ &:not(:last-child) {
+ margin-bottom: var(--spacing-md);
+ }
}
}
diff --git a/src/components/organisms/layout/posts-list.tsx b/src/components/organisms/layout/posts-list.tsx
index 50192dd..608130e 100644
--- a/src/components/organisms/layout/posts-list.tsx
+++ b/src/components/organisms/layout/posts-list.tsx
@@ -100,6 +100,8 @@ const PostsList: FC<PostsListProps> = ({
const isMounted = useIsMounted(listRef);
const { blog } = useSettings();
+ const lastPostId = posts.length ? posts[posts.length - 1].id : 0;
+
/**
* Retrieve the list of posts.
*
@@ -111,8 +113,6 @@ const PostsList: FC<PostsListProps> = ({
allPosts: Post[],
headingLevel: HeadingLevel = 2
): JSX.Element => {
- const lastPostId = allPosts[allPosts.length - 1].id;
-
return (
<ol className={styles.list} ref={listRef}>
{allPosts.map(({ id, ...post }) => (