add: param based pwa manifest
This commit is contained in:
@@ -1,16 +1,34 @@
|
||||
import PreferenceWrapper from '@/components/wrapper/PreferenceWrapper';
|
||||
import PreferenceWrapper from '@/components/wrapper/PreferenceWrapper'
|
||||
import React from 'react'
|
||||
import type { Metadata, Viewport } from 'next'
|
||||
|
||||
export async function generateMetadata ({
|
||||
params
|
||||
}: {
|
||||
params: { name: string }
|
||||
}): Promise<Metadata> {
|
||||
const { name } = await params
|
||||
return {
|
||||
title: `${name} Dashboard`,
|
||||
description: `PWA dashboard for ${name}`,
|
||||
manifest: `/manifests/${name}/manifest.json`
|
||||
}
|
||||
}
|
||||
|
||||
export async function generateViewport ({}: {
|
||||
params: { name: string }
|
||||
}): Promise<Viewport> {
|
||||
return {
|
||||
themeColor: '#F4F5F9'
|
||||
}
|
||||
}
|
||||
|
||||
type Props = {
|
||||
children: React.ReactElement
|
||||
children: React.ReactElement
|
||||
}
|
||||
|
||||
function layout({ children }: Props) {
|
||||
return (
|
||||
<PreferenceWrapper>
|
||||
{children}
|
||||
</PreferenceWrapper>
|
||||
)
|
||||
function layout ({ children }: Props) {
|
||||
return <PreferenceWrapper>{children}</PreferenceWrapper>
|
||||
}
|
||||
|
||||
export default layout
|
||||
export default layout
|
||||
|
||||
Reference in New Issue
Block a user