chore: introduce platform object for platform specific code
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createApp } from "vue"
|
||||
import { createApp, Ref } from "vue"
|
||||
import { setupLocalPersistence } from "./newstore/localpersistence"
|
||||
import { performMigrations } from "./helpers/migrations"
|
||||
import { initializeFirebase } from "./helpers/fb"
|
||||
@@ -12,7 +12,26 @@ import "nprogress/nprogress.css"
|
||||
|
||||
import App from "./App.vue"
|
||||
|
||||
export function createHoppApp(el: string | Element) {
|
||||
export type PlatformDef = {
|
||||
ui?: {
|
||||
appHeader?: {
|
||||
paddingTop?: Ref<string>
|
||||
paddingLeft?: Ref<string>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the fields, functions and properties that will be
|
||||
* filled in by the individual platforms.
|
||||
*
|
||||
* This value is populated upon calling `createHoppApp`
|
||||
*/
|
||||
export let platform: PlatformDef
|
||||
|
||||
export function createHoppApp(el: string | Element, platformDef: PlatformDef) {
|
||||
platform = platformDef
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
// Some basic work that needs to be done before module inits even
|
||||
|
||||
Reference in New Issue
Block a user