@rcsb/rcsb-saguaro-app
Version:
RCSB 1D Saguaro Web App
20 lines • 1.38 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from "react";
import { Col, Container, Row } from "react-bootstrap";
import { Operator } from "../../../../RcsbUtils/Helpers/Operator";
export class Slider extends React.Component {
render() {
return (_jsxs("div", { className: "border", children: [_jsx(Container, { fluid: "md", children: _jsxs(Row, { className: "bg-secondary text-white", style: { height: 50 }, children: [_jsx(Col, { md: 2, className: "text-md-start my-auto", onClick: () => { this.slide("prev"); }, children: actionIcon("prev") }), _jsxs(Col, { className: "text-md-center my-auto", children: ["Member ", this.displayNumber(this.props.currentPage), " of ", this.displayNumber(this.props.pages)] }), _jsx(Col, { md: 2, className: "text-md-end my-auto", onClick: () => { this.slide("next"); }, children: actionIcon("next") })] }) }), _jsx("div", { children: this.props.children })] }));
}
slide(action) {
this.props.slide(action);
}
displayNumber(x) {
var _a;
return ((_a = this.props.displayNumber) !== null && _a !== void 0 ? _a : Operator.digitGrouping)(x);
}
}
export function actionIcon(action) {
return (_jsx("span", { style: { cursor: "pointer" }, className: "h1 user-select-none", children: action == "prev" ? "❮" : "❯" }));
}
//# sourceMappingURL=Slider.js.map