Skip to content

Commit

Permalink
dashboard->posts (menu), tidy stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed May 30, 2024
1 parent c2b29da commit c3b76b4
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 158 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/drafts/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default async function AccountPage() {
style={{ maxWidth: 1200 }}
>
<div className="flex flex-row justify-between items-baseline mt-3">
<h1 className="my-3 text-3xl font-semibold">My posts</h1>
<h1 className="my-3 text-3xl font-semibold">Your posts</h1>
</div>
<Navigation activeTab={1} />
{/* set post type to empty so it gets tools too */}
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/published/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function AccountPage() {
style={{ maxWidth: 1200 }}
>
<div className="flex flex-row justify-between items-baseline mt-3">
<h1 className="my-3 text-3xl font-semibold">My posts</h1>
<h1 className="my-3 text-3xl font-semibold">Your posts</h1>
</div>
<Navigation activeTab={2} />
{/* set post type to empty so it gets tools too */}
Expand Down
1 change: 1 addition & 0 deletions components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Skeleton from "./Skeleton";
const Dashboard = ({ postStatus, postType, currentTab }) => {
const { user } = useUser({
redirectIfFound: false,
redirectTo: "/",
});

const { posts, loading, refetch, total, pageSize } = useFetchPosts(
Expand Down
2 changes: 1 addition & 1 deletion components/Navbar/parts/NewPostDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const NewPostDialog = ({button}) => {
<Dialog onOpenChange={toggleSubmitOpen} open={submitOpen}>
<DialogTrigger asChild>
{button==true?
<Button variant={"confirmBig"} className="rounded-full">
<Button variant={"confirmBig"} className="!rounded-xl !h-[44px] !px-4 !font-medium !py-0">
Create new
</Button>
:<div className="flex cursor-pointer text-black/80 text-sm mr-1">
Expand Down
66 changes: 37 additions & 29 deletions components/ProfileBadge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use client"
"use client";
import React from "react";
import { keyframes } from "@stitches/react";
import { styled } from "../stitches.config";
Expand Down Expand Up @@ -156,7 +156,6 @@ const StyledArrow = styled(DropdownMenuPrimitive.Arrow, {
fill: "white",
});


// Exports
export const DropdownMenu = DropdownMenuPrimitive.Root;
export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
Expand Down Expand Up @@ -205,7 +204,6 @@ const IconButton = styled("button", {
// }

export const ProfileBadgeDropdown = ({ icon, user }) => {

const router = useRouter();
const { mutateUser } = useUser({
redirectTo: "/",
Expand All @@ -215,11 +213,17 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
<Box>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton aria-label="Customise options" className="!rounded-full">{icon}</IconButton>
<IconButton aria-label="Customise options" className="!rounded-full">
{icon}
</IconButton>
</DropdownMenuTrigger>

<DropdownMenuPrimitive.DropdownMenuPortal container={typeof document !=='undefined' && document?.getElementById('main-nav')}>

<DropdownMenuPrimitive.DropdownMenuPortal
container={
typeof document !== "undefined" &&
document?.getElementById("main-nav")
}
>
<DropdownMenuContent
side={"bottom"}
align={"center"}
Expand All @@ -229,16 +233,15 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
>
<DropdownMenuItem
onSelect={() => {
if(user?.profile?.approved){
if (user?.profile?.approved) {
router.push(`/people/${user?.profile?.slug}`);
}else{
} else {
router.push(`/account/profile`);
}
}}
>

<UserCircle size={26} className="opacity-80 mr-3"/>
Profile
<UserCircle size={26} className="opacity-80 mr-3" />
Profile
</DropdownMenuItem>

<DropdownMenuSeparator />
Expand All @@ -248,22 +251,23 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
router.push("/dashboard/drafts");
}}
>
<Article size={26} className="opacity-80 mr-3"/>
Dashboard
<Article size={26} className="opacity-80 mr-3" />
Posts
</DropdownMenuItem>
<DropdownMenuSeparator />

<DropdownMenuItem
onSelect={() => {
router.push(`/onboard?onboard=true`);
}}
>
<CircleWavyCheck size={26} className="opacity-80 mr-3" />
{/* <Link href="/account"> */}
Setup
{/* </Link> */}
{/* <RightSlot>⌘+T</RightSlot> */}
</DropdownMenuItem>
{user?.profile?.onboardComplete !== true ? (
<>
<DropdownMenuSeparator />
<DropdownMenuItem
onSelect={() => {
router.push(`/onboard?onboard=true`);
}}
>
<CircleWavyCheck size={26} className="opacity-80 mr-3" />
Setup
</DropdownMenuItem>
</>
) : null}
{/* <DropdownMenuSeparator /> */}

{/* <DropdownMenuItemBanner
Expand Down Expand Up @@ -298,7 +302,7 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
</DropdownMenuItem>
<DropdownMenuSeparator /> */}
<DropdownMenuSeparator />
<DropdownMenuItem
<DropdownMenuItem
onSelect={() => {
router.push("/account");
}}
Expand All @@ -314,7 +318,7 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
Help
</DropdownMenuItem> */}

{user?.isAdmin? (
{user?.isAdmin ? (
<>
<DropdownMenuSeparator />
<DropdownMenuItem
Expand All @@ -334,7 +338,9 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
👾 Strapi
</DropdownMenuItem>
</>
):''}
) : (
""
)}
{user?.profile?.companies?.length ? (
<>
<DropdownMenuSeparator />
Expand All @@ -346,7 +352,9 @@ export const ProfileBadgeDropdown = ({ icon, user }) => {
Business hub
</DropdownMenuItem>
</>
):''}
) : (
""
)}
<DropdownMenuSeparator />
<DropdownMenuItem
onSelect={async () => {
Expand Down
Loading

0 comments on commit c3b76b4

Please sign in to comment.