2021-11-02 08:34:15 +00:00
|
|
|
import styled, { css } from "styled-components";
|
|
|
|
import Base from "../themes/base";
|
|
|
|
import DropDown from "../drop-down";
|
|
|
|
import DropDownItem from "../drop-down-item";
|
|
|
|
import FloatingButton from "@appserver/common/components/FloatingButton";
|
|
|
|
|
2022-01-31 13:42:59 +00:00
|
|
|
import { isMobileOnly } from "react-device-detect";
|
2022-01-27 09:14:55 +00:00
|
|
|
import { mobile } from "../utils/device";
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledFloatingButton = styled(FloatingButton)`
|
2022-01-27 09:14:55 +00:00
|
|
|
position: relative;
|
|
|
|
z-index: 1010;
|
2022-02-07 13:28:49 +00:00
|
|
|
background: ${(props) => props.theme.mainButtonMobile.buttonColor} !important;
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
.circle__mask + div {
|
2022-01-27 09:14:55 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2022-02-07 13:28:49 +00:00
|
|
|
|
|
|
|
background: ${(props) =>
|
|
|
|
props.theme.mainButtonMobile.buttonColor} !important;
|
|
|
|
|
2022-01-27 09:14:55 +00:00
|
|
|
div {
|
|
|
|
padding-top: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
${(props) =>
|
|
|
|
props.percent === 0 &&
|
|
|
|
css`
|
|
|
|
.circle__mask {
|
|
|
|
clip: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.circle__fill {
|
|
|
|
animation: none;
|
|
|
|
transform: none;
|
|
|
|
background: none !important;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
|
|
|
|
.circle__mask .circle__fill {
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.theme.mainButtonMobile.circleBackground};
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
2022-02-07 13:28:49 +00:00
|
|
|
|
|
|
|
svg {
|
|
|
|
path {
|
|
|
|
fill: ${(props) => props.theme.mainButtonMobile.iconFill};
|
|
|
|
}
|
|
|
|
}
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
2022-01-20 15:29:09 +00:00
|
|
|
StyledFloatingButton.defaultProps = { theme: Base };
|
2021-11-02 08:34:15 +00:00
|
|
|
|
2022-01-27 09:14:55 +00:00
|
|
|
const mobileDropDown = css`
|
|
|
|
width: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.width};
|
|
|
|
|
|
|
|
right: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.right};
|
|
|
|
bottom: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.bottom};
|
|
|
|
`;
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledDropDown = styled(DropDown)`
|
2022-01-27 09:14:55 +00:00
|
|
|
position: ${(props) => props.theme.mainButtonMobile.dropDown.position};
|
|
|
|
width: ${(props) => props.theme.mainButtonMobile.dropDown.width};
|
2022-04-25 10:21:14 +00:00
|
|
|
max-width: calc(100vw - 48px);
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
right: ${(props) => props.theme.mainButtonMobile.dropDown.right};
|
2022-01-27 09:14:55 +00:00
|
|
|
bottom: ${(props) => props.theme.mainButtonMobile.dropDown.bottom};
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
z-index: ${(props) => props.theme.mainButtonMobile.dropDown.zIndex};
|
2021-11-19 09:30:22 +00:00
|
|
|
height: ${(props) => (props.isMobile ? props.heightProp : "auto")};
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
padding: 0px;
|
|
|
|
|
2022-01-27 09:14:55 +00:00
|
|
|
@media ${mobile} {
|
|
|
|
${mobileDropDown}
|
|
|
|
}
|
|
|
|
|
2022-01-31 13:42:59 +00:00
|
|
|
${isMobileOnly && mobileDropDown}
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-19 09:30:22 +00:00
|
|
|
.section-scroll {
|
|
|
|
padding-right: 0px !important;
|
|
|
|
}
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
.separator-wrapper {
|
2022-01-27 09:14:55 +00:00
|
|
|
padding: 12px 24px;
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.is-separator {
|
2022-02-08 09:04:09 +00:00
|
|
|
height: 1px !important;
|
|
|
|
width: calc(100% - 48px);
|
|
|
|
padding: 0 !important;
|
|
|
|
margin: 12px 24px !important;
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.theme.mainButtonMobile.dropDown.separatorBackground};
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.drop-down-item-button {
|
2022-01-20 15:29:09 +00:00
|
|
|
color: ${(props) => props.theme.mainButtonMobile.dropDown.buttonColor};
|
2021-11-02 08:34:15 +00:00
|
|
|
|
|
|
|
svg {
|
|
|
|
path {
|
2022-01-20 15:29:09 +00:00
|
|
|
fill: ${(props) => props.theme.mainButtonMobile.dropDown.buttonColor};
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.theme.mainButtonMobile.dropDown.hoverButtonColor};
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.action-mobile-button {
|
|
|
|
width: 100%;
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.theme.mainButtonMobile.dropDown.backgroundActionMobile};
|
2021-11-02 08:34:15 +00:00
|
|
|
border-radius: 3px;
|
|
|
|
font-size: 13px;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-02-07 13:28:49 +00:00
|
|
|
StyledDropDown.defaultProps = { theme: Base };
|
|
|
|
|
2022-01-27 09:14:55 +00:00
|
|
|
const StyledDropDownItem = styled(DropDownItem)`
|
|
|
|
padding: 6px 23px;
|
|
|
|
`;
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledButtonOptions = styled.div`
|
2022-01-27 09:14:55 +00:00
|
|
|
padding: 16px 0;
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.theme.mainButtonMobile.buttonOptions.backgroundColor};
|
|
|
|
color: ${(props) => props.theme.mainButtonMobile.buttonOptions.color};
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-01-20 15:29:09 +00:00
|
|
|
StyledButtonOptions.defaultProps = { theme: Base };
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledContainerAction = styled.div`
|
2022-01-27 09:14:55 +00:00
|
|
|
padding: 16px 0px;
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-01-27 09:14:55 +00:00
|
|
|
const StyledButtonWrapper = styled.div`
|
|
|
|
padding: 0 24px 34px;
|
|
|
|
display: ${(props) => (props.isOpenButton ? "none" : "block")};
|
2022-02-07 13:28:49 +00:00
|
|
|
background-color: ${(props) =>
|
2022-01-20 15:29:09 +00:00
|
|
|
props.isUploading
|
|
|
|
? props.theme.mainButtonMobile.buttonWrapper.uploadingBackground
|
|
|
|
: props.theme.mainButtonMobile.buttonWrapper.background};
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-02-07 13:28:49 +00:00
|
|
|
StyledButtonWrapper.defaultProps = { theme: Base };
|
|
|
|
|
2022-01-27 09:14:55 +00:00
|
|
|
const StyledProgressContainer = styled.div`
|
|
|
|
display: ${(props) => (props.isUploading ? "flex" : "none")};
|
2022-01-31 13:42:59 +00:00
|
|
|
flex-direction: column;
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
|
|
|
props.isUploading
|
|
|
|
? props.theme.mainButtonMobile.buttonWrapper.uploadingBackground
|
|
|
|
: props.theme.mainButtonMobile.buttonWrapper.background};
|
2022-01-27 09:14:55 +00:00
|
|
|
cursor: default;
|
|
|
|
padding: 0 24px 34px;
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-01-20 15:29:09 +00:00
|
|
|
StyledButtonWrapper.defaultProps = { theme: Base };
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledProgressBarContainer = styled.div`
|
|
|
|
display: ${(props) => (props.isUploading ? "flex" : "none")};
|
2022-02-07 13:28:49 +00:00
|
|
|
align-items: center;
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
flex-wrap: wrap;
|
2022-01-27 09:14:55 +00:00
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
width: 100%;
|
2022-01-27 09:14:55 +00:00
|
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
height: 60px;
|
|
|
|
padding-top: 26px;
|
2021-11-02 08:34:15 +00:00
|
|
|
|
|
|
|
.progress-header {
|
|
|
|
width: 50%;
|
2022-01-27 09:14:55 +00:00
|
|
|
line-height: 16px;
|
2022-01-21 11:23:57 +00:00
|
|
|
color: ${(props) => props.theme.mainButtonMobile.textColor};
|
2021-11-02 08:34:15 +00:00
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.progress_count {
|
2022-01-27 09:14:55 +00:00
|
|
|
line-height: 16px;
|
2022-01-21 11:23:57 +00:00
|
|
|
color: ${(props) => props.theme.mainButtonMobile.textColor};
|
2021-11-02 08:34:15 +00:00
|
|
|
width: 42%;
|
|
|
|
text-align: right;
|
2021-11-19 09:30:22 +00:00
|
|
|
margin-right: 6px;
|
2021-11-02 08:34:15 +00:00
|
|
|
}
|
2022-02-07 13:28:49 +00:00
|
|
|
|
|
|
|
.progress_icon {
|
|
|
|
svg {
|
|
|
|
path {
|
|
|
|
fill: ${(props) => props.theme.mainButtonMobile.bar.icon};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-01-20 15:29:09 +00:00
|
|
|
StyledProgressBarContainer.defaultProps = { theme: Base };
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledMobileProgressBar = styled.div`
|
|
|
|
width: 100%;
|
2022-01-27 09:14:55 +00:00
|
|
|
height: 4px;
|
2022-01-20 15:29:09 +00:00
|
|
|
background-color: ${(props) =>
|
2022-01-21 11:23:57 +00:00
|
|
|
props.theme.mainButtonMobile.mobileProgressBarBackground};
|
2021-11-02 08:34:15 +00:00
|
|
|
border-radius: 2px;
|
2022-01-27 09:14:55 +00:00
|
|
|
margin-top: 14px;
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-02-07 13:28:49 +00:00
|
|
|
StyledMobileProgressBar.defaultProps = { theme: Base };
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
const StyledBar = styled.div`
|
|
|
|
width: ${(props) => props.uploadPercent}%;
|
|
|
|
height: 4px;
|
|
|
|
opacity: 1;
|
2021-11-19 09:30:22 +00:00
|
|
|
background: ${(props) =>
|
|
|
|
props.error
|
2022-01-20 15:29:09 +00:00
|
|
|
? props.theme.mainButtonMobile.bar.errorBackground
|
|
|
|
: props.theme.mainButtonMobile.bar.background};
|
2021-11-02 08:34:15 +00:00
|
|
|
`;
|
|
|
|
|
2022-01-20 15:29:09 +00:00
|
|
|
StyledBar.defaultProps = { theme: Base };
|
|
|
|
|
2021-11-02 08:34:15 +00:00
|
|
|
export {
|
|
|
|
StyledFloatingButton,
|
|
|
|
StyledDropDown,
|
|
|
|
StyledDropDownItem,
|
|
|
|
StyledContainerAction,
|
|
|
|
StyledProgressBarContainer,
|
|
|
|
StyledMobileProgressBar,
|
|
|
|
StyledProgressContainer,
|
|
|
|
StyledBar,
|
|
|
|
StyledButtonWrapper,
|
|
|
|
StyledButtonOptions,
|
|
|
|
};
|