From 8f979b30fc488b9ccb738d25354bb265d092752d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 4 May 2022 11:51:52 -0500 Subject: [PATCH 1/4] Badge: fix bot text color, fixes #933 --- app/soapbox/components/badge.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/components/badge.tsx b/app/soapbox/components/badge.tsx index 7ca11c8639..2eb2d221d5 100644 --- a/app/soapbox/components/badge.tsx +++ b/app/soapbox/components/badge.tsx @@ -15,7 +15,7 @@ const Badge: React.FC = ({ title, slug }) => ( 'bg-yellow-500': slug === 'donor', 'bg-black': slug === 'admin', 'bg-cyan-600': slug === 'moderator', - 'bg-gray-100 text-gray-800': slug === 'bot', + 'bg-gray-100 text-gray-900': slug === 'bot', 'bg-white bg-opacity-75 text-gray-900': slug === 'opaque', })} > From 5e9c81b0c1b918834f8b4a8c3c9f6fc5de08ecf7 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 4 May 2022 11:55:22 -0500 Subject: [PATCH 2/4] Notification: change `status` notification to bell-ringing --- app/soapbox/features/notifications/components/notification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/notifications/components/notification.tsx b/app/soapbox/features/notifications/components/notification.tsx index db6f02299e..97a2818fe5 100644 --- a/app/soapbox/features/notifications/components/notification.tsx +++ b/app/soapbox/features/notifications/components/notification.tsx @@ -45,7 +45,7 @@ const icons: Record = { mention: require('@tabler/icons/icons/at.svg'), favourite: require('@tabler/icons/icons/heart.svg'), reblog: require('@tabler/icons/icons/repeat.svg'), - status: require('@tabler/icons/icons/home.svg'), + status: require('@tabler/icons/icons/bell-ringing.svg'), poll: require('@tabler/icons/icons/chart-bar.svg'), move: require('@tabler/icons/icons/briefcase.svg'), 'pleroma:chat_mention': require('@tabler/icons/icons/messages.svg'), From 47d1a8e5d6be49f2365c8da7fdd31e0b311568cc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 4 May 2022 12:08:17 -0500 Subject: [PATCH 3/4] ActionBar: fix repost active state, fixes #936 --- app/soapbox/components/status_action_bar.tsx | 2 +- .../features/status/components/action-bar.tsx | 76 ++++++++----------- 2 files changed, 34 insertions(+), 44 deletions(-) diff --git a/app/soapbox/components/status_action_bar.tsx b/app/soapbox/components/status_action_bar.tsx index 3737edfd88..d07fb94c03 100644 --- a/app/soapbox/components/status_action_bar.tsx +++ b/app/soapbox/components/status_action_bar.tsx @@ -636,7 +636,7 @@ class StatusActionBar extends ImmutablePureComponent - {features.quotePosts && me ? ( + {(features.quotePosts && me) ? ( { const reblog_disabled = (status.get('visibility') === 'direct' || status.get('visibility') === 'private'); - let reblogButton; + const reblogMenu: Menu = [{ + text: intl.formatMessage(status.reblogged ? messages.cancel_reblog_private : messages.reblog), + action: this.handleReblogClick, + icon: require('@tabler/icons/icons/repeat.svg'), + }, { + text: intl.formatMessage(messages.quotePost), + action: this.handleQuoteClick, + icon: require('@tabler/icons/icons/quote.svg'), + }]; - if (me && features.quotePosts) { - const reblogMenu: Menu = [ - { - text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog), - action: this.handleReblogClick, - icon: require('@tabler/icons/icons/repeat.svg'), - }, - { - text: intl.formatMessage(messages.quotePost), - action: this.handleQuoteClick, - icon: require('@tabler/icons/icons/quote.svg'), - }, - ]; - - reblogButton = ( - - ); - } else { - reblogButton = ( - - ); - } + const reblogButton = ( + + ); return ( @@ -576,7 +556,17 @@ class ActionBar extends React.PureComponent { text={intl.formatMessage(messages.reply)} /> - {reblogButton} + {(features.quotePosts && me) ? ( + + {reblogButton} + + ) : ( + reblogButton + )} {features.emojiReacts ? ( From c00b5f747692c9b743e4fa7b1999efa502188752 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 4 May 2022 13:08:49 -0500 Subject: [PATCH 4/4] ProfilePage: fix tabs (fixes #927), redirect wrong case username --- app/soapbox/pages/profile_page.tsx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/app/soapbox/pages/profile_page.tsx b/app/soapbox/pages/profile_page.tsx index 5cf8bee21d..e1691e14b6 100644 --- a/app/soapbox/pages/profile_page.tsx +++ b/app/soapbox/pages/profile_page.tsx @@ -27,23 +27,22 @@ interface IProfilePage { }, } +/** Page to display a user's profile. */ const ProfilePage: React.FC = ({ params, children }) => { const history = useHistory(); + const username = params?.username || ''; - const { accountId, account, accountUsername, realAccount } = useAppSelector(state => { - const username = params?.username || ''; + const { accountId, account, realAccount } = useAppSelector(state => { const { accounts } = state; const accountFetchError = (((state.accounts.getIn([-1, 'username']) || '') as string).toLowerCase() === username.toLowerCase()); let accountId: string | -1 | null = -1; let account = null; - let accountUsername = username; if (accountFetchError) { accountId = null; } else { account = findAccountByUsername(state, username); accountId = account ? account.id : -1; - accountUsername = account ? account.acct : ''; } let realAccount; @@ -57,7 +56,6 @@ const ProfilePage: React.FC = ({ params, children }) => { return { account: typeof accountId === 'string' ? getAccount(state, accountId) : account, accountId, - accountUsername, realAccount, }; }); @@ -66,24 +64,30 @@ const ProfilePage: React.FC = ({ params, children }) => { const features = useFeatures(); const { displayFqn } = useSoapboxConfig(); + // Redirect from a user ID if (realAccount) { return ; } + // Fix case of username + if (account && account.acct !== username) { + return ; + } + const tabItems = [ { text: , - to: `/@${accountUsername}`, + to: `/@${username}`, name: 'profile', }, { text: , - to: `/@${accountUsername}/with_replies`, + to: `/@${username}/with_replies`, name: 'replies', }, { text: , - to: `/@${accountUsername}/media`, + to: `/@${username}/media`, name: 'media', }, ]; @@ -100,14 +104,14 @@ const ProfilePage: React.FC = ({ params, children }) => { } let activeItem; - const pathname = history.location.pathname.replace(`@${accountUsername}/`, ''); + const pathname = history.location.pathname.replace(`@${username}/`, ''); if (pathname.includes('with_replies')) { activeItem = 'replies'; } else if (pathname.includes('media')) { activeItem = 'media'; } else if (pathname.includes('favorites')) { activeItem = 'likes'; - } else if (pathname === `/@${accountUsername}`) { + } else { activeItem = 'profile'; } @@ -117,13 +121,13 @@ const ProfilePage: React.FC = ({ params, children }) => {
{/* @ts-ignore */} - + - {Component => } + {Component => } - {account && activeItem && ( + {account && ( )}