Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix [BUG] Fix 2 Duplication issues in multiple files with gitauto model #226

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Helpers/StatusBadge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import classNames from "classnames";
import { ProgressBar, UpdateBadge } from "../Components/Layout";
const StatusBadge = ({ itemsLength, allItemsLoaded, lastModified, itemType }) => (

Check notice on line 3 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L3

'itemsLength' is missing in props validation

Check notice on line 3 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L3

Replace `·itemsLength,·allItemsLoaded,·lastModified,·itemType·` with `⏎··itemsLength,⏎··allItemsLoaded,⏎··lastModified,⏎··itemType,⏎`
<div className="alert alert-secondary text-center col-xs-12 col-lg-6 offset-lg-3">

Check failure on line 4 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L4

'React' must be in scope when using JSX
{itemType}:{' '}

Check notice on line 5 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L5

Replace `'·'` with `"·"`
<span

Check failure on line 6 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L6

'React' must be in scope when using JSX
className={classNames("badge rounded-pill", {
"bg-danger": itemsLength === 0,
"bg-warning": !allItemsLoaded,
"bg-success": itemsLength > 0,
})}
>
{allItemsLoaded ? itemsLength : `Carregando página ${itemsLength}...`}
</span>

Check notice on line 14 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L14

Delete `·`
<br /> {!allItemsLoaded && <><br/><ProgressBar /></>} {allItemsLoaded && <UpdateBadge date={lastModified} />}

Check failure on line 15 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L15

'React' must be in scope when using JSX

Check notice on line 15 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L15

Replace `·{!allItemsLoaded·&&·<><br/><ProgressBar·/></>}` with `{"·"}⏎····{!allItemsLoaded·&&·(⏎······<>⏎········<br·/>⏎········<ProgressBar·/>⏎······</>⏎····)}{"·"}⏎···`
</div>
);
export default StatusBadge;

Check notice on line 18 in src/Helpers/StatusBadge.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Helpers/StatusBadge.js#L18

Insert `⏎`
Loading