chore: align comment amount

This commit is contained in:
EnixCoda 2021-06-04 23:31:56 +08:00
parent 752f3066cf
commit 8184b8699e
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD
3 changed files with 4 additions and 4 deletions

View file

@ -109,7 +109,7 @@ const RawFileExplorer: React.FC<Props & ConnectorState> = function RawFileExplor
node.comments !== undefined &&
node.comments > 0 && (
<span className={'node-item-comment'}>
<Icon type={'comment'} /> {node.comments}
<Icon type={'comment'} /> {node.comments > 9 ? '9+' : node.comments}
</span>
)

View file

@ -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('/')}`

View file

@ -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);