refactor(ui/player): remove unused, deprecated etc

This commit is contained in:
sylenien 2022-11-28 11:29:31 +01:00
parent 7be5453226
commit 5e89bbbbb6
10 changed files with 18 additions and 39 deletions

View file

@ -2,9 +2,8 @@ import React from 'react';
import { connect } from 'react-redux';
import { useState } from 'react';
import { NoContent, Tabs } from 'UI';
import withEnumToggle from 'HOCs/withEnumToggle';
import { hideHint } from 'Duck/components/player';
import { typeList } from 'Types/session/stackEvent';
import { typeList } from 'Types/session/stackEvent';
import * as PanelLayout from './PanelLayout';
import UserEvent from 'Components/Session_/StackEvents/UserEvent';
@ -14,7 +13,7 @@ const ALL = 'ALL';
const TABS = [ ALL, ...typeList ].map(tab =>({ text: tab, key: tab }));
function StackEvents({
function StackEvents({
stackEvents,
hintIsHidden,
hideHint,
@ -28,10 +27,10 @@ function StackEvents({
return (
<>
<PanelLayout.Header>
<Tabs
<Tabs
className="uppercase"
tabs={ tabs }
active={ activeTab }
active={ activeTab }
onClick={ setTab }
border={ false }
/>
@ -39,12 +38,12 @@ function StackEvents({
<PanelLayout.Body>
<NoContent
title="Nothing to display yet."
subtext={ !hintIsHidden
?
subtext={ !hintIsHidden
?
<>
<a className="underline color-teal" href="https://docs.openreplay.com/integrations" target="_blank">Integrations</a>
{' and '}
<a className="underline color-teal" href="https://docs.openreplay.com/api#event" target="_blank">Events</a>
<a className="underline color-teal" href="https://docs.openreplay.com/api#event" target="_blank">Events</a>
{ ' make debugging easier. Sync your backend logs and custom events with session replay.' }
<br/><br/>
<button className="color-teal" onClick={() => hideHint("stack")}>Got It!</button>
@ -66,8 +65,8 @@ function StackEvents({
}
export default connect(state => ({
hintIsHidden: state.getIn(['components', 'player', 'hiddenHints', 'stack']) ||
hintIsHidden: state.getIn(['components', 'player', 'hiddenHints', 'stack']) ||
!state.getIn([ 'site', 'list' ]).some(s => s.stackIntegrations),
}), {
hideHint
})(StackEvents);
})(StackEvents);

View file

@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import cn from 'classnames';
import { closeBottomBlock } from 'Duck/components/player';
import { Input, CloseButton } from 'UI';
import { CloseButton } from 'UI';
import stl from './header.module.css';
const Header = ({

View file

@ -1,9 +0,0 @@
// import { NONE, CONSOLE, NETWORK, STACKEVENTS, REDUX_STATE, PROFILER, PERFORMANCE, GRAPHQL } from 'Duck/components/player';
//
//
// export default {
// [NONE]: {
// Component: null,
//
// }
// }

View file

@ -9,7 +9,6 @@ import copy from 'copy-to-clipboard';
import { toast } from 'react-toastify';
import { session } from 'App/routes';
import { confirm } from 'UI';
import { filterOutNote as filterOutTimelineNote } from 'Player';
import { TeamBadge } from 'Shared/SessionListContainer/components/Notes';
interface Props {
@ -24,7 +23,6 @@ function NoteEvent(props: Props) {
const { settingsStore, notesStore } = useStore();
const { timezone } = settingsStore.sessionSettings;
console.log(props.noEdit);
const onEdit = () => {
props.onEdit({
isVisible: true,
@ -60,7 +58,6 @@ function NoteEvent(props: Props) {
) {
notesStore.deleteNote(props.note.noteId).then((r) => {
props.filterOutNote(props.note.noteId);
filterOutTimelineNote(props.note.noteId);
toast.success('Note deleted');
});
}

View file

@ -1,7 +1,7 @@
import React from 'react';
import cn from 'classnames';
import { connect } from 'react-redux';
import { STORAGE_TYPES, selectStorageType, selectStorageListNow } from 'Player';
import { STORAGE_TYPES, selectStorageType } from 'Player';
import LiveTag from 'Shared/LiveTag';
import { Icon, Tooltip } from 'UI';

View file

@ -2,8 +2,8 @@ import React from 'react';
import type { MarkedTarget } from 'Player';
import cn from 'classnames';
import stl from './Marker.module.css';
import { activeTarget } from 'Player';
import { Tooltip } from 'UI';
import { PlayerContext } from 'App/components/Session/playerContext';
interface Props {
target: MarkedTarget;
@ -17,11 +17,14 @@ export default function Marker({ target, active }: Props) {
width: `${target.boundingRect.width}px`,
height: `${target.boundingRect.height}px`,
};
const { player } = React.useContext(PlayerContext)
return (
<div
className={cn(stl.marker, { [stl.active]: active })}
style={style}
onClick={() => activeTarget(target.index)}
// @ts-ignore
onClick={() => player.setActiveTarget(target.index)}
>
<div className={stl.index}>{target.index + 1}</div>
<Tooltip open={active} delay={0} title={<div>{target.count} Clicks</div>}>

View file

@ -4,7 +4,6 @@ import { findDOMNode } from 'react-dom';
import cn from 'classnames';
import { EscapeButton } from 'UI';
import { hide as hideTargetDefiner } from 'Duck/components/targetDefiner';
import { fullscreenOff } from 'Duck/components/player';
import {
NONE,
CONSOLE,
@ -17,9 +16,9 @@ import {
EXCEPTIONS,
INSPECTOR,
OVERVIEW,
fullscreenOff,
} from 'Duck/components/player';
import NetworkPanel from 'Shared/DevTools/NetworkPanel';
// import StackEvents from '../StackEvents/StackEvents';
import Storage from '../Storage';
import { ConnectedPerformance } from '../Performance';
import GraphQL from '../GraphQL';

View file

@ -1,7 +1,6 @@
import React from 'react';
import cn from 'classnames';
import { connect } from 'react-redux';
import { NONE } from 'Duck/components/player';
import Player from './Player';
import SubHeader from './Subheader';

View file

@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import cn from 'classnames';
import { closeBottomBlock } from 'Duck/components/player';
import { Input, CloseButton } from 'UI';
import { CloseButton } from 'UI';
import stl from './header.module.css';
const Header = ({

View file

@ -1,9 +0,0 @@
// import { NONE, CONSOLE, NETWORK, STACKEVENTS, REDUX_STATE, PROFILER, PERFORMANCE, GRAPHQL } from 'Duck/components/player';
//
//
// export default {
// [NONE]: {
// Component: null,
//
// }
// }