2022-05-20 11:59:24 +00:00
|
|
|
import '../styles/globals.css'
|
2022-05-24 16:55:21 +00:00
|
|
|
import '../styles/telegram.css'
|
|
|
|
import '../styles/postcard.css'
|
2022-05-25 15:03:53 +00:00
|
|
|
import "../styles/index.css"
|
2022-05-20 11:59:24 +00:00
|
|
|
import type { AppProps } from 'next/app'
|
2022-05-24 16:55:21 +00:00
|
|
|
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'
|
2022-05-25 14:20:22 +00:00
|
|
|
import { appWithTranslation } from 'next-i18next'
|
2022-05-20 11:59:24 +00:00
|
|
|
|
2022-05-25 14:20:22 +00:00
|
|
|
const App = ({ Component, pageProps }: AppProps): JSX.Element => {
|
2022-05-24 16:55:21 +00:00
|
|
|
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>
|
|
|
|
)
|
2022-05-20 11:59:24 +00:00
|
|
|
}
|
|
|
|
|
2022-05-25 14:20:22 +00:00
|
|
|
export default appWithTranslation(App)
|