1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 07:04:22 +00:00
festa/pages/_app.tsx

29 lines
1 KiB
TypeScript
Raw Normal View History

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-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)