DocSpace-buildtools/packages/asc-web-common/components/MediaViewer/sub-components/scroll-button.js

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-01-28 13:44:58 +00:00
import { Base } from "@appserver/components/themes";
import React from "react";
import styled from "styled-components";
const ScrollButton = styled.div`
2022-01-28 13:44:58 +00:00
cursor: ${(props) => (props.inactive ? "default" : "pointer")};
opacity: ${(props) => (props.inactive ? "0.2" : "1")};
2021-05-06 09:52:19 +00:00
z-index: 305;
position: fixed;
top: calc(50% - 20px);
background: none;
2022-01-28 13:44:58 +00:00
${(props) => (props.orientation != "left" ? "left: 20px;" : "right: 20px;")}
width: 40px;
height: 40px;
2022-01-28 13:44:58 +00:00
background-color: ${(props) =>
props.theme.mediaViewer.scrollButton.backgroundColor};
border-radius: 50%;
&:hover {
background-color: ${(props) =>
!props.inactive && props.theme.mediaViewer.scrollButton.background};
}
&:before {
2022-01-28 13:44:58 +00:00
content: "";
top: 12px;
2022-01-28 13:44:58 +00:00
left: ${(props) => (props.orientation == "left" ? "9px;" : "15px;")};
position: absolute;
border: ${(props) => props.theme.mediaViewer.scrollButton.border};
border-width: 0 2px 2px 0;
display: inline-block;
padding: 7px;
2022-01-28 13:44:58 +00:00
transform: ${(props) =>
props.orientation == "left" ? "rotate(-45deg)" : "rotate(135deg)"};
-webkit-transform: ${(props) =>
2022-01-28 13:44:58 +00:00
props.orientation == "left" ? "rotate(-45deg)" : "rotate(135deg)"};
}
`;
ScrollButton.defaultProps = { theme: Base };
const MediaScrollButton = (props) => {
return <ScrollButton {...props} />;
};
export default MediaScrollButton;