mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
3 Commits
timeline-v
...
fix/space-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dc14975bd | ||
|
|
f661b3d258 | ||
|
|
78c018dc6f |
50
space/core/components/common/empty-state.tsx
Normal file
50
space/core/components/common/empty-state.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
"use client";
|
||||
import React from "react";
|
||||
|
||||
import Image from "next/image";
|
||||
|
||||
// ui
|
||||
import { Button } from "@plane/ui";
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
description?: React.ReactNode;
|
||||
image: any;
|
||||
primaryButton?: {
|
||||
icon?: any;
|
||||
text: string;
|
||||
onClick: () => void;
|
||||
};
|
||||
secondaryButton?: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
export const EmptyState: React.FC<Props> = ({
|
||||
title,
|
||||
description,
|
||||
image,
|
||||
primaryButton,
|
||||
secondaryButton,
|
||||
disabled = false,
|
||||
}) => (
|
||||
<div className={`flex h-full w-full items-center justify-center`}>
|
||||
<div className="flex w-full flex-col items-center text-center">
|
||||
<Image src={image} className="w-52 sm:w-60" alt={primaryButton?.text || "button image"} />
|
||||
<h6 className="mb-3 mt-6 text-xl font-semibold sm:mt-8">{title}</h6>
|
||||
{description && <p className="mb-7 px-5 text-custom-text-300 sm:mb-8">{description}</p>}
|
||||
<div className="flex items-center gap-4">
|
||||
{primaryButton && (
|
||||
<Button
|
||||
variant="primary"
|
||||
prependIcon={primaryButton.icon}
|
||||
onClick={primaryButton.onClick}
|
||||
disabled={disabled}
|
||||
>
|
||||
{primaryButton.text}
|
||||
</Button>
|
||||
)}
|
||||
{secondaryButton}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -1,6 +1,11 @@
|
||||
import { observer } from "mobx-react";
|
||||
// import { useTheme } from "next-themes";
|
||||
import { useTheme } from "next-themes";
|
||||
import { TLoader } from "@plane/types";
|
||||
import { LogoSpinner } from "@/components/common";
|
||||
import { EmptyState } from "@/components/common/empty-state";
|
||||
import emptyIssueDark from "@/public/empty-state/search/issues-dark.webp"
|
||||
import emptyIssueLight from "@/public/empty-state/search/issues-light.webp"
|
||||
|
||||
interface Props {
|
||||
children: string | JSX.Element | JSX.Element[];
|
||||
@@ -13,6 +18,9 @@ interface Props {
|
||||
}
|
||||
|
||||
export const IssueLayoutHOC = observer((props: Props) => {
|
||||
|
||||
const { resolvedTheme } = useTheme();
|
||||
|
||||
const { getIssueLoader, getGroupIssueCount } = props;
|
||||
|
||||
const issueCount = getGroupIssueCount(undefined, undefined, false);
|
||||
@@ -26,7 +34,14 @@ export const IssueLayoutHOC = observer((props: Props) => {
|
||||
}
|
||||
|
||||
if (getGroupIssueCount(undefined, undefined, false) === 0) {
|
||||
return <div className="flex w-full h-full items-center justify-center">No Issues Found</div>;
|
||||
return <div className="flex w-full h-full items-center justify-center">
|
||||
{/* No Issues Found */}
|
||||
<EmptyState
|
||||
image={resolvedTheme === "dark" ? emptyIssueDark : emptyIssueLight}
|
||||
title="Issue does not exist"
|
||||
description="The project you are looking for has no issues or has been archived."
|
||||
/>
|
||||
</div>;
|
||||
}
|
||||
|
||||
return <>{props.children}</>;
|
||||
|
||||
BIN
space/public/empty-state/search/issues-dark.webp
Normal file
BIN
space/public/empty-state/search/issues-dark.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
BIN
space/public/empty-state/search/issues-light.webp
Normal file
BIN
space/public/empty-state/search/issues-light.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Reference in New Issue
Block a user