mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fix eslint
This commit is contained in:
parent
e4b158dada
commit
a26e4168fd
80 changed files with 199 additions and 205 deletions
|
@ -10,7 +10,6 @@ import {
|
|||
COMMENT_BLOCK_TYPES,
|
||||
ICommentBlock,
|
||||
} from '~/constants/comment';
|
||||
import { imagePresets } from '~/constants/urls';
|
||||
import { IFile, ValueOf } from '~/types';
|
||||
import { CONFIG } from '~/utils/config';
|
||||
import {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { marked } from 'marked';
|
||||
|
||||
import { EventMessageType } from '~/constants/events';
|
||||
import { stripHTMLTags } from '~/utils/stripHTMLTags';
|
||||
|
||||
/**
|
||||
|
@ -22,7 +21,7 @@ export const formatTextSanitizeTags = (text: string): string =>
|
|||
* Returns clickable usernames
|
||||
*/
|
||||
export const formatTextClickableUsernames = (text: string): string =>
|
||||
text.replace(/~([\wа-яА-Я-]+)/giu, `<span class="username">~$1</span>`);
|
||||
text.replace(/~([\wа-яА-Я-]+)/giu, '<span class="username">~$1</span>');
|
||||
|
||||
/**
|
||||
* Makes gray comments
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { createContext, FC, useContext } from 'react';
|
||||
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { boolean } from 'yup';
|
||||
|
||||
import { EMPTY_USER } from '~/constants/auth';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
|
|
|
@ -44,10 +44,13 @@ const ThemeProvider: FC<ProvidersProps> = ({ children }) => {
|
|||
|
||||
useEffect(() => {
|
||||
const stored = localStorage.getItem('vault__theme');
|
||||
|
||||
if (!stored || !keys(themeClass).includes(stored as Theme)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTheme(stored as Theme);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const value = useMemo(() => ({ theme, setTheme }), [theme, setTheme]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue