mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 22:54:22 +00:00
28 lines
1 KiB
TypeScript
28 lines
1 KiB
TypeScript
import '../styles/globals.css'
|
|
import '../styles/telegram.css'
|
|
import '../styles/postcard.css'
|
|
import type { AppProps } from 'next/app'
|
|
import { LoginContext } from '../contexts/login'
|
|
import { useState } from 'react'
|
|
import * as Telegram from "../utils/telegram"
|
|
import defaultPostcard from "../images/adi-goldstein-Hli3R6LKibo-unsplash.jpg"
|
|
import { Postcard } from '../components/Postcard'
|
|
import { PostcardContext } from '../contexts/postcard'
|
|
import { StaticImageData } from 'next/image'
|
|
import { appWithTranslation } from 'next-i18next'
|
|
|
|
const App = ({ Component, pageProps }: AppProps): JSX.Element => {
|
|
const loginHook = useState<Telegram.LoginData | null>(null)
|
|
const postcardHook = useState<string | StaticImageData>(defaultPostcard)
|
|
|
|
return (
|
|
<PostcardContext.Provider value={postcardHook}>
|
|
<LoginContext.Provider value={loginHook}>
|
|
<Postcard/>
|
|
<Component {...pageProps} />
|
|
</LoginContext.Provider>
|
|
</PostcardContext.Provider>
|
|
)
|
|
}
|
|
|
|
export default appWithTranslation(App)
|