From bcb4edc85f47e0fbc2d50c7f954eb6598e3002a4 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Thu, 31 Jan 2019 01:26:10 -0200 Subject: [PATCH] Remove [bot] from issue/pr author username --- .../cards/partials/rows/IssueOrPullRequestRow.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx b/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx index fcebe018..faba39cb 100644 --- a/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx +++ b/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx @@ -68,12 +68,15 @@ export const IssueOrPullRequestRow = React.memo( title: _title, url, userLinkURL, - username, + username: _username, } = props const title = trimNewLinesAndSpaces(_title) if (!title) return null + const isBot = Boolean(_username && _username.indexOf('[bot]') >= 0) + const username = isBot ? _username.replace('[bot]', '') : _username + const byText = username ? `@${username}` : '' return ( @@ -92,7 +95,7 @@ export const IssueOrPullRequestRow = React.memo( {Boolean(username) && ( = 0)} + isBot={isBot} linkURL={userLinkURL} small style={cardStyles.avatar}