mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 01:44:13 +00:00
01 no shared Wiki tip (#7540)
This commit is contained in:
@@ -18,6 +18,7 @@ const propTypes = {
|
|||||||
toggleAddWikiDialog: PropTypes.func,
|
toggleAddWikiDialog: PropTypes.func,
|
||||||
sidePanelRate: PropTypes.number,
|
sidePanelRate: PropTypes.number,
|
||||||
isSidePanelFolded: PropTypes.bool,
|
isSidePanelFolded: PropTypes.bool,
|
||||||
|
noItemsTip: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
class WikiCardGroup extends Component {
|
class WikiCardGroup extends Component {
|
||||||
@@ -51,7 +52,7 @@ class WikiCardGroup extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { wikis, title, isDepartment, toggleAddWikiDialog, group } = this.props;
|
const { wikis, title, isDepartment, toggleAddWikiDialog, group, noItemsTip } = this.props;
|
||||||
const containerWidth = this.getContainerWidth();
|
const containerWidth = this.getContainerWidth();
|
||||||
const numberOfWiki = Math.floor(containerWidth / 180);
|
const numberOfWiki = Math.floor(containerWidth / 180);
|
||||||
const grids = (Math.floor((containerWidth - (numberOfWiki + 1) * 16) / numberOfWiki) + 'px ').repeat(numberOfWiki);
|
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>
|
<span className={`sf3-font nav-icon sf3-font-${(isDepartment && depIcon) ? 'department' : isDepartment ? 'group' : 'mine'}`} aria-hidden="true"></span>
|
||||||
{title}
|
{title}
|
||||||
</h4>
|
</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}>
|
<div className='wiki-card-group-items' style={{ gridTemplateColumns: isMobile ? '48% 48%' : grids }} ref={this.groupItemsRef}>
|
||||||
{wikis.map((wiki, index) => {
|
{wikis.map((wiki, index) => {
|
||||||
return (isGroup ?
|
return (isGroup ?
|
||||||
|
@@ -2,6 +2,11 @@
|
|||||||
margin: 16px 0 10px;
|
margin: 16px 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wiki-card-group .wiki-card-group-no-tip {
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.wiki-card-group-items {
|
.wiki-card-group-items {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 16px 16px;
|
gap: 16px 16px;
|
||||||
|
@@ -104,6 +104,7 @@ class WikiCardView extends Component {
|
|||||||
sidePanelRate={sidePanelRate}
|
sidePanelRate={sidePanelRate}
|
||||||
isSidePanelFolded={isSidePanelFolded}
|
isSidePanelFolded={isSidePanelFolded}
|
||||||
toggleAddWikiDialog={null}
|
toggleAddWikiDialog={null}
|
||||||
|
noItemsTip={gettext('No shared Wikis')}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
for (let i = 0; i < groupWikis.length; i++) {
|
for (let i = 0; i < groupWikis.length; i++) {
|
||||||
|
Reference in New Issue
Block a user