-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a02a3d3
commit 77d784b
Showing
9 changed files
with
228 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./app"; | ||
export * from "./info"; | ||
export * from "./routes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { signOut } from "next-auth/react"; | ||
import { IconType } from "react-icons"; | ||
import { | ||
TbBookmarks, | ||
TbBuildingSkyscraper, | ||
TbBuildingWarehouse, | ||
TbLogout, | ||
TbSettings, | ||
} from "react-icons/tb"; | ||
|
||
import { ListingTypes } from "@/data/clients/ninetyNine"; | ||
|
||
export interface Route { | ||
label: string; | ||
href: string; | ||
icon?: IconType; | ||
description?: string; | ||
} | ||
|
||
export const AccountMenulist: (Omit<Route, "href"> & { | ||
href?: string; | ||
onClick?: () => void; | ||
})[] = [ | ||
{ | ||
label: "Saved listings", | ||
icon: TbBookmarks, | ||
href: `/account/saved`, | ||
}, | ||
{ | ||
label: "Account settings", | ||
icon: TbSettings, | ||
href: `/account/update`, | ||
}, | ||
{ | ||
label: "Logout", | ||
icon: TbLogout, | ||
onClick: () => signOut(), | ||
}, | ||
]; | ||
|
||
export const NavRoutes: (Route & { | ||
nodes?: Route[]; | ||
})[] = [ | ||
{ | ||
label: "Home", | ||
href: "/", | ||
}, | ||
{ | ||
label: "Rent", | ||
href: `/property/${ListingTypes[0]}`, | ||
}, | ||
{ | ||
label: "Buy", | ||
href: `/property/${ListingTypes[1]}`, | ||
}, | ||
{ | ||
label: "Explore", | ||
href: `#`, | ||
nodes: [ | ||
{ | ||
icon: TbBuildingWarehouse, | ||
label: "Neighbourhoods", | ||
href: "/explore/neighbourhoods", | ||
description: "Find a neighbourhood you'll love to live in", | ||
}, | ||
{ | ||
icon: TbBuildingSkyscraper, | ||
label: "New Launches", | ||
href: "/explore/new-launches", | ||
description: "Check out the latest projects launches to hit the market", | ||
}, | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { useMantineTheme } from "@mantine/core"; | ||
import { useRouter } from "next/router"; | ||
import { useSession } from "next-auth/react"; | ||
import { useEffect } from "react"; | ||
|
||
import { Layout, Property, Provider } from "@/components"; | ||
import BetaWarning from "@/components/Layouts/BetaWarning"; | ||
import UnknownState from "@/components/Layouts/UnknownState"; | ||
|
||
import { useIsTablet } from "@/utils"; | ||
|
||
import EmptyListing from "~/assets/images/empty-listing.svg"; | ||
|
||
const AgentPostedPage = () => { | ||
const theme = useMantineTheme(); | ||
const isTablet = useIsTablet(theme); | ||
|
||
const router = useRouter(); | ||
const { data: sessionData, status: sessionStatus } = useSession(); | ||
const isAuth = !!sessionData; | ||
const isAuthLoading: boolean = sessionStatus === "loading"; | ||
|
||
//#endregion //*======== Pre-Render Checks =========== | ||
|
||
useEffect(() => { | ||
if (!isAuthLoading && !isAuth) { | ||
router.replace("/account/signIn"); | ||
return; | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [isAuth, isAuthLoading]); | ||
|
||
//#endregion //*======== Pre-Render Checks =========== | ||
|
||
return ( | ||
<Layout.Base | ||
layoutStylesOverwrite={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "5vh", | ||
}} | ||
> | ||
<BetaWarning /> | ||
|
||
<Provider.RenderGuard renderIf={isAuth}> | ||
<Property.Grid | ||
showViewMode={false} | ||
title="Posted" | ||
listings={[]} | ||
// listings={allListings.get(type) ?? []} | ||
// isLoading={isTypeLoading} | ||
maxViewableCount={isTablet ? 4 : 3} | ||
placeholderCount={isTablet ? 4 : 3} | ||
emptyFallback={ | ||
<UnknownState | ||
allowRedirect={false} | ||
svgNode={<EmptyListing />} | ||
title="No posted listings" | ||
subtitle={<>Work in Progress</>} | ||
/> | ||
} | ||
/> | ||
</Provider.RenderGuard> | ||
</Layout.Base> | ||
); | ||
}; | ||
|
||
export default AgentPostedPage; |
Oops, something went wrong.