diff --git a/tdrive/frontend/src/app/components/inputs/input-with-button.jsx b/tdrive/frontend/src/app/components/inputs/input-with-button.jsx deleted file mode 100644 index 1c5abb2e..00000000 --- a/tdrive/frontend/src/app/components/inputs/input-with-button.jsx +++ /dev/null @@ -1,54 +0,0 @@ -/* eslint-disable react/prop-types */ -import React, { Component } from 'react'; - -import Languages from '@features/global/services/languages-service'; -import './input-with-button.scss'; -import Icon from '@components/icon/icon.jsx'; -import Input from './input.jsx'; - -export default class InputWithButton extends Component { - /* - props = { - value : "", - disabled : true|false - } - */ - constructor(props) { - super(props); - this.props = props; - - this.state = { - i18n: Languages, - }; - - Languages.addListener(this); - this.inputElement = false; - } - - componentWillUnmount() { - Languages.removeListener(this); - } - - render() { - return ( -
- { - this.inputElement = obj; - this.props.refInput && this.props.refInput(); - }} - {...this.props} - /> - {!this.props.hideBtn && ( -
this.props.btnAction()} - > - -
- )} -
- ); - } -} diff --git a/tdrive/frontend/src/app/components/inputs/input-with-button.scss b/tdrive/frontend/src/app/components/inputs/input-with-button.scss deleted file mode 100755 index ab22c850..00000000 --- a/tdrive/frontend/src/app/components/inputs/input-with-button.scss +++ /dev/null @@ -1,29 +0,0 @@ -.inputWithButton { - display: flex; - position: relative; - input.input { - padding-right: 50px; - } - .button-icon { - position: absolute; - height: 40px; - right: 0px; - box-sizing: border-box; - padding: 10px; - border-radius: 0px 4px 4px 0px; - border-left: solid 1px var(--grey-light); - font-size: 16px; - cursor: pointer; - } - - .danger { - background-color: var(--grey-background); - color: var(--grey-dark); - } - - .danger:hover { - transition: 0.5s; - background-color: var(--grey-light); - color: var(--red); - } -} diff --git a/tdrive/frontend/src/app/components/parameters/attribute.jsx b/tdrive/frontend/src/app/components/parameters/attribute.jsx deleted file mode 100755 index a928b0d8..00000000 --- a/tdrive/frontend/src/app/components/parameters/attribute.jsx +++ /dev/null @@ -1,87 +0,0 @@ -import React, { Component } from 'react'; - -import Number from '@features/global/utils/Numbers'; -import AttributesManager from './attributes-manager.js'; -import './parameters.scss'; -import Languages from '@features/global/services/languages-service'; - -export default class Attribute extends React.Component { - constructor(props) { - super(); - - this.id = Number.unid(); - - this.state = { - parameters_attributes: AttributesManager, - i18n: Languages, - }; - - this.timeout = setTimeout(''); - - Languages.addListener(this); - AttributesManager.addListener(this); - } - componentDidMount() { - if (this.props.autoOpen) { - AttributesManager.toggle(this.id); - } - } - componentWillUnmount() { - clearTimeout(this.timeout); - Languages.removeListener(this); - AttributesManager.removeListener(this); - } - componentDidUpdate() { - var open = this.state.parameters_attributes.open == this.id; - if (open && !this.was_open) { - this.value_node.style.maxHeight = 'none'; - this.value_height = window.getBoundingClientRect(this.value_node).height; - this.value_node.style.maxHeight = '0px'; - clearTimeout(this.timeout); - this.timeout = setTimeout(() => { - this.value_node.style.maxHeight = this.value_height + 'px'; - - this.timeout = setTimeout(() => { - this.value_node.style.maxHeight = 'none'; - this.value_height = window.getBoundingClientRect(this.value_node).height; - }, 200); - }, 50); - - if (this.props.focusOnOpen) { - this.props.focusOnOpen.focus(); - } - } else if (!open && this.was_open) { - clearTimeout(this.timeout); - - this.value_node.style.maxHeight = this.value_height + 'px'; - this.timeout = setTimeout(() => { - this.value_node.style.maxHeight = '0px'; - }, 50); - } - this.was_open = open; - } - render() { - return ( -
-
AttributesManager.toggle(this.id)}> - {!this.props.autoOpen && ( - - {this.state.parameters_attributes.open == this.id - ? this.state.i18n.t('general.close') - : this.state.i18n.t('general.open')} - - )} -
{this.props.label}
-
{this.props.description}
-
-
(this.value_node = node)} className="value"> - {this.props.children} -
-
- ); - } -} diff --git a/tdrive/frontend/src/app/components/parameters/attribute.tsx b/tdrive/frontend/src/app/components/parameters/attribute.tsx new file mode 100755 index 00000000..ea8db87c --- /dev/null +++ b/tdrive/frontend/src/app/components/parameters/attribute.tsx @@ -0,0 +1,14 @@ +import { ReactNode } from 'react'; +import './parameters.scss'; + +export default (props: { label: string; description: string; children: ReactNode }) => { + return ( +
+
+
{props.label}
+
{props.description}
+
+
{props.children}
+
+ ); +}; diff --git a/tdrive/frontend/src/app/components/parameters/attributes-manager.js b/tdrive/frontend/src/app/components/parameters/attributes-manager.js deleted file mode 100755 index 5bea4d24..00000000 --- a/tdrive/frontend/src/app/components/parameters/attributes-manager.js +++ /dev/null @@ -1,26 +0,0 @@ -import React, { Component } from 'react'; - -import Observable from '@deprecated/CollectionsV1/observable.js'; - -/* - Menus manager service, choose where to generate menu -*/ -class AttributesManager extends Observable { - constructor() { - super(); - this.setObservableName('parameters_attributes'); - - this.open = ''; - } - toggle(id) { - if (this.open == id) { - this.open = ''; - } else { - this.open = id; - } - this.notify(); - } -} - -const service = new AttributesManager(); -export default service; diff --git a/tdrive/frontend/src/app/components/tooltip/tooltip.jsx b/tdrive/frontend/src/app/components/tooltip/tooltip.jsx deleted file mode 100755 index dd31d61f..00000000 --- a/tdrive/frontend/src/app/components/tooltip/tooltip.jsx +++ /dev/null @@ -1,113 +0,0 @@ -import React, { Component } from 'react'; - -import './tooltip.scss'; - -export default class Tooltip extends Component { - /* - props = { - tooltip : text or react element to show - visible : - overable : default : true - position : - } - */ - constructor(props) { - super(props); - this.state = { - top: 'unset', - left: 'unset', - right: 'unset', - bottom: '0px', - }; - } - componentWillUnmount() {} - componentDidUpdate(prevProps, prevState) { - if (this.props.visible === true && prevProps.visible === false) { - this.open(); - } else if (this.props.visible === false && prevProps.visible === true) { - this.close(); - } - } - openWithTimeOut(timeout = 5) { - var that = this; - that.open(); - setTimeout(() => { - that.close(); - }, timeout * 1000); - } - open() { - if (this.props.position === 'left') { - this.setState({ - visible: true, - left: (this.tooltip.clientWidth + 8) * -1 + 'px', - right: 'unset', - }); - } else if (this.props.position === 'right') { - this.setState({ - visible: true, - right: (this.tooltip.clientWidth + 8) * -1 + 'px', - left: 'unset', - }); - } else if (this.props.position === 'bottom') { - this.setState({ - visible: true, - bottom: (this.tooltip.clientHeight + 5) * -1 + 'px', - top: 'unset', - }); - } else { - this.setState({ - visible: true, - top: (this.tooltip.clientHeight + 5) * -1 + 'px', - bottom: 'unset', - }); - } - } - close() { - this.setState({ visible: false, top: 'unset', left: '0px', right: 'unset', bottom: '0px' }); - } - componentDidMount() { - var that = this; - if (this.parent && this.children) { - window.tooltip = this.tooltip; - this.parent.addEventListener('mouseenter', () => { - if (this.props.overable !== false) { - that.open(); - } - }); - this.parent.addEventListener('mouseleave', () => { - if (this.props.overable !== false) { - that.close(); - } - }); - } - } - render() { - return ( -
(this.parent = parent)} - > -
(this.tooltip = obj)} - > - {this.props.tooltip} -
-
(this.children = children)}> - {this.props.children} -
-
- ); - } -} diff --git a/tdrive/frontend/src/app/components/tooltip/tooltip.scss b/tdrive/frontend/src/app/components/tooltip/tooltip.scss deleted file mode 100755 index 4c6c5918..00000000 --- a/tdrive/frontend/src/app/components/tooltip/tooltip.scss +++ /dev/null @@ -1,68 +0,0 @@ -.tooltip { - position: relative; - display: inline-block; - width: 100%; - font-size: 14px; - font-weight: 500; - .tooltipAbsolute { - position: absolute; - opacity: 0; - z-index: -1; - background: black; - color: white; - border-bottom: 1px dotted black; - padding: 5px 10px; - border-radius: var(--border-radius-base); - text-align: center; - font-size: 12px; - line-height: 16px; - } - .tooltipAbsolute::after { - content: ''; - position: absolute; - border-width: 5px; - border-style: solid; - } - .right, - .left { - top: 50% !important; - transform: translateY(-50%); - } - .top, - .bottom { - left: 50% !important; - transform: translateX(-50%); - } - .top::after { - left: calc(50% - 5px); - top: 100%; - border-color: black transparent transparent transparent; - } - .right::after { - left: -10px; - border-color: transparent black transparent transparent; - top: calc(50% - 5px); - margin-top: -5px; - } - .bottom::after { - bottom: 100%; - border-color: transparent transparent black transparent; - left: calc(50% - 5px); - margin-left: -5px; - } - .left::after { - right: -10px; - border-color: transparent transparent transparent black; - top: calc(50% - 5px); - margin-top: -5px; - } - .visible { - z-index: 50; - opacity: 1; - transition: opacity 0.2s; - } - .contentTooltip { - width: 100%; - display: inline-block; - } -} diff --git a/tdrive/frontend/src/app/views/client/index.tsx b/tdrive/frontend/src/app/views/client/index.tsx index 28b7bf5f..ebb23121 100755 --- a/tdrive/frontend/src/app/views/client/index.tsx +++ b/tdrive/frontend/src/app/views/client/index.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import React, { Suspense, useState } from 'react'; -import ChatUploadsViewer from '@components/file-uploads/uploads-viewer'; +import UploadsViewer from '@components/file-uploads/uploads-viewer'; import { useFeatureToggles } from '@components/locked-features-components/feature-toggles-hooks'; import MenusBodyLayer from '@components/menus/menus-body-layer.jsx'; import ModalComponent from '@components/modal/modal-component'; @@ -16,7 +16,6 @@ import ConnectionIndicator from 'components/connection-indicator/connection-indi import NewVersionComponent from 'components/new-version/new-version-component'; import PopupComponent from 'components/popup-component/popup-component.jsx'; import SearchPopup from 'components/search-popup/search-popup'; -import DriveUploadViewer from 'components/uploads/upload-viewer.jsx'; import MainView from './body'; import DownloadAppBanner from '@components/download-app-banner/download-app-banner'; @@ -94,12 +93,11 @@ export default React.memo((): JSX.Element => { {PopupService.isOpen() && } {page} - - + ); }); diff --git a/tdrive/frontend/src/app/views/client/popup/UserParameter/UserParameter.jsx b/tdrive/frontend/src/app/views/client/popup/UserParameter/UserParameter.jsx index 1b63ad33..c81e29ac 100755 --- a/tdrive/frontend/src/app/views/client/popup/UserParameter/UserParameter.jsx +++ b/tdrive/frontend/src/app/views/client/popup/UserParameter/UserParameter.jsx @@ -6,7 +6,6 @@ import { getFilesTree } from '@components/uploads/file-tree-utils'; import Collections from '@deprecated/CollectionsV1/Collections/Collections.js'; import popupManager from '@deprecated/popupManager/popupManager.js'; import currentUserService from '@deprecated/user/CurrentUser'; -import workspaceService from '@deprecated/workspaces/workspaces.jsx'; import LoginService from '@features/auth/login-service'; import InitService from '@features/global/services/init-service'; import Languages from '@features/global/services/languages-service'; @@ -15,7 +14,7 @@ import { ExternalLinkIcon } from '@heroicons/react/outline'; import ButtonWithTimeout from 'components/buttons/button-with-timeout.jsx'; import Input from 'components/inputs/input.jsx'; import MenuList from 'components/menus/menu-component.jsx'; -import Attribute from 'components/parameters/attribute.jsx'; +import Attribute from 'components/parameters/attribute.tsx'; import { Button } from '../../../../atoms/button/button'; import * as Text from '../../../../atoms/text'; import './UserParameter.scss';