@hackoregon/component-library
Version:
Official repo for Hack Oregon React component library
26 lines (24 loc) • 746 B
JavaScript
import PropTypes from "prop-types";
import React from "react";
import Icon from "../Icon/Icon";
var hashToGoToTop = "#site-header";
var styles = {
display: "flex",
flexDirection: "column",
textAlign: "center"
};
var ScrollToTop = function ScrollToTop(_ref) {
var _ref$iconStyle = _ref.iconStyle,
iconStyle = _ref$iconStyle === void 0 ? null : _ref$iconStyle;
return React.createElement("div", null, React.createElement("a", {
style: styles,
href: hashToGoToTop
}, iconStyle && React.createElement(Icon, {
className: iconStyle
}), React.createElement("span", null, "Back to Top")));
};
ScrollToTop.displayName = "ScrollToTop";
ScrollToTop.propTypes = {
iconStyle: PropTypes.string
};
export default ScrollToTop;