Skip to content

Commit

Permalink
Merge pull request #420 from phasehq/fix--no-apps-empty-state
Browse files Browse the repository at this point in the history
fix: add an empty state when user doesn't have access to any apps
  • Loading branch information
rohan-chaturvedi authored Dec 19, 2024
2 parents 2a0d6f1 + e4c3042 commit 8ff0934
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/app/[team]/apps/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSearchParams } from 'next/navigation'
import { userHasPermission } from '@/utils/access/permissions'
import { EmptyState } from '@/components/common/EmptyState'
import { FaBan } from 'react-icons/fa'
import { FaBoxOpen } from 'react-icons/fa6'

export default function AppsHome({ params }: { params: { team: string } }) {
const { activeOrganisation: organisation } = useContext(organisationContext)
Expand Down Expand Up @@ -59,6 +60,21 @@ export default function AppsHome({ params }: { params: { team: string } }) {
<NewAppDialog organisation={organisation} appCount={apps.length} ref={dialogRef} />
</div>
)}
{apps?.length === 0 && !userCanCreateApps && (
<div className="xl:col-span-2 1080p:col-span-3 justify-center p-20">
<EmptyState
title="No apps"
subtitle="You don't have access to any apps yet. Contact an Admin to get access."
graphic={
<div className="text-neutral-300 dark:text-neutral-700 text-7xl text-center">
<FaBoxOpen />
</div>
}
>
<></>
</EmptyState>
</div>
)}
</div>
) : (
<EmptyState
Expand Down

0 comments on commit 8ff0934

Please sign in to comment.