From 66dd9b18717e7e66aa199a8f533b6278a4cb6061 Mon Sep 17 00:00:00 2001 From: Dmitry Sychugov Date: Wed, 17 Nov 2021 17:39:18 +0500 Subject: [PATCH] Web: Components: fixed floating button in main button mobile, added scrollbar --- .../main-button-mobile/index.js | 37 ++++++++++++------- .../main-button-mobile/styled-main-button.js | 11 +----- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/asc-web-components/main-button-mobile/index.js b/packages/asc-web-components/main-button-mobile/index.js index 946c59ba98..61c40037f5 100644 --- a/packages/asc-web-components/main-button-mobile/index.js +++ b/packages/asc-web-components/main-button-mobile/index.js @@ -16,6 +16,7 @@ import IconButton from "../icon-button"; import Button from "../button"; import Text from "../text"; import Scrollbar from "@appserver/components/scrollbar"; +import { isMobile, isTablet } from "react-device-detect"; const ProgressBarMobile = ({ label, @@ -102,18 +103,9 @@ const MainButtonMobile = (props) => { ? progressOptions.filter((option) => option.open) : []; - console.log(dropDownRef); - - const renderDropDown = () => { + const renderItems = () => { return ( - + <> {actionOptions.map((option) => ( { /> )} - + ); }; - const children = renderDropDown(); + const children = renderItems(); return (
@@ -190,8 +182,25 @@ const MainButtonMobile = (props) => { icon={isOpen ? "minus" : "plus"} onClick={onMainButtonClick} percent={percent} + color={"#ed7309"} /> - {children} + + {isMobile || isTablet ? ( + + {children} + + ) : ( + children + )} +
); }; diff --git a/packages/asc-web-components/main-button-mobile/styled-main-button.js b/packages/asc-web-components/main-button-mobile/styled-main-button.js index 8c4c5dda13..27d0e0de7a 100644 --- a/packages/asc-web-components/main-button-mobile/styled-main-button.js +++ b/packages/asc-web-components/main-button-mobile/styled-main-button.js @@ -5,12 +5,7 @@ import DropDownItem from "../drop-down-item"; import FloatingButton from "@appserver/common/components/FloatingButton"; const StyledFloatingButton = styled(FloatingButton)` - & + div { - } - .circle__mask + div { - background-color: #ed7309; - svg { margin-top: 4px; } @@ -38,17 +33,13 @@ const StyledFloatingButton = styled(FloatingButton)` .circle__mask .circle__fill { background-color: #fff; } - - /* .circle__mask { - transform: none !important; - clip: none !important; - } */ `; const StyledDropDown = styled(DropDown)` bottom: ${(props) => props.theme.mainButtonMobile.dropDown.bottom}; right: ${(props) => props.theme.mainButtonMobile.dropDown.right}; z-index: ${(props) => props.theme.mainButtonMobile.dropDown.zIndex}; + height: ${(props) => (props.isMobile ? "100vh" : "auto")}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;