@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
46 lines (44 loc) • 1.31 kB
JavaScript
import React from 'react';
import { defaultProps } from "./props/defaultProps";
import { propTypes } from "./props/propTypes";
import style from "./Views.module.css";
import { Icon } from '@zohodesk/icons';
export default class Views extends React.Component {
constructor(props) {
super(props);
}
render() {
let {
isGrid,
isList,
gridTitle,
listTitle,
onListClick,
onGridClick
} = this.props;
return /*#__PURE__*/React.createElement("span", {
className: style.container
}, /*#__PURE__*/React.createElement("span", {
className: `${style.icon} ${style.first} ${isList ? style.active : ''}`,
"data-title": !isList ? listTitle : null,
onClick: onListClick
}, /*#__PURE__*/React.createElement(Icon, {
name: "ZD-list22",
size: "10"
})), /*#__PURE__*/React.createElement("span", {
className: `${style.icon} ${style.last} ${isGrid ? style.active : ''}`,
"data-title": !isGrid ? gridTitle : null,
onClick: onGridClick
}, /*#__PURE__*/React.createElement(Icon, {
name: "ZD-grid",
size: "11"
})));
}
}
Views.propTypes = propTypes;
Views.defaultProps = defaultProps; // if (__DOCS__) {
// Views.docs = {
// componentGroup: 'Header',
// folderName: 'Setup'
// };
// }