Skip to content
Snippets Groups Projects
Commit f6108ddb authored by vkovtun's avatar vkovtun
Browse files

SSDM-13579: Added default icons for files and folders.

parent 6a502143
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -6,12 +6,6 @@ import ListView from '@src/js/components/database/data-browser/ListView.jsx'
import GridView from '@src/js/components/database/data-browser/GridView.jsx'
const styles = theme => ({
containerDefault: {
padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`
},
containerSquare: {
padding: `${theme.spacing(2)}px ${theme.spacing(2)}px`
},
boundary: {
padding: theme.spacing(1),
borderWidth: '2px',
......
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Container from '@src/js/components/common/form/Container.jsx'
import FolderIcon from '@material-ui/icons/FolderOpen'
import FileIcon from '@material-ui/icons/DescriptionOutlined'
import autoBind from 'auto-bind'
const styles = theme => ({
containerDefault: {
padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`
},
containerSquare: {
padding: `${theme.spacing(2)}px ${theme.spacing(2)}px`
},
content: {
width: '100%'
width: '100%',
fontFamily: theme.typography.fontFamily,
},
tableHeader: {
textAlign: 'left'
......@@ -29,6 +27,20 @@ const styles = theme => ({
})
class ListView extends React.Component {
constructor(props, context) {
super(props, context)
autoBind(this)
}
getIcon(file) {
if (file.folder) {
return <FolderIcon />
} else {
return <FileIcon />
}
}
render() {
const { classes, files } = this.props
/* Create strings in messages. */
......@@ -45,7 +57,7 @@ class ListView extends React.Component {
<tbody>
{files.map((file, index) =>
<tr key={index}>
<td className={classes.nameColumn}>{file.name}</td>
<td className={classes.nameColumn}>{<>{this.getIcon(file)} {file.name}</>}</td>
<td className={classes.sizeColumn}>{file.folder ? '-' : file.size}</td>
<td className={classes.modifiedColumn}>{file.lastModifiedTime.toLocaleString()}</td>
</tr>
......
......@@ -12,12 +12,6 @@ import InfoIcon from '@material-ui/icons/InfoOutlined'
import CreateNewFolderIcon from '@material-ui/icons/CreateNewFolderOutlined'
const styles = theme => ({
containerDefault: {
padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`
},
containerSquare: {
padding: `${theme.spacing(2)}px ${theme.spacing(2)}px`
}
})
class Toolbar extends React.Component {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment