Add a launcher context provider

This commit is contained in:
Lncvrt committed 2026-03-25 17:35:17 -07:00
1 parent 4590a136a2
commit 769144e8e8
3 files changed
+20 -1

No files matched your search

+4 -1
View File
@@ -2,6 +2,7 @@
import '@/styles/globals.css'
import { Roboto } from 'next/font/google'
import LauncherContext from '@/context/LauncherContext'
import Sidebar from '@/componets/Sidebar'
import { useEffect, useState } from 'react'
@@ -56,11 +57,12 @@ export default function RootLayout ({
setLoading(3)
})()
})
}, [])
return (
<html lang='en' className={roboto.className}>
<body className='relative dark-theme'>
<LauncherContext.Provider value={{ launcherManifest }}>
{loading == 3 ? (
<>
<Sidebar />
@@ -75,6 +77,7 @@ export default function RootLayout ({
: 'Outdated launcher!'}
</p>
)}
</LauncherContext.Provider>
</body>
</html>
)
+2
View File
@@ -1,3 +1,5 @@
'use client'
export default function Home () {
return <div></div>
}
+14
View File
@@ -0,0 +1,14 @@
'use client'
import { createContext, useContext } from 'react'
import type LauncherManifest from '@/types/LauncherManifest'
type LauncherContextType = {
launcherManifest: LauncherManifest | null
}
const LauncherContext = createContext<LauncherContextType | null>(null)
export const useLauncher = () => useContext(LauncherContext)
export default LauncherContext