Skip to content

Commit 246abc2

Browse files
committed
Update
1 parent fff06a2 commit 246abc2

File tree

4 files changed

+18
-50
lines changed

4 files changed

+18
-50
lines changed

app.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default defineConfig(
9898
"install-local": "pnpm i",
9999
run: "pnpm :content",
100100
exec: "pnpx :content",
101-
create: "pnpm init :content",
101+
create: "pnpm create :content",
102102
},
103103
yarn: {
104104
install: "yarn add :content",
@@ -115,16 +115,16 @@ export default defineConfig(
115115
"install-global": "bun i :content -g",
116116
"install-local": "bun i",
117117
run: "bun :content",
118-
exec: "bunx :content",
119-
create: "bun create :content",
118+
exec: "bunx :content",
119+
create: "bun create :content",
120120
},
121121
deno: {
122122
install: "deno add npm::content",
123123
"install-dev": "deno add npm::content -D",
124124
"install-global": "deno add npm::content -g",
125125
"install-local": "deno i",
126126
run: "deno run :content",
127-
"exec": "dpx :content",
127+
exec: "dpx :content",
128128
create: "deno run -A npm::content",
129129
},
130130
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"@solid-primitives/marker": "^0.1.0",
2727
"@solid-primitives/media": "^2.2.9",
2828
"@solid-primitives/platform": "^0.2.0",
29-
"@solid-primitives/storage": "^4.3.1",
3029
"@solidjs/meta": "^0.29.4",
3130
"@solidjs/router": "^0.15.3",
3231
"@solidjs/start": "^1.1.1",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/solidbase-theme/mdx-components.tsx

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import {
2-
Accessor,
32
For,
43
Match,
54
type ParentProps,
6-
Show,
75
Switch,
86
children,
97
createMemo,
10-
createSignal,
118
splitProps,
129
} from "solid-js";
1310
import { isServer } from "solid-js/web";
@@ -16,7 +13,6 @@ import { A } from "~/ui/i18n-anchor";
1613
import { clientOnly } from "@solidjs/start";
1714
import { Callout } from "~/ui/callout";
1815
import { Tabs, TabList, TabPanel, Tab } from "~/ui/tabs";
19-
import { makePersisted, messageSync } from "@solid-primitives/storage";
2016

2117
export { EditPageLink } from "../ui/edit-page-link";
2218
export { PageIssueLink } from "../ui/page-issue-link";
@@ -37,43 +33,8 @@ export const DirectiveContainer = (
3733
} & ParentProps
3834
) => {
3935
const _children = children(() => props.children).toArray();
40-
4136
const tabNames = createMemo(() => props.tabNames?.split("\0") ?? []);
4237

43-
const tabs = (value?: Accessor<string>, onChange?: (s: string) => void) => (
44-
<Tabs value={value?.()} onChange={onChange}>
45-
<TabList>
46-
<For each={tabNames()}>
47-
{(title) => (
48-
<Tab
49-
value={title}
50-
class="px-5 py-1 relative top-0.5 transition-colors duration-300 aria-selected:font-bold aria-selected:dark:text-slate-300 aria-selected:text-blue-500 aria-selected:border-b-2 aria-selected:border-blue-400"
51-
>
52-
{title}
53-
</Tab>
54-
)}
55-
</For>
56-
</TabList>
57-
<For each={tabNames()}>
58-
{(title, idx) => (
59-
<TabPanel value={title} forceMount={true}>
60-
{_children[idx()]}
61-
</TabPanel>
62-
)}
63-
</For>
64-
</Tabs>
65-
);
66-
67-
const tabsWithPersistence = () => {
68-
// eslint-disable-next-line solid/reactivity
69-
const [openTab, setOpenTab] = makePersisted(createSignal(tabNames()[0]), {
70-
name: `tab-group:${props.title}`,
71-
sync: messageSync(new BroadcastChannel("tab-group")),
72-
});
73-
74-
return tabs(openTab, setOpenTab);
75-
};
76-
7738
return (
7839
<Switch
7940
fallback={
@@ -82,9 +43,20 @@ export const DirectiveContainer = (
8243
>
8344
<Match when={props.type === "tab"}>{_children}</Match>
8445
<Match when={props.type === "tab-group"}>
85-
<Show when={props.title} fallback={tabs()}>
86-
{tabsWithPersistence()}
87-
</Show>
46+
<Tabs>
47+
<TabList>
48+
<For each={tabNames()}>
49+
{(title) => <Tab value={title}>{title}</Tab>}
50+
</For>
51+
</TabList>
52+
<For each={tabNames()}>
53+
{(title, idx) => (
54+
<TabPanel value={title} forceMount={true}>
55+
{_children[idx()]}
56+
</TabPanel>
57+
)}
58+
</For>
59+
</Tabs>
8860
</Match>
8961
</Switch>
9062
);

0 commit comments

Comments
 (0)