mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
[dir view] redesigned 'tip for new file', supported mobile (#4034)
This commit is contained in:
@@ -5,7 +5,7 @@ import Loading from '../loading';
|
|||||||
import ModalPortal from '../modal-portal';
|
import ModalPortal from '../modal-portal';
|
||||||
import CreateFile from '../../components/dialog/create-file-dialog';
|
import CreateFile from '../../components/dialog/create-file-dialog';
|
||||||
|
|
||||||
import '../../css/tip-for-new-md.css';
|
import '../../css/tip-for-new-file.css';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
path: PropTypes.string.isRequired,
|
path: PropTypes.string.isRequired,
|
||||||
@@ -53,23 +53,18 @@ class DirentNodeView extends React.Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className="tip-for-new-file">
|
<div className="tip-for-new-file text-center">
|
||||||
<p className="text-center">{gettext('This folder has no content at this time.')}</p>
|
<p className="text-secondary">{gettext('This folder has no content at this time.')}</p>
|
||||||
<p className="text-center">{gettext('You can create files quickly')}{' +'}</p>
|
<p className="text-secondary">{gettext('You can create files quickly')}{' +'}</p>
|
||||||
<div className="big-new-file-button-group">
|
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.md')}>
|
||||||
<div className="d-flex justify-content-center">
|
{'+ Markdown'}</button>
|
||||||
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.md')}>
|
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.pptx')}>
|
||||||
{'+ Markdown'}</button>
|
{'+ PPT'}</button>
|
||||||
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.pptx')}>
|
<br />
|
||||||
{'+ PPT'}</button>
|
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.docx')}>
|
||||||
</div>
|
{'+ Word'}</button>
|
||||||
<div className="d-flex justify-content-center">
|
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.xlsx')}>
|
||||||
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.docx')}>
|
{'+ Excel'}</button>
|
||||||
{'+ Word'}</button>
|
|
||||||
<button className="big-new-file-button" onClick={this.onCreateNewFile.bind(this, '.xlsx')}>
|
|
||||||
{'+ Excel'}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{this.state.isCreateFileDialogShow && (
|
{this.state.isCreateFileDialogShow && (
|
||||||
<ModalPortal>
|
<ModalPortal>
|
||||||
|
@@ -1,23 +1,24 @@
|
|||||||
.tip-for-new-file {
|
.tip-for-new-file {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 5em 8em;
|
padding: 2em 1em;
|
||||||
align-self: flex-start; /* for repo wiki mode */
|
align-self: flex-start; /* for repo wiki mode */
|
||||||
}
|
}
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.tip-for-new-file {
|
||||||
|
padding: 5em 8em;
|
||||||
|
}
|
||||||
|
}
|
||||||
.big-new-file-button {
|
.big-new-file-button {
|
||||||
padding: .9em 2em 1em;
|
padding: .9em 2em 1em;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin: 0 1.5em 1.5em 0;
|
margin: 0 0.75em 1.5em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 160px;
|
width: 160px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #d1d1d1;
|
||||||
}
|
}
|
||||||
.big-new-file-button:hover,
|
.big-new-file-button:hover,
|
||||||
.big-new-file-button:focus {
|
.big-new-file-button:focus {
|
||||||
border-color: #eb9205;
|
border-color: #eb9205;
|
||||||
color: #eb8205;
|
color: #eb8205;
|
||||||
}
|
}
|
||||||
.tip-for-new-file p {
|
|
||||||
color: #c4c4c4;
|
|
||||||
}
|
|
||||||
.big-new-file-button-group {
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
Reference in New Issue
Block a user