1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-20 01:55:56 +07:00

feat: login Dialog Component - Replaced class by func. comp + added react-hook-form (#341)

* refactor: convert class to func

* refactor: changed login form logic

* refactor: conver to testing-library tests

* refactor: moved dependency

* refactor: replaced uglifyjs-webpack-plugin by terser-webpack-plugin

* fix: fixed e2e errors

* fix: fixed e2e test

* Delete settings.json

* fix: vscode settings rollback

* refactor: rollback webpack config

* refactor: updated eslint rule

* fix: removed --fix

* refactor: incresed the bundle size
This commit is contained in:
Priscila Oliveira
2019-12-06 18:09:01 +01:00
committed by Juan Picado @jotadeveloper
parent 501845b5f8
commit 42d3bb8508
34 changed files with 416 additions and 497 deletions

View File

@@ -26,7 +26,6 @@ const StyledBoxContent = styled(Box)({
},
});
/* eslint-disable react/jsx-max-depth */
/* eslint-disable react/jsx-no-bind */
/* eslint-disable react-hooks/exhaustive-deps */
const App: React.FC = () => {

View File

@@ -1,9 +1,6 @@
import { createContext } from 'react';
import { FormError } from '../components/Login/Login';
export interface AppProps {
error?: FormError;
user?: User;
scope: string;
packages: any[];
@@ -15,7 +12,6 @@ export interface User {
export interface AppContextProps extends AppProps {
setUser: (user?: User) => void;
setError: (error?: FormError) => void;
}
const AppContext = createContext<undefined | AppContextProps>(undefined);

View File

@@ -1,7 +1,5 @@
import React, { useState, useEffect } from 'react';
import { FormError } from '../components/Login/Login';
import AppContext, { AppProps, User } from './AppContext';
interface Props {
@@ -38,19 +36,11 @@ const AppContextProvider: React.FC<Props> = ({ children, packages, user }) => {
});
};
const setError = (error?: FormError) => {
setState({
...state,
error,
});
};
return (
<AppContext.Provider
value={{
...state,
setUser,
setError,
}}>
{children}
</AppContext.Provider>

View File

@@ -23,7 +23,6 @@ export const history = createBrowserHistory({
basename: window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix,
});
/* eslint react/jsx-max-depth: 0 */
const AppRoute: React.FC = () => {
const appContext = useContext(AppContext);