From b74f710f1f73423aec1e533c8492a955279a5f9f Mon Sep 17 00:00:00 2001 From: mannynotfound Date: Thu, 14 Jul 2022 10:48:52 -0400 Subject: [PATCH 1/3] community page layout improvements --- .../client/src/components/CommunityAbout.js | 27 +++++-------------- .../client/src/components/CommunityLinks.js | 8 ++---- .../packages/client/src/components/Title.js | 9 +++++++ .../packages/client/src/components/index.js | 1 + .../packages/client/src/pages/Community.js | 9 +++---- 5 files changed, 22 insertions(+), 32 deletions(-) create mode 100644 frontend/packages/client/src/components/Title.js diff --git a/frontend/packages/client/src/components/CommunityAbout.js b/frontend/packages/client/src/components/CommunityAbout.js index e121d48ce..8cdaff9a6 100644 --- a/frontend/packages/client/src/components/CommunityAbout.js +++ b/frontend/packages/client/src/components/CommunityAbout.js @@ -1,10 +1,11 @@ import React from 'react'; import Blockies from 'react-blockies'; import { kebabToString } from 'utils'; +import { Title } from '.'; const CommunityMemberInfo = ({ name }) => { return ( -
+
@@ -13,14 +14,6 @@ const CommunityMemberInfo = ({ name }) => { ); }; -const Title = ({ role, styles = {} } = {}) => { - return ( -
- {role} -
- ); -}; - const CommunityAbout = ({ textAbout = '', adminMembers = [], @@ -31,10 +24,8 @@ const CommunityAbout = ({ return (
-
- - </div> - <div className="column is-12"> + <div className="column is-12 pt-0"> + <Title>About

{textAbout}

@@ -47,13 +38,9 @@ const CommunityAbout = ({ />
- <div className="columns flex-1"> <div className="column is-6"> - <Title role={'Strategies'} styles={{ paddingBottom: '24px' }} /> + <Title>Strategies {strategies.map((item, index) => (
- + <Title>Admin {adminMembers.map((item, index) => ( ))}
- + <Title>Authors {authorsMembers.map((item, index) => ( ))} diff --git a/frontend/packages/client/src/components/CommunityLinks.js b/frontend/packages/client/src/components/CommunityLinks.js index 8105f2c2c..7235e7192 100644 --- a/frontend/packages/client/src/components/CommunityLinks.js +++ b/frontend/packages/client/src/components/CommunityLinks.js @@ -1,5 +1,6 @@ import React from 'react'; import { Twitter, Discord, Website, Instagram, Github } from './Svg'; +import { Title } from '.'; export default function CommunityLinks({ instagramUrl, @@ -10,12 +11,7 @@ export default function CommunityLinks({ } = {}) { return (
-
- Links -
+ Links {websiteUrl && ( ( +
+ {children} +
+); + +export default Title; diff --git a/frontend/packages/client/src/components/index.js b/frontend/packages/client/src/components/index.js index 9f18926a9..7c7ae2680 100644 --- a/frontend/packages/client/src/components/index.js +++ b/frontend/packages/client/src/components/index.js @@ -26,6 +26,7 @@ export { default as CommunityPropsAndVoting } from './Community/CommunityPropsAn export { default as AddButton } from './AddButton'; export { default as ActionButton } from './ActionButton'; export { default as Input } from './Input'; +export { default as Title } from './Title'; export { PropCreateStepOne, PropCreateStepTwo, diff --git a/frontend/packages/client/src/pages/Community.js b/frontend/packages/client/src/pages/Community.js index d9171fcd2..9adea187d 100644 --- a/frontend/packages/client/src/pages/Community.js +++ b/frontend/packages/client/src/pages/Community.js @@ -86,7 +86,7 @@ const AboutLayout = ({ {showEdit && }
{communityPulse ? ( @@ -111,11 +111,8 @@ const MembersLayout = ({ } = {}) => { return (
-
- {communityLinks} +
+
{communityLinks}
Date: Fri, 15 Jul 2022 09:07:38 -0400 Subject: [PATCH 2/3] allow title to accept classnames and adjust member list spacing --- frontend/packages/client/src/components/CommunityLinks.js | 2 +- .../packages/client/src/components/CommunityMembersList.js | 6 +++--- frontend/packages/client/src/components/Title.js | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/packages/client/src/components/CommunityLinks.js b/frontend/packages/client/src/components/CommunityLinks.js index 7235e7192..ae6469666 100644 --- a/frontend/packages/client/src/components/CommunityLinks.js +++ b/frontend/packages/client/src/components/CommunityLinks.js @@ -11,7 +11,7 @@ export default function CommunityLinks({ } = {}) { return (
- Links + Links {websiteUrl && (

{pagination?.totalRecords ?? '...'} members diff --git a/frontend/packages/client/src/components/Title.js b/frontend/packages/client/src/components/Title.js index ca3682a53..5e1a2f3f0 100644 --- a/frontend/packages/client/src/components/Title.js +++ b/frontend/packages/client/src/components/Title.js @@ -1,7 +1,9 @@ import React from 'react'; -const Title = ({ children }) => ( -

+const Title = ({ children, className }) => ( +
{children}
); From 414663d56d3b8540165039642449fa29537faefd Mon Sep 17 00:00:00 2001 From: Manny404 Date: Mon, 18 Jul 2022 13:05:44 -0400 Subject: [PATCH 3/3] initialize className with default empty string --- frontend/packages/client/src/components/Title.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/packages/client/src/components/Title.js b/frontend/packages/client/src/components/Title.js index 5e1a2f3f0..aa8f3daf6 100644 --- a/frontend/packages/client/src/components/Title.js +++ b/frontend/packages/client/src/components/Title.js @@ -1,6 +1,6 @@ import React from 'react'; -const Title = ({ children, className }) => ( +const Title = ({ children, className = '' }) => (