Updated settings components and date filter.

This commit is contained in:
Mike Cao 2023-01-11 08:33:43 -08:00
parent 4b5b4db108
commit 9d967fb0fe
23 changed files with 33 additions and 67 deletions

View file

@ -9,7 +9,7 @@ export default function useConfig() {
const { get } = useApi();
async function loadConfig() {
const { data } = await get('/config');
const data = await get('/config');
loading = false;
setConfig(data);
}

View file

@ -1,10 +1,11 @@
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { get, setItem } from 'next-basics';
import { setItem } from 'next-basics';
import { LOCALE_CONFIG } from 'lib/constants';
import { getDateLocale, getTextDirection } from 'lib/lang';
import useStore, { setLocale } from 'store/app';
import useForceUpdate from 'hooks/useForceUpdate';
import useApi from 'hooks/useApi';
import enUS from 'public/intl/messages/en-US.json';
const messages = {
@ -19,6 +20,7 @@ export default function useLocale() {
const forceUpdate = useForceUpdate();
const dir = getTextDirection(locale);
const dateLocale = getDateLocale(locale);
const { get } = useApi();
async function loadMessages(locale) {
const data = await get(`${basePath}/intl/messages/${locale}.json`);

View file

@ -9,7 +9,7 @@ export default function useShareToken(shareId) {
const { get } = useApi();
async function loadToken(id) {
const { data } = await get(`/share/${id}`);
const data = await get(`/share/${id}`);
if (data) {
setShareToken(data);