mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 18:08:11 +09:00
chore: cosmetic changes
This commit is contained in:
@@ -1 +1 @@
|
||||
export const mobile = '@media screen and (max-width: 800px)'
|
||||
export const mobile = '@media screen and (max-width: 800px)';
|
||||
|
@@ -1,21 +1,21 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import {useState, useEffect} from 'react';
|
||||
|
||||
export function useDeferredState<T>(
|
||||
duration = 1000,
|
||||
initialValue: T
|
||||
initialValue: T,
|
||||
): [T, React.Dispatch<React.SetStateAction<T>>] {
|
||||
const [response, setResponse] = useState(initialValue)
|
||||
const [innerValue, setInnerValue] = useState(initialValue)
|
||||
const [response, setResponse] = useState(initialValue);
|
||||
const [innerValue, setInnerValue] = useState(initialValue);
|
||||
|
||||
useEffect(() => {
|
||||
const fn = setTimeout(() => {
|
||||
setResponse(innerValue)
|
||||
}, duration)
|
||||
setResponse(innerValue);
|
||||
}, duration);
|
||||
|
||||
return () => {
|
||||
clearTimeout(fn)
|
||||
}
|
||||
}, [duration, innerValue])
|
||||
clearTimeout(fn);
|
||||
};
|
||||
}, [duration, innerValue]);
|
||||
|
||||
return [response, setInnerValue]
|
||||
return [response, setInnerValue];
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import i18n from 'i18next'
|
||||
import Backend from 'i18next-chained-backend'
|
||||
import LocalStorageBackend from 'i18next-localstorage-backend'
|
||||
import XHR from 'i18next-xhr-backend'
|
||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||
import { initReactI18next } from 'react-i18next'
|
||||
import i18n from 'i18next';
|
||||
import Backend from 'i18next-chained-backend';
|
||||
import LocalStorageBackend from 'i18next-localstorage-backend';
|
||||
import XHR from 'i18next-xhr-backend';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import {initReactI18next} from 'react-i18next';
|
||||
|
||||
i18n
|
||||
.use(Backend)
|
||||
@@ -14,7 +14,7 @@ i18n
|
||||
backends: [LocalStorageBackend, XHR],
|
||||
backendOptions: [
|
||||
{
|
||||
versions: { en: '1.5', ja: '1.5' },
|
||||
versions: {en: '1.5', ja: '1.5'},
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -23,6 +23,6 @@ i18n
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
export default i18n
|
||||
export default i18n;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
interface CustomNavigator extends Navigator {
|
||||
standalone?: boolean
|
||||
standalone?: boolean;
|
||||
}
|
||||
|
||||
export function isStandalone() {
|
||||
const navigator: CustomNavigator = window.navigator
|
||||
return 'standalone' in navigator && navigator.standalone
|
||||
const navigator: CustomNavigator = window.navigator;
|
||||
return 'standalone' in navigator && navigator.standalone;
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import React, { Suspense } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import BarLoader from 'react-spinners/BarLoader'
|
||||
import React, {Suspense} from 'react';
|
||||
import styled from 'styled-components';
|
||||
import BarLoader from 'react-spinners/BarLoader';
|
||||
|
||||
export const FullScreenSuspense: React.FC = ({ children }) => {
|
||||
return <Suspense fallback={<Fallback />}>{children}</Suspense>
|
||||
}
|
||||
export const FullScreenSuspense: React.FC = ({children}) => {
|
||||
return <Suspense fallback={<Fallback />}>{children}</Suspense>;
|
||||
};
|
||||
|
||||
const Container = styled.div`
|
||||
width: 100vw;
|
||||
@@ -13,10 +13,10 @@ const Container = styled.div`
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
`
|
||||
`;
|
||||
|
||||
const Fallback = () => (
|
||||
<Container>
|
||||
<BarLoader />
|
||||
</Container>
|
||||
)
|
||||
);
|
||||
|
@@ -1,3 +1,3 @@
|
||||
export function capitalize(text: string) {
|
||||
return text[0].toUpperCase() + text.slice(1).toLowerCase()
|
||||
return text[0].toUpperCase() + text.slice(1).toLowerCase();
|
||||
}
|
||||
|
Reference in New Issue
Block a user