Skip to content

Commit 58fc6cd

Browse files
chore: fix conflicts
1 parent 76f4f1b commit 58fc6cd

File tree

7 files changed

+54
-46
lines changed

7 files changed

+54
-46
lines changed

apps/sim/app/(landing)/blog/[slug]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ export async function generateMetadata({
3535

3636
export default async function Page({ params }: { params: Promise<{ slug: string }> }) {
3737
const { slug } = await params
38-
const post = await getPostBySlug(slug)
38+
const [post, related] = await Promise.all([getPostBySlug(slug), getRelatedPosts(slug, 3)])
3939
const Article = post.Content
4040
const jsonLd = buildArticleJsonLd(post)
4141
const breadcrumbLd = buildBreadcrumbJsonLd(post)
42-
const related = await getRelatedPosts(slug, 3)
4342

4443
const category = getPrimaryCategory(post.tags)
4544
const categoryColor = category.color

apps/sim/app/(landing)/blog/category-list.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ interface CategoryListProps {
1717
activeId: string | null
1818
}
1919

20-
const ROW_H = 38
21-
2220
export function CategoryList({ items, activeId }: CategoryListProps) {
2321
const shouldReduceMotion = useReducedMotion()
2422
const listRef = useRef<HTMLUListElement>(null)

apps/sim/app/(landing)/blog/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export default async function StudioIndex({
1515
const { tag, q } = await searchParams
1616
const all = await getAllPostMeta()
1717

18+
const pickAuthor = (a: { name: string; avatarUrl?: string }) => ({
19+
name: a.name,
20+
avatarUrl: a.avatarUrl,
21+
})
22+
1823
const posts = all.map((p) => ({
1924
slug: p.slug,
2025
title: p.title,
@@ -23,8 +28,8 @@ export default async function StudioIndex({
2328
ogImage: p.ogImage,
2429
readingTime: p.readingTime,
2530
tags: p.tags,
26-
author: p.author,
27-
authors: p.authors,
31+
author: pickAuthor(p.author),
32+
authors: p.authors?.map(pickAuthor),
2833
featured: p.featured ?? false,
2934
}))
3035

apps/sim/app/(landing)/blog/post-grid.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ const leadVariants = {
3636
}
3737

3838
interface Author {
39-
id: string
4039
name: string
4140
avatarUrl?: string
42-
url?: string
4341
}
4442

4543
interface Post {

apps/sim/app/(landing)/blog/sidebar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Suspense } from 'react'
12
import { getAllPostMeta } from '@/lib/blog/registry'
23
import { CategoryList } from '@/app/(landing)/blog/category-list'
34
import { SearchInput } from '@/app/(landing)/blog/search-input'
@@ -45,7 +46,9 @@ export async function StudioSidebar({ activeTag }: StudioSidebarProps) {
4546
<h2 className='mb-4 font-season text-[10px] uppercase tracking-widest text-[#666]'>
4647
Find Insights
4748
</h2>
48-
<SearchInput />
49+
<Suspense>
50+
<SearchInput />
51+
</Suspense>
4952
</div>
5053
<div className='flex flex-col pt-6'>
5154
<h2 className='mb-3 font-season text-[10px] uppercase tracking-widest text-[#ECECEC]'>

apps/sim/app/(landing)/blog/studio-content.tsx

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ interface SerializedPost {
1515
ogImage: string
1616
readingTime?: number
1717
tags: string[]
18-
author: { id: string; name: string; avatarUrl?: string; url?: string }
19-
authors?: { id: string; name: string; avatarUrl?: string; url?: string }[]
18+
author: { name: string; avatarUrl?: string }
19+
authors?: { name: string; avatarUrl?: string }[]
2020
featured?: boolean
2121
}
2222

@@ -59,7 +59,8 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
5959
const counts: Record<string, number> = {}
6060
for (const cat of CATEGORIES) counts[cat.id] = 0
6161
for (const post of posts) {
62-
counts[getPrimaryCategory(post.tags).id] = (counts[getPrimaryCategory(post.tags).id] ?? 0) + 1
62+
const catId = getPrimaryCategory(post.tags).id
63+
counts[catId] = (counts[catId] ?? 0) + 1
6364
}
6465
return [
6566
{ id: null as string | null, label: 'All Posts', count: posts.length, color: '#00F701' },
@@ -73,8 +74,9 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
7374
}, [posts])
7475

7576
// ── Filter + sort (runs instantly on state change) ──────────────────────
77+
const lowerQ = query.trim().toLowerCase()
78+
7679
const { sorted, activeCategory } = useMemo(() => {
77-
const lowerQ = query.trim().toLowerCase()
7880
let filtered = posts
7981

8082
if (activeTag) {
@@ -103,17 +105,22 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
103105
return new Date(b.date).getTime() - new Date(a.date).getTime()
104106
})
105107
return { sorted: s, activeCategory: cat }
106-
}, [posts, activeTag, query])
108+
}, [posts, activeTag, lowerQ])
107109

108-
// ── Pagination ──────────────────────────────────────────────────────────
109110
const totalPages = Math.max(1, Math.ceil(sorted.length / PER_PAGE))
110111
const pagePosts = sorted.slice((page - 1) * PER_PAGE, page * PER_PAGE)
111112

112-
const lowerQ = query.trim().toLowerCase()
113-
const featured = page === 1 && !activeTag && !lowerQ ? pagePosts.filter((p) => p.featured) : []
114-
const feed =
115-
page === 1 && !activeTag && !lowerQ ? pagePosts.filter((p) => !p.featured) : pagePosts
116-
const showHero = page === 1 && !activeTag && !lowerQ
113+
const isDefaultView = page === 1 && !activeTag && !lowerQ
114+
const featured: SerializedPost[] = []
115+
const feed: SerializedPost[] = []
116+
for (const p of pagePosts) {
117+
if (isDefaultView && p.featured) {
118+
featured.push(p)
119+
} else {
120+
feed.push(p)
121+
}
122+
}
123+
const showHero = isDefaultView
117124

118125
const handleCategorySelect = useCallback(
119126
(id: string | null) => {
@@ -168,7 +175,7 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
168175
<main className='relative min-w-0 flex-1'>
169176
<div className='flex flex-col'>
170177
{showHero && <StudioHero />}
171-
<div className='mx-auto w-full max-w-5xl px-6 py-12'>
178+
<div className='mx-auto w-full max-w-5xl py-12'>
172179
{lowerQ && (
173180
<div className='mb-8 flex items-center gap-3'>
174181
<span className='font-season text-[10px] uppercase tracking-widest text-[#666]'>
@@ -183,7 +190,7 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
183190
<button
184191
type='button'
185192
onClick={handleClearAll}
186-
className='font-mono text-[10px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
193+
className='font-season text-[10px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
187194
>
188195
Clear
189196
</button>
@@ -192,11 +199,11 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
192199

193200
{activeCategory && !lowerQ && (
194201
<div className='mb-8 flex items-center gap-3'>
195-
<span className='font-mono text-[10px] uppercase tracking-widest text-[#666]'>
202+
<span className='font-season text-[10px] uppercase tracking-widest text-[#666]'>
196203
Filtered by:
197204
</span>
198205
<span
199-
className='px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider'
206+
className='px-2 py-0.5 font-season text-[10px] uppercase tracking-wider'
200207
style={{
201208
border: `1px solid ${activeCategory.color}`,
202209
color: activeCategory.color,
@@ -207,7 +214,7 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
207214
<button
208215
type='button'
209216
onClick={handleClearAll}
210-
className='font-mono text-[10px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
217+
className='font-season text-[10px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
211218
>
212219
Clear
213220
</button>
@@ -216,7 +223,7 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
216223

217224
{featured.length > 0 && (
218225
<section className='mb-10'>
219-
<h2 className='mb-8 flex items-center gap-2 font-mono text-[11px] uppercase tracking-widest text-[#666]'>
226+
<h2 className='mb-8 flex items-center gap-2 font-season text-[11px] uppercase tracking-widest text-[#666]'>
220227
<span className='inline-block h-2 w-2 bg-[#FA4EDF]' aria-hidden='true' />
221228
Featured Content
222229
</h2>
@@ -226,7 +233,7 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
226233

227234
{feed.length > 0 && (
228235
<section>
229-
<h2 className='mb-8 flex items-center gap-2 font-mono text-[11px] uppercase tracking-widest text-[#666]'>
236+
<h2 className='mb-8 flex items-center gap-2 font-season text-[11px] uppercase tracking-widest text-[#666]'>
230237
<span className='inline-block h-2 w-2 bg-[#00F701]' aria-hidden='true' />
231238
{lowerQ ? 'Search Results' : activeCategory ? activeCategory.label : 'All Posts'}
232239
</h2>
@@ -242,7 +249,7 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
242249
<button
243250
type='button'
244251
onClick={handleClearAll}
245-
className='mt-4 inline-block font-mono text-[12px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
252+
className='mt-4 inline-block font-season text-[12px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
246253
>
247254
View all posts
248255
</button>
@@ -255,20 +262,20 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
255262
<button
256263
type='button'
257264
onClick={() => setPage((p) => p - 1)}
258-
className='border border-[#3d3d3d] bg-[#232323] px-6 py-2.5 font-mono text-[11px] uppercase tracking-wider text-[#999] transition-colors hover:border-[#666] hover:text-[#ECECEC]'
265+
className='border border-[#3d3d3d] bg-[#232323] px-6 py-2.5 font-season text-[11px] uppercase tracking-wider text-[#999] transition-colors hover:border-[#666] hover:text-[#ECECEC]'
259266
style={{ borderRadius: '5px' }}
260267
>
261268
Previous
262269
</button>
263270
)}
264-
<span className='font-mono text-[10px] uppercase tracking-wider text-[#666]'>
271+
<span className='font-season text-[10px] uppercase tracking-wider text-[#666]'>
265272
Page {page} of {totalPages}
266273
</span>
267274
{page < totalPages && (
268275
<button
269276
type='button'
270277
onClick={() => setPage((p) => p + 1)}
271-
className='border border-[#3d3d3d] bg-[#232323] px-6 py-2.5 font-mono text-[11px] uppercase tracking-wider text-[#999] transition-colors hover:border-[#666] hover:text-[#ECECEC]'
278+
className='border border-[#3d3d3d] bg-[#232323] px-6 py-2.5 font-season text-[11px] uppercase tracking-wider text-[#999] transition-colors hover:border-[#666] hover:text-[#ECECEC]'
272279
style={{ borderRadius: '5px' }}
273280
>
274281
Load more articles
@@ -283,7 +290,6 @@ export function StudioContent({ posts, initialTag, initialQuery }: StudioContent
283290
)
284291
}
285292

286-
287293
interface SidebarSearchProps {
288294
value: string
289295
onChange: (value: string) => void
@@ -308,7 +314,6 @@ function SidebarSearch({ value, onChange }: SidebarSearchProps) {
308314
)
309315
}
310316

311-
312317
interface SidebarCategoryItem {
313318
id: string | null
314319
label: string

apps/sim/app/(landing)/blog/studio-feed.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use client'
22

33
import { useCallback, useMemo, useState } from 'react'
4-
import { StudioHero } from '@/app/(landing)/studio/hero'
5-
import { FeaturedGrid, PostGrid } from '@/app/(landing)/studio/post-grid'
6-
import { CATEGORIES, getCategoryById, getPrimaryCategory } from '@/app/(landing)/studio/tag-colors'
4+
import { StudioHero } from '@/app/(landing)/blog/hero'
5+
import { FeaturedGrid, PostGrid } from '@/app/(landing)/blog/post-grid'
6+
import { CATEGORIES, getCategoryById, getPrimaryCategory } from '@/app/(landing)/blog/tag-colors'
77

88
interface SerializedPost {
99
slug: string
@@ -81,11 +81,11 @@ export function StudioFeed({ posts, initialTag }: StudioFeedProps) {
8181
<div className='mx-auto w-full max-w-5xl py-12'>
8282
{activeCategory && (
8383
<div className='mb-8 flex items-center gap-3'>
84-
<span className='font-mono text-[10px] uppercase tracking-widest text-[#666]'>
84+
<span className='font-season text-[10px] uppercase tracking-widest text-[#666]'>
8585
Filtered by:
8686
</span>
8787
<span
88-
className='px-2 py-0.5 font-mono text-[10px] uppercase tracking-wider'
88+
className='px-2 py-0.5 font-season text-[10px] uppercase tracking-wider'
8989
style={{
9090
border: `1px solid ${activeCategory.color}`,
9191
color: activeCategory.color,
@@ -96,15 +96,15 @@ export function StudioFeed({ posts, initialTag }: StudioFeedProps) {
9696
<button
9797
type='button'
9898
onClick={() => handleCategoryClick(null)}
99-
className='font-mono text-[10px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
99+
className='font-season text-[10px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
100100
>
101101
Clear
102102
</button>
103103
</div>
104104
)}
105105
{featured.length > 0 && (
106106
<section className='mb-10'>
107-
<h2 className='mb-8 flex items-center gap-2 font-mono text-[11px] uppercase tracking-widest text-[#666]'>
107+
<h2 className='mb-8 flex items-center gap-2 font-season text-[11px] uppercase tracking-widest text-[#666]'>
108108
<span className='inline-block h-2 w-2 bg-[#FA4EDF]' aria-hidden='true' />
109109
Featured Content
110110
</h2>
@@ -113,7 +113,7 @@ export function StudioFeed({ posts, initialTag }: StudioFeedProps) {
113113
)}
114114
{feed.length > 0 && (
115115
<section>
116-
<h2 className='mb-8 flex items-center gap-2 font-mono text-[11px] uppercase tracking-widest text-[#666]'>
116+
<h2 className='mb-8 flex items-center gap-2 font-season text-[11px] uppercase tracking-widest text-[#666]'>
117117
<span className='inline-block h-2 w-2 bg-[#00F701]' aria-hidden='true' />
118118
{activeCategory ? activeCategory.label : 'All Posts'}
119119
</h2>
@@ -126,7 +126,7 @@ export function StudioFeed({ posts, initialTag }: StudioFeedProps) {
126126
<button
127127
type='button'
128128
onClick={() => handleCategoryClick(null)}
129-
className='mt-4 inline-block font-mono text-[12px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
129+
className='mt-4 inline-block font-season text-[12px] uppercase tracking-wider text-[#999] transition-colors hover:text-[#ECECEC]'
130130
>
131131
View all posts
132132
</button>
@@ -184,15 +184,15 @@ function Sidebar({ items, activeId, onSelect }: SidebarProps) {
184184
<aside className='flex w-full shrink-0 flex-col border-r border-[#2A2A2A] bg-[#1C1C1C] p-8 lg:sticky lg:top-[52px] lg:h-[calc(100vh-52px)] lg:w-72 lg:overflow-y-auto'>
185185
<div className='flex h-full flex-col'>
186186
<div className='mb-10'>
187-
<h2 className='mb-4 font-mono text-[10px] uppercase tracking-widest text-[#666]'>
187+
<h2 className='mb-4 font-season text-[10px] uppercase tracking-widest text-[#666]'>
188188
Find Insights
189189
</h2>
190190
<div className='relative'>
191191
<input
192192
type='text'
193193
placeholder='SEARCH COMING SOON...'
194194
disabled
195-
className='w-full cursor-not-allowed border border-[#2A2A2A] bg-[#232323] px-4 py-2 font-mono text-[11px] text-[#ECECEC] opacity-50 placeholder:text-[#666]'
195+
className='w-full cursor-not-allowed border border-[#2A2A2A] bg-[#232323] px-4 py-2 font-season text-[11px] text-[#ECECEC] opacity-50 placeholder:text-[#666]'
196196
style={{ borderRadius: '5px' }}
197197
aria-label='Search blog posts (coming soon)'
198198
/>
@@ -203,7 +203,7 @@ function Sidebar({ items, activeId, onSelect }: SidebarProps) {
203203
</div>
204204
</div>
205205
<div className='flex flex-col'>
206-
<h2 className='mb-3 font-mono text-[10px] uppercase tracking-widest text-[#ECECEC]'>
206+
<h2 className='mb-3 font-season text-[10px] uppercase tracking-widest text-[#ECECEC]'>
207207
Categories
208208
</h2>
209209
<ul ref={listRef} className='relative flex flex-col'>
@@ -246,7 +246,7 @@ function Sidebar({ items, activeId, onSelect }: SidebarProps) {
246246
>
247247
<span className='relative z-10'>{item.label}</span>
248248
<span
249-
className='relative z-10 font-mono text-[10px]'
249+
className='relative z-10 font-season text-[10px]'
250250
style={{
251251
padding: '2px 6px',
252252
borderRadius: '2px',

0 commit comments

Comments
 (0)