From 55edc0b592daa07c5421e238e5b80040d2e2362f Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 9 Nov 2022 09:59:09 +0100 Subject: [PATCH 01/21] change(ui) - floating ui --- .../Alerts/Notifications/Notifications.tsx | 6 +- .../SessionSettingButton.tsx | 6 +- .../shared/SharePopup/SharePopup.js | 139 ++++++++---------- .../app/components/ui/ItemMenu/ItemMenu.tsx | 123 ++++++++-------- .../ui/ItemMenu/itemMenu.module.css | 6 +- .../app/components/ui/Popover/Popover.tsx | 84 +++++++++++ frontend/app/components/ui/Popover/index.ts | 1 + .../components/ui/Tooltip/FloatingTooltip.tsx | 109 ++++++++++++++ .../app/components/ui/Tooltip/Tooltip.tsx | 62 ++------ .../app/components/ui/Tooltip/Tooltip.tsx_ | 47 ++++++ frontend/app/components/ui/index.js | 3 +- frontend/app/styles/general.css | 13 ++ frontend/package.json | 2 + 13 files changed, 401 insertions(+), 200 deletions(-) create mode 100644 frontend/app/components/ui/Popover/Popover.tsx create mode 100644 frontend/app/components/ui/Popover/index.ts create mode 100644 frontend/app/components/ui/Tooltip/FloatingTooltip.tsx create mode 100644 frontend/app/components/ui/Tooltip/Tooltip.tsx_ diff --git a/frontend/app/components/Alerts/Notifications/Notifications.tsx b/frontend/app/components/Alerts/Notifications/Notifications.tsx index b5421fd29..be3684bd4 100644 --- a/frontend/app/components/Alerts/Notifications/Notifications.tsx +++ b/frontend/app/components/Alerts/Notifications/Notifications.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; import stl from './notifications.module.css'; import { connect } from 'react-redux'; -import { Icon, Popup } from 'UI'; +import { Icon, Popup, Tooltip } from 'UI'; import { fetchList, setViewed, clearAll } from 'Duck/notifications'; import { setLastRead } from 'Duck/announcements'; import { useModal } from 'App/components/Modal'; @@ -29,7 +29,7 @@ function Notifications(props: Props) { }, []); return useObserver(() => ( - +
showModal(, { right: true })} @@ -39,7 +39,7 @@ function Notifications(props: Props) {
-
+ )); } diff --git a/frontend/app/components/shared/SessionListContainer/components/SessionSettingButton/SessionSettingButton.tsx b/frontend/app/components/shared/SessionListContainer/components/SessionSettingButton/SessionSettingButton.tsx index 6dde016a3..8f080cbaf 100644 --- a/frontend/app/components/shared/SessionListContainer/components/SessionSettingButton/SessionSettingButton.tsx +++ b/frontend/app/components/shared/SessionListContainer/components/SessionSettingButton/SessionSettingButton.tsx @@ -1,8 +1,8 @@ import { useModal } from 'App/components/Modal'; import React from 'react'; import SessionSettings from 'Shared/SessionSettings'; -import { Button } from 'UI'; -import { Tooltip } from 'react-tippy'; +import { Button, Tooltip } from 'UI'; +// import { Tooltip } from 'react-tippy'; function SessionSettingButton(props: any) { const { showModal } = useModal(); @@ -14,7 +14,7 @@ function SessionSettingButton(props: any) { return (
{/* @ts-ignore */} - +
diff --git a/frontend/app/components/shared/SharePopup/SharePopup.js b/frontend/app/components/shared/SharePopup/SharePopup.js index cf5bb89db..9fef76843 100644 --- a/frontend/app/components/shared/SharePopup/SharePopup.js +++ b/frontend/app/components/shared/SharePopup/SharePopup.js @@ -1,21 +1,15 @@ import React from 'react'; import { connect } from 'react-redux'; import { toast } from 'react-toastify'; -import { connectPlayer } from 'Player'; import withRequest from 'HOCs/withRequest'; -import { Icon, Button } from 'UI'; +import { Icon, Button, Popover } from 'UI'; import styles from './sharePopup.module.css'; import IntegrateSlackButton from '../IntegrateSlackButton/IntegrateSlackButton'; import SessionCopyLink from './SessionCopyLink'; import Select from 'Shared/Select'; -import { Tooltip } from 'react-tippy'; import cn from 'classnames'; -import { fetchList, init } from 'Duck/integrations/slack'; -import OutsideClickDetectingDiv from 'Shared/OutsideClickDetectingDiv'; +import { fetchList } from 'Duck/integrations/slack'; -// @connectPlayer((state) => ({ -// time: state.time, -// })) @connect( (state) => ({ channels: state.getIn(['slack', 'list']), @@ -75,84 +69,67 @@ export default class SharePopup extends React.PureComponent { const options = channels .map(({ webhookId, name }) => ({ value: webhookId, label: name })) .toJS(); - return ( - { - this.setState({ isOpen: false }); - }} - > - -
-
Share this session link to Slack
-
- {options.length === 0 ? ( - <> -
- -
- {showCopyLink && ( -
- -
- )} - - ) : ( -
-
-