diff --git a/app/dashboard/drafts/page.js b/app/dashboard/drafts/page.js index fdc2866f..258a9932 100644 --- a/app/dashboard/drafts/page.js +++ b/app/dashboard/drafts/page.js @@ -53,7 +53,7 @@ export default async function AccountPage() { style={{ maxWidth: 1200 }} >
-

My posts

+

Your posts

{/* set post type to empty so it gets tools too */} diff --git a/app/dashboard/published/page.js b/app/dashboard/published/page.js index b07ea72e..aaf38f13 100644 --- a/app/dashboard/published/page.js +++ b/app/dashboard/published/page.js @@ -43,7 +43,7 @@ export default async function AccountPage() { style={{ maxWidth: 1200 }} >
-

My posts

+

Your posts

{/* set post type to empty so it gets tools too */} diff --git a/components/Dashboard/Dashboard.jsx b/components/Dashboard/Dashboard.jsx index 25191b30..bbb19247 100644 --- a/components/Dashboard/Dashboard.jsx +++ b/components/Dashboard/Dashboard.jsx @@ -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( diff --git a/components/Navbar/parts/NewPostDialog.js b/components/Navbar/parts/NewPostDialog.js index 238de69b..a3cdf975 100644 --- a/components/Navbar/parts/NewPostDialog.js +++ b/components/Navbar/parts/NewPostDialog.js @@ -46,7 +46,7 @@ const NewPostDialog = ({button}) => { {button==true? - :
diff --git a/components/ProfileBadge.js b/components/ProfileBadge.js index fe13e93a..bf758d06 100644 --- a/components/ProfileBadge.js +++ b/components/ProfileBadge.js @@ -1,4 +1,4 @@ -"use client" +"use client"; import React from "react"; import { keyframes } from "@stitches/react"; import { styled } from "../stitches.config"; @@ -156,7 +156,6 @@ const StyledArrow = styled(DropdownMenuPrimitive.Arrow, { fill: "white", }); - // Exports export const DropdownMenu = DropdownMenuPrimitive.Root; export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger; @@ -205,7 +204,6 @@ const IconButton = styled("button", { // } export const ProfileBadgeDropdown = ({ icon, user }) => { - const router = useRouter(); const { mutateUser } = useUser({ redirectTo: "/", @@ -215,11 +213,17 @@ export const ProfileBadgeDropdown = ({ icon, user }) => { - {icon} + + {icon} + - - + { > { - if(user?.profile?.approved){ + if (user?.profile?.approved) { router.push(`/people/${user?.profile?.slug}`); - }else{ + } else { router.push(`/account/profile`); } }} > - - - Profile + + Profile @@ -248,22 +251,23 @@ export const ProfileBadgeDropdown = ({ icon, user }) => { router.push("/dashboard/drafts"); }} > -
- Dashboard +
+ Posts - - { - router.push(`/onboard?onboard=true`); - }} - > - - {/* */} - Setup - {/* */} - {/* ⌘+T */} - + {user?.profile?.onboardComplete !== true ? ( + <> + + { + router.push(`/onboard?onboard=true`); + }} + > + + Setup + + + ) : null} {/* */} {/* { */} - { router.push("/account"); }} @@ -314,7 +318,7 @@ export const ProfileBadgeDropdown = ({ icon, user }) => { Help */} - {user?.isAdmin? ( + {user?.isAdmin ? ( <> { 👾 Strapi - ):''} + ) : ( + "" + )} {user?.profile?.companies?.length ? ( <> @@ -346,7 +352,9 @@ export const ProfileBadgeDropdown = ({ icon, user }) => { Business hub - ):''} + ) : ( + "" + )} { diff --git a/components/icons/index.js b/components/icons/index.js index 2bb24645..6375332e 100644 --- a/components/icons/index.js +++ b/components/icons/index.js @@ -184,7 +184,7 @@ export const CircleWavyCheck = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" > @@ -192,6 +192,20 @@ export const CircleWavyCheck = ({ size, className, color }) => { ); }; +export const CircleWavyQuestion = ({ size, className, color }) => { + return ( + + + + ); +}; export const Article = ({ size, className, color }) => { return ( { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -213,7 +227,7 @@ export const UserCircle = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -228,7 +242,7 @@ export const MagnifyingGlass = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -243,7 +257,7 @@ export const FacebookLogo = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -257,7 +271,7 @@ export const LinkedinLogo = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -271,7 +285,7 @@ export const TwitterLogo = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -285,7 +299,7 @@ export const ArrowSquareOut = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -299,7 +313,7 @@ export const ChartBar = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -313,7 +327,7 @@ export const Gift = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -327,7 +341,7 @@ export const NotePencil = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -341,7 +355,7 @@ export const Briefcase = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -355,7 +369,7 @@ export const MapPin = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -369,7 +383,7 @@ export const Trash = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -383,7 +397,7 @@ export const DotsThree = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -397,7 +411,7 @@ export const Package = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -411,7 +425,7 @@ export const TextAa = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -425,7 +439,7 @@ export const DribbbleLogo = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -439,7 +453,7 @@ export const GithubLogo = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -453,7 +467,7 @@ export const Globe = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -467,7 +481,7 @@ export const Sparkle = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -481,7 +495,7 @@ export const Envelope = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -495,7 +509,7 @@ export const FolderPlus = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -509,7 +523,7 @@ export const ListChecks = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -523,7 +537,7 @@ export const User = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -537,7 +551,7 @@ export const Tag = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -551,7 +565,7 @@ export const ArrowRight = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -565,7 +579,7 @@ export const CaretRight = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -579,7 +593,7 @@ export const House = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -593,7 +607,7 @@ export const RssSimple = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -607,7 +621,7 @@ export const Compass = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -622,7 +636,7 @@ export const Robot = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -636,7 +650,7 @@ export const Swatches = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -650,7 +664,7 @@ export const Wheelchair = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -664,7 +678,7 @@ export const FlowArrow = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -678,7 +692,7 @@ export const BoundingBox = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -692,7 +706,7 @@ export const GitBranch = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > @@ -706,7 +720,7 @@ export const HandEye = ({ size, className, color }) => { className={className} width={size ? size : "32"} height={size ? size : "32"} - fill={color?color:'currentColor'} + fill={color ? color : "currentColor"} viewBox="0 0 256 256" > diff --git a/components/toolbox/HeroCard.js b/components/toolbox/HeroCard.js index 0e63cfe1..e8fdc275 100644 --- a/components/toolbox/HeroCard.js +++ b/components/toolbox/HeroCard.js @@ -2,6 +2,7 @@ import Image from "next/image"; import gumletLoader from "@/components/new-index/gumletLoader"; import Link from "next/link"; import Button from "@/components/Primitives/Button" +import { CircleWavyQuestion } from "../icons"; const HeroCard = ({logo, post, tags, featuredImage}) =>{ return(
{
- - - +
- Is this your tool?{" "} + Is this yours?{" "} fetch(url).then((res) => res.json()) @@ -10,6 +10,7 @@ export default function useUser({ redirectTo = '', redirectIfFound = false, } = {}) { + const router = useRouter() const { data: user, mutate: mutateUser, isValidating:isLoading } = useSWR(`/api/auth/user`, fetcher) useEffect(() => { // if no redirect needed, just return (example: already on /dashboard) @@ -22,7 +23,7 @@ export default function useUser({ // If redirectIfFound is also set, redirect if the user was found (redirectIfFound && user?.isLoggedIn) ) { - Router.push(redirectTo) + router.push(redirectTo) } }, [user, redirectIfFound, redirectTo]) diff --git a/pages/account/index.jsx b/pages/account/index.jsx index 8e6f76f3..5385aa0a 100644 --- a/pages/account/index.jsx +++ b/pages/account/index.jsx @@ -9,7 +9,7 @@ import axios from "axios"; import useUser from "@/lib/iron-session/useUser"; import { getPostsByPageAndAuthor } from "@/lib/api"; import { useEffect, useState } from "react"; -import {CircleWavyCheck} from '@/components/icons' +import {CircleWavyCheck, CircleWavyQuestion} from '@/components/icons' const toast = dynamic(() => import("react-hot-toast"), { ssr: true }); const Form = dynamic(() => import("@/components/Form"), { ssr: true }); @@ -67,7 +67,8 @@ const AccountPage = ({ preview }) => {
- + + {/* */}

Your{" "} diff --git a/pages/account/profile.js b/pages/account/profile.js index e6631b0e..0c982a85 100644 --- a/pages/account/profile.js +++ b/pages/account/profile.js @@ -8,116 +8,136 @@ import { getPostsByPageAndAuthor } from "@/lib/api"; import { useEffect, useState } from "react"; import ProfilePageLayout from "@/components/people/ProfilePageLayout"; - -const toast = dynamic(() => import('react-hot-toast'), { ssr: true }) +const toast = dynamic(() => import("react-hot-toast"), { ssr: true }); const AccountPage = ({ preview }) => { - - const {user} = useUser({ - redirectTo: '/', + const { user } = useUser({ + redirectTo: "/", redirectIfFound: false, - }) - - const [hasPosts, setHasPosts] = useState(true) - + }); - useEffect(()=>{ + const [hasPosts, setHasPosts] = useState(true); - const checkUserPosts= async () =>{ + useEffect(() => { + const checkUserPosts = async () => { let sort = ["featured:desc", "tier:asc", "date:desc"]; let allPosts = - (await getPostsByPageAndAuthor(false, 1, 1, [user?.profile?.slug], sort)) || - []; - let has = false - if(allPosts?.data?.length){ - has = true - } - setHasPosts(has) - } - if(user){ - checkUserPosts() + (await getPostsByPageAndAuthor( + false, + 1, + 1, + [user?.profile?.slug], + sort + )) || []; + let has = false; + if (allPosts?.data?.length) { + has = true; + } + setHasPosts(has); + }; + if (user) { + checkUserPosts(); } + }, [user]); - },[user]) + const [sent, setSent] = useState(false); + const [isLoading, setIsLoading] = useState(false); - const [sent, setSent] = useState(false) - const [isLoading, setIsLoading] = useState(false) if (!user) { - return ; + return( +

+ +
) } if (user?.isLoggedIn) { return ( - - + /> ); } // TODO - return( - - Account Settings - - -
Unauthenticated, whoops!
-
) + return ( + + + Account Settings + + +
Unauthenticated, whoops!
+
+ ); }; export default AccountPage; - -const showSuccessToast = (loadingToastId) =>{ - toast.dismiss(loadingToastId) - toast.custom((t) => ( -
-
- -
-
- - - - - -
-
-

Check your email.

-

- Click the link in your inbox to sign in. -

+const showSuccessToast = loadingToastId => { + toast.dismiss(loadingToastId); + toast.custom( + t => ( +
+
+ +
+
+ + + +
+
+

Check your email.

+

+ Click the link in your inbox to sign in. +

+
-
- ), {duration:10000}) -} + ), + { duration: 10000 } + ); +}; diff --git a/pages/admin/index.js b/pages/admin/index.js index 62b36557..560b475a 100644 --- a/pages/admin/index.js +++ b/pages/admin/index.js @@ -35,7 +35,7 @@ export default function Index() { style={{ maxWidth: 1200 }} >
-

My posts

+

Your posts

diff --git a/pages/apply/form.js b/pages/apply/form.js index f649ce93..921ad7ff 100644 --- a/pages/apply/form.js +++ b/pages/apply/form.js @@ -43,7 +43,7 @@ export default function Apply() {