1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

01 no shared Wiki tip (#7540)

This commit is contained in:
Michael An
2025-03-03 17:05:39 +08:00
committed by GitHub
parent c9b82c70cd
commit a5dbce0f8b
3 changed files with 11 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ const propTypes = {
toggleAddWikiDialog: PropTypes.func,
sidePanelRate: PropTypes.number,
isSidePanelFolded: PropTypes.bool,
noItemsTip: PropTypes.string,
};
class WikiCardGroup extends Component {
@@ -51,7 +52,7 @@ class WikiCardGroup extends Component {
};
render() {
const { wikis, title, isDepartment, toggleAddWikiDialog, group } = this.props;
const { wikis, title, isDepartment, toggleAddWikiDialog, group, noItemsTip } = this.props;
const containerWidth = this.getContainerWidth();
const numberOfWiki = Math.floor(containerWidth / 180);
const grids = (Math.floor((containerWidth - (numberOfWiki + 1) * 16) / numberOfWiki) + 'px ').repeat(numberOfWiki);
@@ -67,6 +68,9 @@ class WikiCardGroup extends Component {
<span className={`sf3-font nav-icon sf3-font-${(isDepartment && depIcon) ? 'department' : isDepartment ? 'group' : 'mine'}`} aria-hidden="true"></span>
{title}
</h4>
{(wikis.length === 0 && noItemsTip) &&
<div className="wiki-card-group-no-tip my-4">{noItemsTip}</div>
}
<div className='wiki-card-group-items' style={{ gridTemplateColumns: isMobile ? '48% 48%' : grids }} ref={this.groupItemsRef}>
{wikis.map((wiki, index) => {
return (isGroup ?

View File

@@ -2,6 +2,11 @@
margin: 16px 0 10px;
}
.wiki-card-group .wiki-card-group-no-tip {
color: #666;
text-align: center;
}
.wiki-card-group-items {
display: grid;
gap: 16px 16px;

View File

@@ -104,6 +104,7 @@ class WikiCardView extends Component {
sidePanelRate={sidePanelRate}
isSidePanelFolded={isSidePanelFolded}
toggleAddWikiDialog={null}
noItemsTip={gettext('No shared Wikis')}
/>
);
for (let i = 0; i < groupWikis.length; i++) {