Browser: Update UI with new components and elements (#5671)

This commit is contained in:
Rushan
2018-03-21 23:39:23 +05:30
committed by Harshavardhana
parent 384b4fdf28
commit 1459c4be1e
199 changed files with 10549 additions and 4702 deletions

View File

@@ -25,11 +25,11 @@ import { getPrefixWritable } from "../objects/selectors"
export const MainActions = ({
prefixWritable,
uploadFile,
showMakeBucketModal
showMakeBucketModal,
}) => {
const uploadTooltip = <Tooltip id="tt-upload-file">Upload file</Tooltip>
const uploadTooltip = <Tooltip id="tooltip-upload-file">Upload file</Tooltip>
const makeBucketTooltip = (
<Tooltip id="tt-create-bucket">Create bucket</Tooltip>
<Tooltip id="tooltip-create-bucket">Create bucket</Tooltip>
)
const onFileUpload = e => {
e.preventDefault()
@@ -41,15 +41,20 @@ export const MainActions = ({
if (loggedIn || prefixWritable) {
return (
<Dropdown dropup className="feb-actions" id="fe-action-toggle">
<Dropdown.Toggle noCaret className="feba-toggle">
<span>
<i className="fa fa-plus" />
</span>
<Dropdown
dropup
pullRight
className="create"
id="main-actions"
componentClass="div"
>
<Dropdown.Toggle noCaret className="create__toggle" useAnchor={true}>
<i className="zmdi zmdi-plus" />
<i className="zmdi zmdi-close" />
</Dropdown.Toggle>
<Dropdown.Menu>
<OverlayTrigger placement="left" overlay={uploadTooltip}>
<a href="#" className="feba-btn feba-upload">
<a href="#" className="create__btn create__btn--upload">
<input
type="file"
onChange={onFileUpload}
@@ -57,8 +62,7 @@ export const MainActions = ({
id="file-input"
/>
<label htmlFor="file-input">
{" "}
<i className="fa fa-cloud-upload" />{" "}
<i className="zmdi zmdi-upload" />
</label>
</a>
</OverlayTrigger>
@@ -67,14 +71,12 @@ export const MainActions = ({
<a
href="#"
id="show-make-bucket"
className="feba-btn feba-bucket"
className="create__btn create__btn--bucket"
onClick={e => {
e.preventDefault()
showMakeBucketModal()
}}
>
<i className="fa fa-hdd-o" />
</a>
/>
</OverlayTrigger>
)}
</Dropdown.Menu>
@@ -87,14 +89,14 @@ export const MainActions = ({
const mapStateToProps = state => {
return {
prefixWritable: getPrefixWritable(state)
prefixWritable: getPrefixWritable(state),
}
}
const mapDispatchToProps = dispatch => {
return {
uploadFile: file => dispatch(uploadsActions.uploadFile(file)),
showMakeBucketModal: () => dispatch(actionsBuckets.showMakeBucketModal())
showMakeBucketModal: () => dispatch(actionsBuckets.showMakeBucketModal()),
}
}