Skip to content

Commit

Permalink
add blog route
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Jan 18, 2024
1 parent e5051f5 commit 1f86e67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/components/Blog/SearchFilterResults/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export const _getFilteredPosts = ({ posts, selectedCategories }: { posts: any[];
})
}

// add a generic type to this compoenent
// maybe receives categories as well?
const SearchFilterResults = ({ allPosts, categories }: { allPosts: BlogPostEntry[]; categories: BlogCategory }) => {
const [selectedCategories, setSelectedCategories] = useState(EMPTY_FILTER)
const [query, setQuery] = useState('')
Expand All @@ -68,10 +66,6 @@ const SearchFilterResults = ({ allPosts, categories }: { allPosts: BlogPostEntry

// Category filtered results
const filteredPosts = useMemo(() => {
// if (noFilters) {
// return projects
// }

return _getFilteredPosts({ posts: allPosts, selectedCategories })
}, [allPosts, selectedCategories])

Expand Down Expand Up @@ -102,8 +96,7 @@ const SearchFilterResults = ({ allPosts, categories }: { allPosts: BlogPostEntry
</Typography>{' '}
{categories.map((category, idx, { length }) => {
return (
<Fragment key={category + idx}>
{/* TODO: Implement */}
<Fragment key={`${category}-${idx}`}>
<Typography component="span">
<SpecificCategoryFilter category={category} onClick={toggleSpecificCategory} />
{idx !== length - 1 && ', '}
Expand Down
1 change: 0 additions & 1 deletion src/components/Blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import FeaturedPost from '@/components/Blog/FeaturedPost'
import { type BlogPostEntry } from '@/components/Blog/Post'
import SearchFilterResults from '@/components/Blog/SearchFilterResults'

// Should come from the CMS?
const categories = ['Announcements', 'Ecosystem', 'Community', 'Insights', 'Build'] as const
export type BlogCategory = typeof categories

Expand Down
9 changes: 8 additions & 1 deletion src/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ export const AppRoutes = {
privacy: '/privacy',
index: '/',
imprint: '/imprint',
governance: '/governance',
ecosystem: '/ecosystem',
core: '/core',
cookie: '/cookie',
cla: {
index: '/cla',
},
careers: '/careers',
governance: '/governance',
blog: {
index: '/blog',
slug: '/blog/[slug]',
},
campaigns: {
slug: '/campaigns/[slug]',
},
}
4 changes: 4 additions & 0 deletions src/content/navItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
{
"label": "Careers",
"href": "/careers"
},
{
"label": "Blog",
"href": "/blog"
}
]

0 comments on commit 1f86e67

Please sign in to comment.