diff --git a/web/ASC.Web.Components/src/components/group-button/index.js b/web/ASC.Web.Components/src/components/group-button/index.js
index 88b2465c39..caf3bd6060 100644
--- a/web/ASC.Web.Components/src/components/group-button/index.js
+++ b/web/ASC.Web.Components/src/components/group-button/index.js
@@ -1,146 +1,187 @@
-import React, { useState, useEffect, useRef } from 'react'
-import styled, { css } from 'styled-components'
-import PropTypes from 'prop-types'
-import { Icons } from '../icons'
-import DropDown from '../drop-down'
-import Checkbox from '../checkbox'
+import React from "react";
+import styled, { css } from "styled-components";
+import PropTypes from "prop-types";
+import { Icons } from "../icons";
+import DropDown from "../drop-down";
+import DropDownItem from "../drop-down-item";
-const textColor = '#333333',
- disabledTextColor = '#A3A9AE';
+const textColor = "#333333",
+ disabledTextColor = "#A3A9AE";
const activatedCss = css`
- cursor: pointer;
+ cursor: pointer;
`;
const hoveredCss = css`
- cursor: pointer;
+ cursor: pointer;
`;
const StyledGroupButton = styled.div`
- position: relative;
- display: inline-flex;
- vertical-align: middle;
+ position: relative;
+ display: inline-flex;
+ vertical-align: middle;
`;
const StyledDropdownToggle = styled.div`
- font-family: Open Sans;
- font-style: normal;
- font-weight: ${props => props.fontWeight};
- font-size: 14px;
- line-height: 19px;
+ font-family: Open Sans;
+ font-style: normal;
+ font-weight: ${props => props.fontWeight};
+ font-size: 14px;
+ line-height: 19px;
- cursor: default;
+ cursor: default;
- color: ${props => (props.disabled ? disabledTextColor : textColor)};
-
- float: left;
- height: 19px;
- margin: 18px 12px 19px 12px;
- overflow: hidden;
- padding: 0px;
+ color: ${props => (props.disabled ? disabledTextColor : textColor)};
- text-align: center;
- text-decoration: none;
- white-space: nowrap;
+ float: left;
+ height: 19px;
+ margin: 18px 12px 19px 12px;
+ overflow: hidden;
+ padding: 0px;
- user-select: none;
- -o-user-select: none;
- -moz-user-select: none;
- -webkit-user-select: none;
+ text-align: center;
+ text-decoration: none;
+ white-space: nowrap;
- ${props => !props.disabled && (props.activated ? `${activatedCss}` : css`
- &:active {
+ user-select: none;
+ -o-user-select: none;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+
+ ${props =>
+ !props.disabled &&
+ (props.activated
+ ? `${activatedCss}`
+ : css`
+ &:active {
${activatedCss}
- }`)
- }
+ }
+ `)}
- ${props => !props.disabled && (props.hovered ? `${hoveredCss}` : css`
- &:hover {
+ ${props =>
+ !props.disabled &&
+ (props.hovered
+ ? `${hoveredCss}`
+ : css`
+ &:hover {
${hoveredCss}
- }`)
- }
+ }
+ `)}
`;
const Caret = styled(Icons.ExpanderDownIcon)`
- width: 10px;
- margin-left: 4px;
+ width: 10px;
+ margin-left: 4px;
`;
const Separator = styled.div`
- vertical-align: middle;
- border: 0.5px solid #ECEEF1;
- width: 1px;
- height: 24px;
- margin-top: 16px;
+ vertical-align: middle;
+ border: 0.5px solid #eceef1;
+ width: 1px;
+ height: 24px;
+ margin-top: 16px;
`;
-const useOuterClickNotifier = (onOuterClick, ref) => {
- useEffect(() => {
- const handleClick = (e) => !ref.current.contains(e.target) && onOuterClick(e);
+class GroupButton extends React.Component {
+ constructor(props) {
+ super(props);
- if (ref.current) {
- document.addEventListener("click", handleClick);
- }
+ this.ref = React.createRef();
- return () => document.removeEventListener("click", handleClick);
- },
- [onOuterClick, ref]
- );
-}
+ this.state = {
+ isOpen: props.opened
+ };
+ }
-const GroupButton = (props) => {
- const { label, isDropdown, opened, disabled, isSeparator} = props;
- const [isOpen, toggle] = useState(opened);
+ onOuterClick = e => this.toggle(false);
+ handleClick = e =>
+ !this.ref.current.contains(e.target) && this.onOuterClick(e);
+ stopAction = e => e.preventDefault();
+ toggle = isOpen => this.setState({ isOpen: isOpen });
- let ref = useRef(null);
+ componentDidMount() {
+ if (this.ref.current) {
+ document.addEventListener("click", this.handleClick);
+ }
+ }
- useOuterClickNotifier(() => toggle(false), ref);
+ componentWillUnmount() {
+ document.removeEventListener("click", this.handleClick);
+ }
- const dropMenu =