app: Initial tabs impl (#28436)
This commit is contained in:
parent
4702cddb3e
commit
38b406fb35
86 changed files with 10780 additions and 598 deletions
|
|
@ -8,6 +8,7 @@ import { LocalProvider } from "@/context/local"
|
|||
import { SDKProvider } from "@/context/sdk"
|
||||
import { SyncProvider, useSync } from "@/context/sync"
|
||||
import { decode64 } from "@/utils/base64"
|
||||
import { Schema } from "effect"
|
||||
|
||||
function DirectoryDataProvider(props: ParentProps<{ directory: string }>) {
|
||||
const location = useLocation()
|
||||
|
|
@ -40,6 +41,15 @@ function DirectoryDataProvider(props: ParentProps<{ directory: string }>) {
|
|||
)
|
||||
}
|
||||
|
||||
export const ProjectDirString = Schema.String.pipe(Schema.brand("ProjectDirString"))
|
||||
export type ProjectDirString = Schema.Schema.Type<typeof ProjectDirString>
|
||||
|
||||
export function decodeDirectory(dir: string): ProjectDirString | undefined {
|
||||
const decoded = decode64(dir)
|
||||
if (!decoded) return
|
||||
return ProjectDirString.make(decoded)
|
||||
}
|
||||
|
||||
export default function Layout(props: ParentProps) {
|
||||
const params = useParams()
|
||||
const language = useLanguage()
|
||||
|
|
@ -48,7 +58,7 @@ export default function Layout(props: ParentProps) {
|
|||
|
||||
const resolved = createMemo(() => {
|
||||
if (!params.dir) return ""
|
||||
return decode64(params.dir) ?? ""
|
||||
return decodeDirectory(params.dir) ?? ""
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue