Skip to content

Commit

Permalink
Merge pull request #15542 from qmonmert/react/clean-code
Browse files Browse the repository at this point in the history
[React] Clean code
  • Loading branch information
mshima authored Jul 4, 2021
2 parents 0392098 + 7323cd2 commit 8cd821d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default () => next => action => {
(error.message === '' || (data && data.path && (data.path.includes('/api/account') || data.path.includes('/api/authenticate'))))
)
) {
let i;
switch (response.status) {
// connection refused, server not reachable
case 0:
Expand All @@ -98,7 +97,7 @@ export default () => next => action => {
addErrorAlert(errorHeader, errorHeader, { entityName });
} else if (data?.fieldErrors) {
const fieldErrors = data.fieldErrors;
for (i = 0; i < fieldErrors.length; i++) {
for (let i = 0; i < fieldErrors.length; i++) {
const fieldError = fieldErrors[i];
if (['Min', 'Max', 'DecimalMin', 'DecimalMax'].includes(fieldError.message)) {
fieldError.message = 'Size';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const SettingsSlice = createSlice({
state.errorMessage = null;
state.updateSuccess = false;
})
.addCase(updateAccount.rejected, (state, action) => {
.addCase(updateAccount.rejected, state => {
state.loading = false;
state.updateSuccess = false;
state.updateFailure = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import React from 'react';
import { Translate } from 'react-jhipster';
import { Col, Row } from 'reactstrap';

const Footer = props => (
const Footer = () => (
<div className="footer page-content">
<Row>
<Col md="12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export const BrandIcon = props => (
</div>
);

export const Brand = props => (
export const Brand = () => (
<NavbarBrand tag={Link} to="/" className="brand-logo">
<BrandIcon />
<span className="brand-title"><Translate contentKey="global.title"><%= capitalizedBaseName %></Translate></span>
<span className="navbar-version">{appConfig.VERSION}</span>
</NavbarBrand>
);

export const Home = props => (
export const Home = () => (
<NavItem>
<NavLink tag={Link} to="/" className="d-flex align-items-center">
<FontAwesomeIcon icon="home" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
AsyncThunk,
ActionReducerMapBuilder,
createSlice,
PayloadAction,
SerializedError,
SliceCaseReducers,
ValidateSliceCaseReducers,
Expand Down

0 comments on commit 8cd821d

Please sign in to comment.