{posts.data.map((post) =>
)}
diff --git a/next/src/components/categories/category-link/CategoryLink.tsx b/next/src/components/categories/category-link/CategoryLink.tsx
index 18d09bd..f291f0e 100644
--- a/next/src/components/categories/category-link/CategoryLink.tsx
+++ b/next/src/components/categories/category-link/CategoryLink.tsx
@@ -1,4 +1,5 @@
import Link from 'next/link';
+import Image from 'next/image';
import React, { FunctionComponent } from 'react';
import styles from './styles.module.scss';
import { Category } from '@/components/categories/types';
@@ -11,11 +12,22 @@ interface Props {
const CategoryLink: FunctionComponent
= ({ activeCategory, name }) => {
const isActiveCategory = name === activeCategory;
- const setActiveCategory = isActiveCategory ? styles.active : '';
+ const setActiveClassName = isActiveCategory ? styles.active : '';
const setHref = isActiveCategory ? '/blog' : `/blog?category=${name}`;
return (
- #{name}
+
+ #{name}
+ {isActiveCategory && (
+
+ )}
+
);
};
diff --git a/next/src/components/categories/category-link/styles.module.scss b/next/src/components/categories/category-link/styles.module.scss
index 8329331..57868ce 100644
--- a/next/src/components/categories/category-link/styles.module.scss
+++ b/next/src/components/categories/category-link/styles.module.scss
@@ -1,9 +1,24 @@
@import '@/styles/vars';
.link {
- color: darken($color-text, 40%);
+ display: flex;
+ align-items: center;
+
+ .text {
+ color: darken($color-text, 40%);
+ }
+
+ .cross {
+ margin-left: .2rem;
+ }
&.active {
- color: $color-accent;
+ border-radius: .35rem;
+ padding: .5rem;
+ background-color: darken($color-accent, 10%);
+
+ .text {
+ color: $color-text;
+ }
}
}
\ No newline at end of file
diff --git a/next/src/components/categories/styles.module.scss b/next/src/components/categories/styles.module.scss
index e150921..9675e5c 100644
--- a/next/src/components/categories/styles.module.scss
+++ b/next/src/components/categories/styles.module.scss
@@ -3,6 +3,7 @@
.categories {
margin-bottom: 3rem;
justify-content: flex-start;
+ align-items: center;
display: flex;
gap: .5rem;
}
\ No newline at end of file
diff --git a/next/src/scripts/fetch.ts b/next/src/scripts/fetch.ts
index 72113e1..b7f9032 100644
--- a/next/src/scripts/fetch.ts
+++ b/next/src/scripts/fetch.ts
@@ -66,6 +66,22 @@ export const db = {
const queryString = qs.stringify(queryParams);
return await fetchWrapper(`/posts?${queryString}`);
},
+ getPostsBySearchTerm: async (searchValue: string) => {
+ const queryParams = {
+ filters: {
+ title: {
+ $containsi: searchValue
+ }
+ },
+ pagination: {
+ pageSize: 10,
+ page: 1
+ }
+ };
+
+ const queryString = qs.stringify(queryParams);
+ return await fetchWrapper(`/posts?${queryString}`);
+ },
getPostSlugs: async () => {
const queryParams = {
fields: ['slug']
diff --git a/next/src/styles/about-and-blog-content.module.scss b/next/src/styles/about-and-blog-content.module.scss
index e1a5c5c..d07bb7c 100644
--- a/next/src/styles/about-and-blog-content.module.scss
+++ b/next/src/styles/about-and-blog-content.module.scss
@@ -1,4 +1,4 @@
-$margin-top-value: 1rem;
+$margin-top-value: 1.5rem;
/**
Typography, spacings and other styles for /about and /blog/[slug]
diff --git a/next/src/styles/global.scss b/next/src/styles/global.scss
index cc2ae57..3922e6d 100644
--- a/next/src/styles/global.scss
+++ b/next/src/styles/global.scss
@@ -4,6 +4,7 @@
font-family: 'League Spartan', sans-serif;
color: $color-text;
text-decoration: none;
+ box-sizing: border-box;
}
body {