-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* optimize_file_details * feat: optimize ui * feat: optimize ui * feat: optimize ui --------- Co-authored-by: zheng.shen <[email protected]> Co-authored-by: 杨国璇 <[email protected]>
- Loading branch information
1 parent
3cdb626
commit df29823
Showing
11 changed files
with
262 additions
and
19 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
frontend/src/components/dirent-detail/dirent-details/file-details/collapse/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.file-details-collapse { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
height: auto; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0 8px; | ||
height: 28px; | ||
width: 100%; | ||
border-radius: 3px; | ||
border: 1px solid rgba(69, 170, 242, 0); | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-header:hover { | ||
background-color: #F0F0F0; | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-header .file-details-collapse-header-title { | ||
flex: 1; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
cursor: default; | ||
color: #666; | ||
font-size: 14px; | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-header .file-details-collapse-header-operation { | ||
height: 20px; | ||
width: 20px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-left: 4px; | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-header .file-details-collapse-header-operation:hover { | ||
background-color: #DBDBDB; | ||
cursor: pointer; | ||
border-radius: 3px; | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-header .sf3-font-down { | ||
color: #666666; | ||
} | ||
|
||
.file-details-collapse .file-details-collapse-body { | ||
padding: 0 4px; | ||
} |
38 changes: 38 additions & 0 deletions
38
frontend/src/components/dirent-detail/dirent-details/file-details/collapse/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useState, useCallback } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
import './index.css'; | ||
|
||
const Collapse = ({ className, title, children, isCollapse = true }) => { | ||
const [showChildren, setShowChildren] = useState(isCollapse); | ||
|
||
const toggleShowChildren = useCallback(() => { | ||
setShowChildren(!showChildren); | ||
}, [showChildren]); | ||
|
||
return ( | ||
<div className={classnames('file-details-collapse', className)}> | ||
<div className="file-details-collapse-header"> | ||
<div className="file-details-collapse-header-title">{title}</div> | ||
<div className="file-details-collapse-header-operation" onClick={toggleShowChildren}> | ||
<i className={`sf3-font sf3-font-down ${showChildren ? '' : 'rotate-90'}`}></i> | ||
</div> | ||
</div> | ||
{showChildren && ( | ||
<div className="file-details-collapse-body"> | ||
{children} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
Collapse.propTypes = { | ||
isCollapse: PropTypes.bool, | ||
className: PropTypes.string, | ||
title: PropTypes.string, | ||
children: PropTypes.any, | ||
}; | ||
|
||
export default Collapse; |
20 changes: 20 additions & 0 deletions
20
frontend/src/components/dirent-detail/dirent-details/file-details/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.sf-metadata-property-detail-capture-information-item .dirent-detail-item-name { | ||
font-size: 12px; | ||
min-height: 24px; | ||
padding: 3px 6px; | ||
word-break: break-all; | ||
} | ||
|
||
.sf-metadata-property-detail-capture-information-item .dirent-detail-item-value { | ||
font-size: 12px; | ||
min-height: 24px; | ||
padding: 3px 6px; | ||
display: block; | ||
word-break: break-all; | ||
} | ||
|
||
.sf-metadata-property-detail-capture-information-item .dirent-detail-item-value:empty::before { | ||
content: attr(placeholder); | ||
color: #666; | ||
font-size: 12px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters