mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-11 03:41:12 +00:00
@@ -1,11 +1,13 @@
|
|||||||
import React from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ModalPortal from './modal-portal';
|
||||||
import { Link } from '@gatsbyjs/reach-router';
|
import { Link } from '@gatsbyjs/reach-router';
|
||||||
import { gettext, siteRoot, canInvitePeople, enableTC, sideNavFooterCustomHtml,
|
import { gettext, siteRoot, canInvitePeople, enableTC, sideNavFooterCustomHtml,
|
||||||
isDocs, isPro, isDBSqlite3, customNavItems, mediaUrl, curNoteMsg } from '../utils/constants';
|
isDocs, isPro, isDBSqlite3, customNavItems, mediaUrl, curNoteMsg } from '../utils/constants';
|
||||||
import { SIDE_PANEL_FOLDED_WIDTH, SUB_NAV_ITEM_HEIGHT } from '../constants';
|
import { SIDE_PANEL_FOLDED_WIDTH, SUB_NAV_ITEM_HEIGHT } from '../constants';
|
||||||
import Tip from './side-nav-icon-tip';
|
import Tip from './side-nav-icon-tip';
|
||||||
import FilesSubNav from '../components/files-sub-nav';
|
import FilesSubNav from '../components/files-sub-nav';
|
||||||
|
import AboutDialog from './dialog/about-dialog';
|
||||||
import { seafileAPI } from '../utils/seafile-api';
|
import { seafileAPI } from '../utils/seafile-api';
|
||||||
import { Utils } from '../utils/utils';
|
import { Utils } from '../utils/utils';
|
||||||
import Group from '../models/group';
|
import Group from '../models/group';
|
||||||
@@ -28,7 +30,8 @@ class MainSideNavFolded extends React.Component {
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
groupItems: [],
|
groupItems: [],
|
||||||
isFilesSubNavShown: false
|
isFilesSubNavShown: false,
|
||||||
|
isAboutDialogShow: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,10 +95,16 @@ class MainSideNavFolded extends React.Component {
|
|||||||
return this.props.currentTab === tab ? 'active' : '';
|
return this.props.currentTab === tab ? 'active' : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
toggleAboutDialog = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
this.setState({ isAboutDialogShow: !this.state.isAboutDialogShow });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let showActivity = isDocs || isPro || !isDBSqlite3;
|
let showActivity = isDocs || isPro || !isDBSqlite3;
|
||||||
const { groupItems, isFilesSubNavShown } = this.state;
|
const { groupItems, isFilesSubNavShown } = this.state;
|
||||||
return (
|
return (
|
||||||
|
<Fragment>
|
||||||
<div className='side-nav-folded-container h-100 position-relative'>
|
<div className='side-nav-folded-container h-100 position-relative'>
|
||||||
{/* FOLDED SIDE NAV FILES */}
|
{/* FOLDED SIDE NAV FILES */}
|
||||||
<div className="side-nav side-nav-folded position-relative" style={{ zIndex: FOLDED_SIDE_NAV_FILES }}>
|
<div className="side-nav side-nav-folded position-relative" style={{ zIndex: FOLDED_SIDE_NAV_FILES }}>
|
||||||
@@ -221,6 +230,12 @@ class MainSideNavFolded extends React.Component {
|
|||||||
<Tip target="main-side-nav-folded-clients" text={gettext('Clients')} />
|
<Tip target="main-side-nav-folded-clients" text={gettext('Clients')} />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li className='nav-item'>
|
||||||
|
<a href="#" className="nav-link" onClick={this.toggleAboutDialog}>
|
||||||
|
<span className="sf3-font-about sf3-font mr-0" aria-hidden="true" id="main-side-nav-folded-about"></span>
|
||||||
|
<Tip target="main-side-nav-folded-about" text={gettext('About')} />
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
<div
|
<div
|
||||||
@@ -232,6 +247,12 @@ class MainSideNavFolded extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{this.state.isAboutDialogShow && (
|
||||||
|
<ModalPortal>
|
||||||
|
<AboutDialog onCloseAboutDialog={this.toggleAboutDialog} />
|
||||||
|
</ModalPortal>
|
||||||
|
)}
|
||||||
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React, { Fragment } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import ModalPortal from './modal-portal';
|
||||||
import { Link } from '@gatsbyjs/reach-router';
|
import { Link } from '@gatsbyjs/reach-router';
|
||||||
import {
|
import {
|
||||||
gettext, siteRoot, canAddGroup, canAddRepo, canShareRepo,
|
gettext, siteRoot, canAddGroup, canAddRepo, canShareRepo,
|
||||||
@@ -12,6 +13,7 @@ import { Utils } from '../utils/utils';
|
|||||||
import Group from '../models/group';
|
import Group from '../models/group';
|
||||||
import toaster from './toast';
|
import toaster from './toast';
|
||||||
import CreateGroupDialog from '../components/dialog/create-group-dialog';
|
import CreateGroupDialog from '../components/dialog/create-group-dialog';
|
||||||
|
import AboutDialog from './dialog/about-dialog';
|
||||||
import FilesSubNav from '../components/files-sub-nav';
|
import FilesSubNav from '../components/files-sub-nav';
|
||||||
import { SUB_NAV_ITEM_HEIGHT } from '../constants';
|
import { SUB_NAV_ITEM_HEIGHT } from '../constants';
|
||||||
|
|
||||||
@@ -27,6 +29,7 @@ class MainSideNav extends React.Component {
|
|||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
filesNavUnfolded: false,
|
filesNavUnfolded: false,
|
||||||
|
isAboutDialogShow: false,
|
||||||
sharedExtended: false,
|
sharedExtended: false,
|
||||||
groupItems: [],
|
groupItems: [],
|
||||||
isCreateGroupDialogOpen: false,
|
isCreateGroupDialogOpen: false,
|
||||||
@@ -200,10 +203,16 @@ class MainSideNav extends React.Component {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
toggleAboutDialog = (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
this.setState({ isAboutDialogShow: !this.state.isAboutDialogShow });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let showActivity = isDocs || isPro || !isDBSqlite3;
|
let showActivity = isDocs || isPro || !isDBSqlite3;
|
||||||
const { filesNavUnfolded, groupItems } = this.state;
|
const { filesNavUnfolded, groupItems } = this.state;
|
||||||
return (
|
return (
|
||||||
|
<Fragment>
|
||||||
<div className="side-nav">
|
<div className="side-nav">
|
||||||
<div className={'side-nav-con d-flex flex-column'}>
|
<div className={'side-nav-con d-flex flex-column'}>
|
||||||
<h2 className="mb-2 px-2 font-weight-normal heading">{gettext('Workspace')}</h2>
|
<h2 className="mb-2 px-2 font-weight-normal heading">{gettext('Workspace')}</h2>
|
||||||
@@ -288,17 +297,27 @@ class MainSideNav extends React.Component {
|
|||||||
<span className="nav-text">{gettext('Clients')}</span>
|
<span className="nav-text">{gettext('Clients')}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li className='nav-item'>
|
||||||
|
<a href="#" className="nav-link" onClick={this.toggleAboutDialog}>
|
||||||
|
<span className="sf3-font-about sf3-font" aria-hidden="true"></span>
|
||||||
|
<span className="nav-text">{gettext('About')}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className="side-nav-bottom-toolbar d-none d-md-flex mt-auto px-2 rounded flex-shrink-0 align-items-center" onClick={this.props.toggleFoldSideNav}>
|
<div className="side-nav-bottom-toolbar d-none d-md-flex mt-auto px-2 rounded flex-shrink-0 align-items-center" onClick={this.props.toggleFoldSideNav}>
|
||||||
<img className="mr-2" src={`${mediaUrl}img/close-sidebar.svg`} width="20" alt="" />
|
<img className="mr-2" src={`${mediaUrl}img/close-sidebar.svg`} width="20" alt="" />
|
||||||
<span>{gettext('Fold the sidebar')}</span>
|
<span>{gettext('Fold the sidebar')}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{this.state.isAboutDialogShow && (
|
||||||
|
<ModalPortal>
|
||||||
|
<AboutDialog onCloseAboutDialog={this.toggleAboutDialog} />
|
||||||
|
</ModalPortal>
|
||||||
|
)}
|
||||||
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user