From 8184b8699e4fa675326408e10c8f227440d62b35 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Fri, 4 Jun 2021 23:31:56 +0800 Subject: [PATCH] chore: align comment amount --- src/components/FileExplorer.tsx | 2 +- src/platforms/GitHub/index.ts | 4 +--- src/styles/index.scss | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/FileExplorer.tsx b/src/components/FileExplorer.tsx index 923dff2..4307d8d 100644 --- a/src/components/FileExplorer.tsx +++ b/src/components/FileExplorer.tsx @@ -109,7 +109,7 @@ const RawFileExplorer: React.FC = function RawFileExplor node.comments !== undefined && node.comments > 0 && ( - {node.comments} + {node.comments > 9 ? '9+' : node.comments} ) diff --git a/src/platforms/GitHub/index.ts b/src/platforms/GitHub/index.ts index 159d1b1..8af9ae4 100644 --- a/src/platforms/GitHub/index.ts +++ b/src/platforms/GitHub/index.ts @@ -70,9 +70,7 @@ function getUrlForRedirect( // Modern browsers have great support for handling unsafe URL, // It may be possible to sanitize path with // `path => path.includes('#') ? path.replace(/#/g, '%23') : '...' - return `https://${ - window.location.host - }/${userName}/${repoName}/${type}/${branchName}/${path + return `https://${window.location.host}/${userName}/${repoName}/${type}/${branchName}/${path .split('/') .map(encodeURIComponent) .join('/')}` diff --git a/src/styles/index.scss b/src/styles/index.scss index ecd8320..374b9cd 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -605,6 +605,8 @@ $minimal-z-index: max($github-header-z-index, $github-pull-request-float-header- } .node-item-comment { + display: inline-block; + width: 48px; padding: 0 4px; color: var(--gitako-text-tertiary);