Skip to content

Commit

Permalink
feat: Minor code cleanup (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
PintoGideon authored Apr 3, 2024
1 parent be80ac2 commit 80ed861
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions src/components/Pacs/components/PatientCard.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, { useState, useContext } from "react";
import { format, parse } from "date-fns";
import { notification } from "antd";
import {
GridItem,
Card,
CardHeader,
Grid,
Tooltip,
GridItem,
Skeleton,
Tooltip,
} from "@patternfly/react-core";
import StudyCard from "./StudyCard";
import { CardHeaderComponent } from "./SettingsComponents";
import { notification } from "antd";
import { format, parse } from "date-fns";
import { useContext, useEffect, useState } from "react";
import { PacsQueryContext } from "../context";
import useSettings from "../useSettings";
import { CardHeaderComponent } from "./SettingsComponents";
import StudyCard from "./StudyCard";

function getPatientDetails(patientDetails: any) {
return {
Expand All @@ -35,7 +35,7 @@ const PatientCard = ({ queryResult }: { queryResult: any }) => {
const { PatientID, PatientName, PatientBirthDate, PatientSex } =
patientDetails;

React.useEffect(() => {
useEffect(() => {
if (isError) {
api.error({
message: error.message,
Expand Down Expand Up @@ -93,7 +93,7 @@ const PatientCard = ({ queryResult }: { queryResult: any }) => {
screenreaderText="Loading contents"
/>
</GridItem>
) : !error &&
) : !isError &&
userPreferences &&
userPreferencesArray &&
userPreferencesArray.length > 0 ? (
Expand Down
6 changes: 3 additions & 3 deletions src/components/Pacs/components/SettingsComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from "react";
import axios from "axios";
import { Button, Checkbox } from "@patternfly/react-core";
import { useQueryClient } from "@tanstack/react-query";
import { Popover } from "antd";
import { Checkbox, Button } from "@patternfly/react-core";
import axios from "axios";
import { useState } from "react";
import ChrisApiClient from "../../../api/chrisapiclient";
import { useTypedSelector } from "../../../store/hooks";
import { NodeDetailsPanelIcon } from "../../Icons";
Expand Down
4 changes: 2 additions & 2 deletions src/components/Pacs/components/StudyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CardHeaderComponent } from "./SettingsComponents";
import useSettings from "../useSettings";

const StudyCardCopy = ({ study }: { study: any }) => {
const { data, isLoading, error } = useSettings();
const { data, isLoading, isError } = useSettings();
const { state, dispatch } = useContext(PacsQueryContext);
const [isStudyExpanded, setIsStudyExpanded] = useState(false);
const { preview, pullStudy, studyPullTracker } = state;
Expand Down Expand Up @@ -94,7 +94,7 @@ const StudyCardCopy = ({ study }: { study: any }) => {
</div>
) : (
<>
{!error &&
{!isError &&
userPreferences &&
userPreferencesArray &&
userPreferencesArray.length > 0 ? (
Expand Down

0 comments on commit 80ed861

Please sign in to comment.