mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Updated profile settings. Refactored locale saving.
This commit is contained in:
parent
814589f6a5
commit
7f598fa84d
9 changed files with 82 additions and 30 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import React, { useState, useRef } from 'react';
|
||||
import Head from 'next/head';
|
||||
import Globe from 'assets/globe.svg';
|
||||
import useDocumentClick from 'hooks/useDocumentClick';
|
||||
import Menu from './Menu';
|
||||
import Button from './Button';
|
||||
import { menuOptions } from 'lib/lang';
|
||||
import { setItem } from 'lib/web';
|
||||
import useLocale from 'hooks/useLocale';
|
||||
import useDocumentClick from 'hooks/useDocumentClick';
|
||||
import Globe from 'assets/globe.svg';
|
||||
import styles from './LanguageButton.module.css';
|
||||
import useLocale from '../../hooks/useLocale';
|
||||
|
||||
export default function LanguageButton({ menuPosition = 'bottom', menuAlign = 'left' }) {
|
||||
const [showMenu, setShowMenu] = useState(false);
|
||||
|
|
@ -16,7 +17,7 @@ export default function LanguageButton({ menuPosition = 'bottom', menuAlign = 'l
|
|||
|
||||
function handleSelect(value) {
|
||||
setLocale(value);
|
||||
window.localStorage.setItem('locale', value);
|
||||
setItem('umami.locale', value);
|
||||
setShowMenu(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue