Skip to content

Commit

Permalink
improve navigation (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiero authored and Janaka-Steph committed Nov 7, 2023
1 parent b754071 commit 7e36a8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/modules/service-detail/components/ServiceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ServiceDetail = () => {
}, [queryClient, refetch]);

const back = () => {
navigate("/");
navigate(-1);
};

if (isLoading || !service || Object.keys(service ?? {}).length === 0) return <ServiceLoading />;
Expand Down
15 changes: 9 additions & 6 deletions src/modules/service/components/StoppedServiceState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const StoppedServiceState = ({
onOpenClick,
openDeleteModal,
setOpenDeleteModal,
isDetailView,
}: ServiceStateProps & DeleteModalProps) => {
const { mutate: deleteMutate, isPending: isDeletePending } = useDeleteService();
const { mutateAsync: startMutateAsync, isPending: isStartPending } = useStartService();
Expand Down Expand Up @@ -70,12 +71,14 @@ const StoppedServiceState = ({

return (
<>
<PrimaryButton
className="!rounded-[14px] !px-5 !py-0 !text-[10px] !h-[30px] flex items-center"
onClick={onStart}
>
Open
</PrimaryButton>
{isDetailView && (
<PrimaryButton
className="!rounded-[14px] !px-5 !py-0 !text-[10px] !h-[30px] flex items-center"
onClick={onStart}
>
Open
</PrimaryButton>
)}
{openDeleteModal && (
<WarningModal
icon={<DeleteIcon />}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/LeftSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const LeftSidebar = ({ setHamburgerMenu, children }: LeftSidebarProps) => {
const navigate = useNavigate();

const onCloseClick = () => {
navigate("/");
navigate(-1);
};

return (
Expand Down

0 comments on commit 7e36a8e

Please sign in to comment.