mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
revert browser newux changes (#5714)
This commit is contained in:
@@ -19,23 +19,37 @@ import { connect } from "react-redux"
|
||||
import humanize from "humanize"
|
||||
import Moment from "moment"
|
||||
import ObjectItem from "./ObjectItem"
|
||||
import ObjectActions from "./ObjectActions"
|
||||
import * as actionsObjects from "./actions"
|
||||
import { getCheckedList } from "./selectors"
|
||||
|
||||
export const ObjectContainer = ({ object, downloadObject }) => {
|
||||
export const ObjectContainer = ({
|
||||
object,
|
||||
checkedObjectsCount,
|
||||
downloadObject
|
||||
}) => {
|
||||
let props = {
|
||||
name: object.name,
|
||||
contentType: object.contentType,
|
||||
size: humanize.filesize(object.size),
|
||||
lastModified: Moment(object.lastModified).format("lll")
|
||||
}
|
||||
if (checkedObjectsCount == 0) {
|
||||
props.actionButtons = <ObjectActions object={object} />
|
||||
}
|
||||
return <ObjectItem {...props} onClick={() => downloadObject(object.name)} />
|
||||
}
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
checkedObjectsCount: getCheckedList(state).length
|
||||
}
|
||||
}
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
downloadObject: object => dispatch(actionsObjects.downloadObject(object))
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(undefined, mapDispatchToProps)(ObjectContainer)
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(ObjectContainer)
|
||||
|
||||
Reference in New Issue
Block a user