Skip to content

Commit

Permalink
small code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Dec 14, 2023
1 parent 2c9a77a commit 3ca7b16
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "core-js/features/dom-collections/for-each";
import { ReactNode, useEffect, useRef, useState } from "react";
import React, { ReactNode, useEffect, useRef, useState } from "react";
import ReactDOM from "react-dom";
import useGlobalSettings from "../../../hooks/use-global-settings";
import { Language } from "../../../shared/language";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from "react";
import React, { useEffect, useState } from "react";
import ReactDOM from "react-dom";

type PortalPropTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ const ListImageViewSelectContainer: React.FunctionComponent<IListImageBox> =
memo(({ item, className: propsClassName, onSelectionCallback, children }) => {
if (item.isDirectory === undefined) item.isDirectory = false;

const [className] = React.useState(
!propsClassName ? "list-image-box" : propsClassName
);

const className = !propsClassName ? "list-image-box" : propsClassName;
const history = useLocation();

// Check if select exist or Length 0 or more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ export const MenuSearch: React.FunctionComponent<IMenuSearchProps> = ({

{/* when selected */}
{select ? (
<div
<button
className={"item item--labels"}
onClick={() => toggleLabels()}
onKeyDown={(event) => {
event.key === "Enter" && toggleLabels();
}}
>
Labels
</div>
</button>
) : null}

{/* More menu - When in normal state */}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import React, { useState } from "react";
import useGlobalSettings from "../../../hooks/use-global-settings";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import {
Expand Down Expand Up @@ -43,7 +43,7 @@ const ModalEditDatetime: React.FunctionComponent<IModalDatetimeProps> = (
"The date and time were entered incorrectly"
);

const [isFormEnabled] = useState(true);
const isFormEnabled = true;

const [fullYear, setFullYear] = useState(parseDateYear(props.dateTime));
const [month, setMonth] = useState(parseDateMonth(props.dateTime));
Expand Down
4 changes: 1 addition & 3 deletions starsky/starsky/clientapp/src/containers/archive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import { URLPath } from "../shared/url-path";
function Archive(archive: Readonly<IArchiveProps>) {
const history = useLocation();

const [iconList] = React.useState(
!new URLPath().StringToIUrl(history.location.search).list
);
const iconList = !new URLPath().StringToIUrl(history.location.search).list;

// The sidebar
const [sidebar, setSidebar] = React.useState(
Expand Down

0 comments on commit 3ca7b16

Please sign in to comment.