mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: prevent zoom on input field click on mobile
This commit is contained in:
parent
e663da45b1
commit
9c734ec439
1 changed files with 56 additions and 47 deletions
|
@ -12,6 +12,7 @@ import { getCookie, setCookie } from "cookies-next";
|
||||||
import { GetServerSidePropsContext } from "next";
|
import { GetServerSidePropsContext } from "next";
|
||||||
import type { AppProps } from "next/app";
|
import type { AppProps } from "next/app";
|
||||||
import getConfig from "next/config";
|
import getConfig from "next/config";
|
||||||
|
import Head from "next/head";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { IntlProvider } from "react-intl";
|
import { IntlProvider } from "react-intl";
|
||||||
|
@ -41,7 +42,7 @@ function App({ Component, pageProps }: AppProps) {
|
||||||
const [route, setRoute] = useState<string>(pageProps.route);
|
const [route, setRoute] = useState<string>(pageProps.route);
|
||||||
|
|
||||||
const [configVariables, setConfigVariables] = useState<Config[]>(
|
const [configVariables, setConfigVariables] = useState<Config[]>(
|
||||||
pageProps.configVariables,
|
pageProps.configVariables
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -80,6 +81,13 @@ function App({ Component, pageProps }: AppProps) {
|
||||||
const language = useRef(pageProps.language);
|
const language = useRef(pageProps.language);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="minimum-scale=1, initial-scale=1, width=device-width, user-scalable=no"
|
||||||
|
/>
|
||||||
|
</Head>
|
||||||
<IntlProvider
|
<IntlProvider
|
||||||
messages={i18nUtil.getLocaleByCode(language.current)?.messages}
|
messages={i18nUtil.getLocaleByCode(language.current)?.messages}
|
||||||
locale={language.current}
|
locale={language.current}
|
||||||
|
@ -131,6 +139,7 @@ function App({ Component, pageProps }: AppProps) {
|
||||||
</ColorSchemeProvider>
|
</ColorSchemeProvider>
|
||||||
</MantineProvider>
|
</MantineProvider>
|
||||||
</IntlProvider>
|
</IntlProvider>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +174,7 @@ App.getInitialProps = async ({ ctx }: { ctx: GetServerSidePropsContext }) => {
|
||||||
pageProps.route = ctx.req.url;
|
pageProps.route = ctx.req.url;
|
||||||
|
|
||||||
const requestLanguage = i18nUtil.getLanguageFromAcceptHeader(
|
const requestLanguage = i18nUtil.getLanguageFromAcceptHeader(
|
||||||
ctx.req.headers["accept-language"],
|
ctx.req.headers["accept-language"]
|
||||||
);
|
);
|
||||||
|
|
||||||
pageProps.language = ctx.req.cookies["language"] ?? requestLanguage;
|
pageProps.language = ctx.req.cookies["language"] ?? requestLanguage;
|
||||||
|
|
Loading…
Add table
Reference in a new issue