From fae02bb01136a0ff877a7512d654c179ac883f50 Mon Sep 17 00:00:00 2001 From: Graeme Fulton Date: Thu, 15 Feb 2024 12:18:05 +0100 Subject: [PATCH] people archive page --- components/people/ProfileCard.js | 200 +++++++++++++----- components/people/ProfilePageLayout.js | 4 +- .../toolbox/ToolboxHeroWithEmailSignup.js | 8 +- components/toolbox/toolboxHero.js | 8 +- components/v4/layout/TwoColumnCardsB.js | 4 +- components/v4/section/HeroArticleSection.js | 4 +- components/v4/section/PostsSectionHero.js | 21 +- lib/queries/newPeopleQuery.js | 4 + pages/index.js | 12 +- pages/people/index.js | 14 +- pages/people/page/[pageNo].js | 27 +-- pages/posts/index.js | 6 +- 12 files changed, 217 insertions(+), 95 deletions(-) diff --git a/components/people/ProfileCard.js b/components/people/ProfileCard.js index 291908e7..24eb1847 100644 --- a/components/people/ProfileCard.js +++ b/components/people/ProfileCard.js @@ -1,7 +1,9 @@ import Image from "next/image"; import Link from "next/link"; import gumletLoader from "../new-index/gumletLoader"; - +import { DribbbleLogo, TwitterLogo, GithubLogo, MapPin } from "phosphor-react"; +import { accountLocations } from "@/lib/constants"; +import { useState } from "react"; export default function ProfileCard({ title, slug, @@ -10,67 +12,161 @@ export default function ProfileCard({ bio = "", location = "", avatar = "", + twitter, dribbble, kofi, github }) { let skillArr = []; if (skills && skills !== "") { skillArr = skills.split(","); } const img = avatar ? avatar : legacyAvatar; + + const [locationNiceName, setLocationNiceName] = useState(()=>{ + if(location){ + for(var x =0;x -
-
- {img && ( -
-
- - {`Avatar -
+
+
+ +
+
+
+ {img? {`Avatar:
} +
+
+
+
+
+

+ {title} +

+
+ {locationNiceName?
+ +
{locationNiceName}
+
:null} +
+
+ {bio}
- )} -
-
-
-
- -

- {title} -

- -
- {/*
- {location} -
*/} -
-
-
-
-
- {/* {skillArr?.length?
- {skillArr.length - ? skillArr.map((skill) => { - return ( -
- # {skill} -
- ); - }) - : null} -
:''} */} -
+
+ {twitter? + + :null} + {dribbble? + + :null} + {github? + + :null} +
- + {/*
+ {skillArr?.map((skill)=>{ + return (
+ {skill} +
) + })} +
*/} +
+
+ + ); } + + +// +//
+//
+// {img && ( +//
+//
+ +// {`Avatar +//
+//
+// )} +//
+//
+//
+//
+// +//

+// {title} +//

+// +//
+// {/*
+// {location} +//
*/} +//
+//
+//
+//
+//
+ +//
+//
+//
+// diff --git a/components/people/ProfilePageLayout.js b/components/people/ProfilePageLayout.js index f3fe7d01..63ab1e2e 100644 --- a/components/people/ProfilePageLayout.js +++ b/components/people/ProfilePageLayout.js @@ -100,10 +100,10 @@ const ProfilePageLayout = ({ {/*
*/} -
+
{(kofi || (unapproved && user?.profile?.kofi)) && (
diff --git a/components/toolbox/ToolboxHeroWithEmailSignup.js b/components/toolbox/ToolboxHeroWithEmailSignup.js index 33fadc3b..c3013159 100644 --- a/components/toolbox/ToolboxHeroWithEmailSignup.js +++ b/components/toolbox/ToolboxHeroWithEmailSignup.js @@ -139,8 +139,8 @@ const ToolBoxHeroWithSignup = ({user}) => {
{ + initialDuration={180} + slides={ProductListData.map((data, i) => { return ( { })} /> { + initialDuration={150} + slides={ProductListData2.map((data, i) => { return ( {
{ + initialDuration={180} + slides={ProductListData.map((data, i) => { return ( { })} /> { + initialDuration={150} + slides={ProductListData2.map((data, i) => { return ( { +const HeroArticleSection = ({user, heroCardPost,showBigPost, viewablePosts, cols,title, showHeading,showHeadingRow }) => { return ( {/*
*/}
- +
{/* { +const PostsSectionHero = ({user, heroCardPost,toolsList,showHeroTitle,groupSlice, viewablePosts, showTags,title, showRecent,showTitle }) => { return ( {showRecent && <> {/*
*/}
-
+
{/* */} - + {/* */} + {/* */}
@@ -32,7 +43,7 @@ const PostsSectionHero = ({user, heroCardPost,toolsList,showHeroTitle, viewableP
} -
+
{showTitle!==false && @@ -41,7 +52,7 @@ const PostsSectionHero = ({user, heroCardPost,toolsList,showHeroTitle, viewableP
}
- +
{/* :
} -
{`Today's Toolbox`}
+
{`Today's Toolbox`}
{/*

Tools to shape every idea

*/} - +
@@ -138,6 +138,7 @@ export default function Index({ jobsSidebar={jobsSidebar} // showBigPost={false} showBigPost={2} + showTitle={false} /> {/* */}
-
+
@@ -158,7 +159,6 @@ export default function Index({ - {/*
@@ -201,7 +201,7 @@ export default function Index({ Browse by category
-
+
See all
@@ -292,7 +292,7 @@ export default function Index({ - +
:'' }
diff --git a/pages/people/index.js b/pages/people/index.js index e275e3ac..e0573b11 100644 --- a/pages/people/index.js +++ b/pages/people/index.js @@ -41,15 +41,21 @@ export default function PeoplePage({ Loading… ) : <> +

Contributors

{allPosts.length > 0 && ( -
+
-
+
{allPosts.map((post, i) => - )} + />)})}
Loading… ) : <> - {allPosts.length > 0 && ( -
-
-
+

Page {pagination?.page}

+ {allPosts.length > 0 && ( +
+
+
{allPosts.map((post, i) => - )} + />)})}
-
+ {/*
- {/* */}
-
+
*/}
)} } diff --git a/pages/posts/index.js b/pages/posts/index.js index f3e30f56..6278f79d 100644 --- a/pages/posts/index.js +++ b/pages/posts/index.js @@ -13,7 +13,7 @@ import { getPostsByPageForPostsPage } from "@/lib/api"; import TagsNavRow from "@/components/v4/section/TagsNavRow"; import PostsSectionHero from "@/components/v4/section/PostsSectionHero"; // import Head from "next/head"; -const PAGE_SIZE = 9; +const PAGE_SIZE = 10; export default function PostsPage({ allPosts = [], preview, pagination = {} }) { let heroPost; let morePosts = []; @@ -62,7 +62,9 @@ export default function PostsPage({ allPosts = [], preview, pagination = {} }) { ? morePosts.length > 0 && @@ -70,6 +72,8 @@ export default function PostsPage({ allPosts = [], preview, pagination = {} }) { : allPosts.length > 0 &&