Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ed5fb8e

Browse files
committedFeb 28, 2022
style: update preview style.
1 parent 8ae133f commit ed5fb8e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎src/pages/Preview/DirectoryTrees.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function MeunItemView(props: { path?: string; filepath?: string; size?: number }
6060
{...menuProps}
6161
text={props.filepath!.replace(/^\//, '')}
6262
/>
63-
),
63+
),
6464
// eslint-disable-next-line react-hooks/exhaustive-deps
6565
[props.path, props.size, props.filepath],
6666
);
@@ -74,7 +74,7 @@ export default function DirectoryTrees() {
7474
pkgname: global.pkgname,
7575
}));
7676

77-
const pathname = location.pathname.replace(new RegExp(`/pkg/${pkgname}/file`), '')
77+
const pathname = location.pathname.replace(new RegExp(`/pkg/${pkgname}/file`), '');
7878

7979
function renderMenuItem(data: Files[] = [], menuItems: any = []) {
8080
data.forEach((item, idx) => {
@@ -85,7 +85,7 @@ export default function DirectoryTrees() {
8585
key={idx}
8686
icon="folder"
8787
overlayProps={{
88-
isOpen: collapse
88+
isOpen: collapse,
8989
}}
9090
style={{ color: '#1d64ce' }}
9191
text={item.path.replace(/^\//, '').replace(/(.+?).\//g, '')}

‎src/pages/Preview/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function Preview() {
5656
size="small"
5757
type="link"
5858
onClick={() => dispatch.global.update({ showSearch: true })}
59-
style={{ fontSize: 21 }}
59+
style={{ fontSize: 21, whiteSpace: 'nowrap' }}
6060
>
6161
{Info && Info.name ? `${Info.name}@${Info.version}` : path.pkgName}
6262
</Button>
@@ -128,7 +128,9 @@ export default function Preview() {
128128
{Info.description && (
129129
<Fragment>
130130
<Divider type="vertical" />
131-
<span title={Info.description}>{Info.description}</span>
131+
<span title={Info.description} style={{ flex: 1, whiteSpace: 'nowrap', overflow: 'hidden' }}>
132+
{Info.description}
133+
</span>
132134
</Fragment>
133135
)}
134136
</Fragment>

1 commit comments

Comments
 (1)

vercel[bot] commented on Feb 28, 2022

@vercel[bot]
Please sign in to comment.