chore: profile activity empty state added (#4732)
This commit is contained in:
parent
a23c528396
commit
2331404d46
6 changed files with 26 additions and 2 deletions
|
|
@ -5,7 +5,10 @@ import { Button } from "@plane/ui";
|
|||
// components
|
||||
import { PageHead } from "@/components/core";
|
||||
import { SidebarHamburgerToggle } from "@/components/core/sidebar";
|
||||
import { EmptyState } from "@/components/empty-state";
|
||||
import { ProfileActivityListPage } from "@/components/profile";
|
||||
// constants
|
||||
import { EmptyStateType } from "@/constants/empty-state";
|
||||
//hooks
|
||||
import { useAppTheme } from "@/hooks/store";
|
||||
// layouts
|
||||
|
|
@ -20,6 +23,7 @@ const ProfileActivityPage: NextPageWithLayout = observer(() => {
|
|||
const [pageCount, setPageCount] = useState(1);
|
||||
const [totalPages, setTotalPages] = useState(0);
|
||||
const [resultsCount, setResultsCount] = useState(0);
|
||||
const [isEmpty, setIsEmpty] = useState(false);
|
||||
// store hooks
|
||||
const { toggleSidebar } = useAppTheme();
|
||||
|
||||
|
|
@ -27,6 +31,8 @@ const ProfileActivityPage: NextPageWithLayout = observer(() => {
|
|||
|
||||
const updateResultsCount = (count: number) => setResultsCount(count);
|
||||
|
||||
const updateEmptyState = (isEmpty: boolean) => setIsEmpty(isEmpty);
|
||||
|
||||
const handleLoadMore = () => setPageCount((prev) => prev + 1);
|
||||
|
||||
const activityPages: JSX.Element[] = [];
|
||||
|
|
@ -38,11 +44,16 @@ const ProfileActivityPage: NextPageWithLayout = observer(() => {
|
|||
perPage={PER_PAGE}
|
||||
updateResultsCount={updateResultsCount}
|
||||
updateTotalPages={updateTotalPages}
|
||||
updateEmptyState={updateEmptyState}
|
||||
/>
|
||||
);
|
||||
|
||||
const isLoadMoreVisible = pageCount < totalPages && resultsCount !== 0;
|
||||
|
||||
if (isEmpty) {
|
||||
return <EmptyState type={EmptyStateType.PROFILE_ACTIVITY} layout="screen-detailed" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHead title="Profile - Activity" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue