mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-04 00:56:40 +07:00
(nextjs) added eslint and import sorting
This commit is contained in:
parent
e5f8d5a551
commit
0838bf7ee6
330 changed files with 1576 additions and 896 deletions
|
@ -1,6 +1,6 @@
|
|||
import { useLoginLogoutRestore } from '~/hooks/auth/useLoginLogoutRestore';
|
||||
import { useUser } from '~/hooks/auth/useUser';
|
||||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { useLoginLogoutRestore } from '~/hooks/auth/useLoginLogoutRestore';
|
||||
|
||||
export const useAuth = () => {
|
||||
const { user } = useUser();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { useCallback } from 'react';
|
||||
|
||||
import { useUser } from '~/hooks/auth/useUser';
|
||||
|
||||
export const useLastSeenBoris = () => {
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { Asserts, object, string } from 'yup';
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { Asserts, object, string } from 'yup';
|
||||
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
import { getValidationErrors } from '~/utils/errors/getValidationErrors';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
const validationSchema = object({
|
||||
username: string().required(ERRORS.REQUIRED),
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { apiUserLogin } from '~/api/auth';
|
||||
import { getRandomPhrase } from '~/constants/phrases';
|
||||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { showToastInfo } from '~/utils/toast';
|
||||
|
||||
export const useLoginLogoutRestore = () => {
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { useEffect } from 'react';
|
||||
import { EventMessageType } from '~/constants/events';
|
||||
|
||||
import { includes, path, values } from 'ramda';
|
||||
import { useOAuth } from '~/hooks/auth/useOAuth';
|
||||
|
||||
import { EventMessageType } from '~/constants/events';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
import { useOAuth } from '~/hooks/auth/useOAuth';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
|
||||
/** reacts to events passed by window.postMessage */
|
||||
export const useMessageEventReactions = () => {
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
import { useCallback, useMemo } from 'react';
|
||||
import { OAuthProvider } from '~/types/auth';
|
||||
import { API } from '~/constants/api';
|
||||
import { apiAttachSocial, apiDropSocial, apiGetSocials, apiLoginWithSocial } from '~/api/auth';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
import { path } from 'ramda';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { apiAttachSocial, apiDropSocial, apiGetSocials, apiLoginWithSocial } from '~/api/auth';
|
||||
import { API } from '~/constants/api';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
import { OAuthProvider } from '~/types/auth';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
export const useOAuth = () => {
|
||||
const { isUser, setToken } = useAuth();
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { useUploader } from '~/hooks/data/useUploader';
|
||||
import { UploadSubject, UploadTarget } from '~/constants/uploads';
|
||||
import { useCallback } from 'react';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
import { apiUpdateUser } from '~/api/auth';
|
||||
import { ApiUpdateUserRequest } from '~/api/auth/types';
|
||||
import { UploadSubject, UploadTarget } from '~/constants/uploads';
|
||||
import { useUser } from '~/hooks/auth/useUser';
|
||||
import { useUploader } from '~/hooks/data/useUploader';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
export const usePatchUser = () => {
|
||||
const { update } = useUser();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { apiCheckRestoreCode } from '~/api/auth';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { apiCheckRestoreCode } from '~/api/auth';
|
||||
import { API } from '~/constants/api';
|
||||
import { getErrorMessage } from '~/utils/errors/getErrorMessage';
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { Asserts, object, string } from 'yup';
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { useCallback } from 'react';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
import { getValidationErrors } from '~/utils/errors/getValidationErrors';
|
||||
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { Asserts, object, string } from 'yup';
|
||||
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { getValidationErrors } from '~/utils/errors/getValidationErrors';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
const validationSchema = object({
|
||||
newPassword: string()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
import { useNavigation } from '~/hooks/navigation/useNavigation';
|
||||
|
||||
/** redirects to the password redirect modal */
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import { Asserts, object, string } from 'yup';
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { useCallback } from 'react';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { Asserts, object, string } from 'yup';
|
||||
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { getValidationErrors } from '~/utils/errors/getValidationErrors';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
const validationSchema = object({
|
||||
field: string().required(ERRORS.REQUIRED),
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import { Asserts, object, string } from 'yup';
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { useCallback } from 'react';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
import { FormikConfig, useFormik } from 'formik';
|
||||
import { Asserts, object, string } from 'yup';
|
||||
|
||||
import { ERRORS } from '~/constants/errors';
|
||||
import { getValidationErrors } from '~/utils/errors/getValidationErrors';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
const validationSchema = object({
|
||||
username: string().required(ERRORS.REQUIRED),
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import useSWR from 'swr';
|
||||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { API } from '~/constants/api';
|
||||
import { apiAuthGetUser } from '~/api/auth';
|
||||
import { EMPTY_USER } from '~/constants/auth';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { apiAuthGetUser } from '~/api/auth';
|
||||
import { API } from '~/constants/api';
|
||||
import { EMPTY_USER } from '~/constants/auth';
|
||||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { IUser } from '~/types/auth';
|
||||
import { showErrorToast } from '~/utils/errors/showToast';
|
||||
|
||||
export const useUser = () => {
|
||||
const { token, setUser } = useAuthStore();
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { IUser } from '~/types/auth';
|
||||
import { useRandomPhrase } from '~/constants/phrases';
|
||||
import { differenceInDays, parseISO } from 'date-fns';
|
||||
|
||||
import { useRandomPhrase } from '~/constants/phrases';
|
||||
import { INACTIVE_ACCOUNT_DAYS } from '~/constants/user';
|
||||
import { IUser } from '~/types/auth';
|
||||
|
||||
const today = new Date();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue