Files
redash/client/app/components/SortIcon.jsx
Arik Fraimovich 56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00

34 lines
652 B
JavaScript

import React from "react";
import PropTypes from "prop-types";
import { react2angular } from "react2angular";
export function SortIcon({ column, sortColumn, reverse }) {
if (column !== sortColumn) {
return null;
}
return (
<span>
<i className={"fa fa-sort-" + (reverse ? "desc" : "asc")} />
</span>
);
}
SortIcon.propTypes = {
column: PropTypes.string,
sortColumn: PropTypes.string,
reverse: PropTypes.bool,
};
SortIcon.defaultProps = {
column: null,
sortColumn: null,
reverse: false,
};
export default function init(ngModule) {
ngModule.component("sortIcon", react2angular(SortIcon));
}
init.init = true;