Skip to content

Commit

Permalink
rename localStorage package and fix minor issues with Input component #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Mar 5, 2024
1 parent a40c932 commit d986b0c
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/api/common/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import type { Options } from 'ky';
import ky from 'ky';
import { LocalStorageAPI } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';
import { getRuntimeConfigOrThrow } from '@/utils';
import { apiBaseUrl } from './apiHelpers';

Expand Down
6 changes: 2 additions & 4 deletions src/features/auth/components/LoginForm/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,24 @@ export const LoginForm = (): ReactElement => {
return (
<AuthCard img={logoImge}>
<form>
<FormControl>
<FormControl error={!!errors['username']}>
<Input
id="userName"
{...register('username', { required: true })}
placeholder="username"
aria-label="username"
type="text"
error={!!errors['username']}
min={0}
max={30}
/>
</FormControl>
<FormControl>
<FormControl error={!!errors['password']}>
<Input
type="password"
id="password"
aria-label="password"
placeholder="password"
autoComplete="off"
error={!!errors['password']}
{...register('password')}
min={0}
max={30}
Expand Down
6 changes: 2 additions & 4 deletions src/features/auth/components/RegisterForm/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ export const RegisterForm = (): ReactElement => {
<div>
<h4 className={css(styles.title)}>Welcome to Proof Market!</h4>
<div className={`${styles.heading} text-muted`}>Create new account</div>
<FormControl>
<FormControl error={!!errors['user']}>
<Input
type="text"
id="userName"
error={!!errors['user']}
placeholder="username"
aria-label="username"
{...register('user', {
Expand All @@ -132,11 +131,10 @@ export const RegisterForm = (): ReactElement => {
nodeRef={inputAnimationRef}
>
<div ref={inputAnimationRef}>
<FormControl>
<FormControl error={!!errors['passwd']}>
<Input
type="password"
id="password"
error={!!errors['passwd']}
aria-label="password"
placeholder="password"
autoComplete="off"
Expand Down
2 changes: 1 addition & 1 deletion src/features/auth/hooks/useLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useNavigate } from 'react-router-dom';
import { NOTIFICATION_KIND } from '@nilfoundation/ui-kit';
import { SetJwtRevalidateTimeout, UpdateIsAuthorized, UpdateUserName } from '@/redux';
import { Path } from '@/features/routing';
import { LocalStorageAPI } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';
import { getRuntimeConfigOrThrow } from '@/utils';
import { notificationActions } from '@/features/notifications';
import { getUserFromJwt } from '@/packages/jwt';
Expand Down
2 changes: 1 addition & 1 deletion src/features/auth/utils/clearAuthLocalStorageState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @copyright Yury Korotovskikh <u.korotovskiy@nil.foundation>
*/

import { LocalStorageAPI } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';

/**
* Clears localStorage values related to auth state.
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/common/table/useInitialTableState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { useCallback } from 'react';
import { dequal as deepEqual } from 'dequal';
import type { TableState } from 'react-table';
import type { LocalStorageKey } from '@/packages/localStorage';
import type { LocalStorageKey } from '@/packages/localStorageAdapter';
import { useLocalStorage } from '../useLocalStorage';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/common/useLocalStorage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { useCallback, useState } from 'react';
import { dequal as deepEqual } from 'dequal';
import type { LocalStorageKey } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorage';
import type { LocalStorageKey } from '@/packages/localStorageAdapter';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';

/**
* Hook to use localStorage in a useState() hook way.
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/redux/login/sagas/AuthSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { fork, put } from 'redux-saga/effects';
import type { SagaIterator } from '@redux-saga/core';
import { LocalStorageAPI } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';
import { getUserFromJwt } from '@/packages/jwt';
import { UpdateIsAuthorized, UpdateUserName } from '../actions';

Expand Down
2 changes: 1 addition & 1 deletion src/redux/market/reducers/OrderBookReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { createReducer } from '@reduxjs/toolkit';
import type { OrderBookPriceStepType } from '@/enums';
import type { LastOrderData, OrderBookData } from '@/models';
import { LocalStorageAPI } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';
import {
UpdateOrderBookData,
UpdateOrderBookDataError,
Expand Down
2 changes: 1 addition & 1 deletion src/redux/market/reducers/StatementsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { createReducer } from '@reduxjs/toolkit';
import type { Statement, StatementInfo, StatementStats } from '@/models';
import { LocalStorageAPI } from '@/packages/localStorage';
import { LocalStorageAPI } from '@/packages/localStorageAdapter';
import {
UpdateStatementsList,
UpdateSelectedStatementKey,
Expand Down

0 comments on commit d986b0c

Please sign in to comment.