Skip to content

Commit 0aef93e

Browse files
committed
refactor(devtools): remove SeoTab component and related functionality
This commit deletes the SeoTab component from the devtools package, which included social media preview functionality and meta tag analysis. The removal streamlines the codebase by eliminating unused features.
1 parent c6bbb90 commit 0aef93e

2 files changed

Lines changed: 72 additions & 63 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { MainPanel } from '@tanstack/devtools-ui'
2+
import { SocialPreviewSection } from './social-preview'
3+
4+
export const SeoTab = () => {
5+
return (
6+
<MainPanel withPadding>
7+
<SocialPreviewSection />
8+
</MainPanel>
9+
)
10+
}

packages/devtools/src/tabs/seo-tab.tsx renamed to packages/devtools/src/tabs/seo-tab/social-preview.tsx

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
1-
import { For, createSignal } from 'solid-js'
1+
import { createSignal, For } from 'solid-js'
2+
import { useStyles } from '../../styles/use-styles'
3+
import { useHeadChanges } from '../../hooks/use-head-changes'
24
import {
3-
MainPanel,
45
Section,
56
SectionDescription,
67
SectionIcon,
78
SectionTitle,
89
} from '@tanstack/devtools-ui'
910
import { SocialBubble } from '@tanstack/devtools-ui/icons'
10-
import { useStyles } from '../styles/use-styles'
11-
import { useHeadChanges } from '../hooks/use-head-changes'
12-
13-
type SocialMeta = {
14-
title?: string
15-
description?: string
16-
image?: string
17-
url?: string
18-
}
19-
20-
type SocialReport = {
21-
network: string
22-
found: Partial<SocialMeta>
23-
missing: Array<string>
24-
}
2511

2612
const SOCIALS = [
2713
{
@@ -96,6 +82,20 @@ const SOCIALS = [
9682
},
9783
// Add more networks as needed
9884
]
85+
86+
type SocialMeta = {
87+
title?: string
88+
description?: string
89+
image?: string
90+
url?: string
91+
}
92+
93+
type SocialReport = {
94+
network: string
95+
found: Partial<SocialMeta>
96+
missing: Array<string>
97+
}
98+
9999
function SocialPreview(props: {
100100
meta: SocialMeta
101101
color: string
@@ -145,7 +145,8 @@ function SocialPreview(props: {
145145
</div>
146146
)
147147
}
148-
export const SeoTab = () => {
148+
149+
export function SocialPreviewSection() {
149150
const [reports, setReports] = createSignal<Array<SocialReport>>(analyzeHead())
150151
const styles = useStyles()
151152

@@ -182,51 +183,49 @@ export const SeoTab = () => {
182183
})
183184

184185
return (
185-
<MainPanel withPadding>
186-
<Section>
187-
<SectionTitle>
188-
<SectionIcon>
189-
<SocialBubble />
190-
</SectionIcon>
191-
Social previews
192-
</SectionTitle>
193-
<SectionDescription>
194-
See how your current page will look when shared on popular social
195-
networks. The tool checks for essential meta tags and highlights any
196-
that are missing.
197-
</SectionDescription>
198-
<div class={styles().seoPreviewSection}>
199-
<For each={reports()}>
200-
{(report, i) => {
201-
const social = SOCIALS[i()]
202-
return (
203-
<div>
204-
<SocialPreview
205-
meta={report.found}
206-
color={social!.color}
207-
network={social!.network}
208-
/>
209-
{report.missing.length > 0 ? (
210-
<>
211-
<div class={styles().seoMissingTagsSection}>
212-
<strong>Missing tags for {social?.network}:</strong>
186+
<Section>
187+
<SectionTitle>
188+
<SectionIcon>
189+
<SocialBubble />
190+
</SectionIcon>
191+
Social previews
192+
</SectionTitle>
193+
<SectionDescription>
194+
See how your current page will look when shared on popular social
195+
networks. The tool checks for essential meta tags and highlights any
196+
that are missing.
197+
</SectionDescription>
198+
<div class={styles().seoPreviewSection}>
199+
<For each={reports()}>
200+
{(report, i) => {
201+
const social = SOCIALS[i()]
202+
return (
203+
<div>
204+
<SocialPreview
205+
meta={report.found}
206+
color={social!.color}
207+
network={social!.network}
208+
/>
209+
{report.missing.length > 0 ? (
210+
<>
211+
<div class={styles().seoMissingTagsSection}>
212+
<strong>Missing tags for {social?.network}:</strong>
213213

214-
<ul class={styles().seoMissingTagsList}>
215-
<For each={report.missing}>
216-
{(tag) => (
217-
<li class={styles().seoMissingTag}>{tag}</li>
218-
)}
219-
</For>
220-
</ul>
221-
</div>
222-
</>
223-
) : null}
224-
</div>
225-
)
226-
}}
227-
</For>
228-
</div>
229-
</Section>
230-
</MainPanel>
214+
<ul class={styles().seoMissingTagsList}>
215+
<For each={report.missing}>
216+
{(tag) => (
217+
<li class={styles().seoMissingTag}>{tag}</li>
218+
)}
219+
</For>
220+
</ul>
221+
</div>
222+
</>
223+
) : null}
224+
</div>
225+
)
226+
}}
227+
</For>
228+
</div>
229+
</Section>
231230
)
232231
}

0 commit comments

Comments
 (0)