fix(ui): fix events modal

This commit is contained in:
sylenien 2022-09-01 17:25:38 +02:00
parent 5d0c082124
commit 67614fb395
4 changed files with 23 additions and 62 deletions

View file

@ -4,11 +4,12 @@ import { Icon, JSONTree } from 'UI';
export default class JsonViewer extends React.PureComponent {
render() {
const { data, title, icon } = this.props;
const isObjectData = typeof data === 'object' && !Array.isArray(data) && data !== null
return (
<div className="p-5">
<Icon name={icon} size="30" />
<h4 className="my-5 capitalize"> {title}</h4>
<JSONTree src={data} collapsed={false} />
{isObjectData ? <JSONTree src={data} collapsed={false} /> : data}
</div>
);
}

View file

@ -47,7 +47,6 @@ export default class StackEvents extends React.PureComponent {
}
renderPopupContent(userEvent) {
console.log('event', userEvent);
const { source, payload, name } = userEvent;
switch (source) {
case SENTRY:

View file

@ -2,14 +2,24 @@ import React from 'react';
import { Icon, JSONTree } from 'UI';
export default class JsonViewer extends React.PureComponent {
render() {
const { data, title, icon } = this.props;
return (
<div className="p-5">
<Icon name={ icon } size="54" />
<h4 className="my-5"> { title }</h4>
<JSONTree src={ data } collapsed={ false } />
</div>
);
}
}
render() {
const { data, title, icon } = this.props;
const isObjectData = typeof data === 'object' && !Array.isArray(data) && data !== null;
return (
<div className="p-5 pt-0">
<div className="flex items-center">
<Icon name={icon} size="24" />
<h4 className="my-5 mx-2 font-semibold text-xl"> {title}</h4>
</div>
{isObjectData ? (
<JSONTree src={data} collapsed={false} />
) : (
<>
<div className="-ml-2 text-disabled-text">Payload: </div>
<div className="mx-2">{data}</div>
</>
)}
</div>
);
}
}

View file

@ -1,49 +0,0 @@
import {
NONE,
CONSOLE,
NETWORK,
STACKEVENTS,
STORAGE,
PROFILER,
PERFORMANCE,
GRAPHQL,
FETCH,
EXCEPTIONS,
LONGTASKS,
} from 'Duck/components/player';
import Network from './Network';
import Console from './Console/Console';
import StackEvents from './StackEvents/StackEvents';
import Storage from './Storage';
import Profiler from './Profiler';
import Performance from './Performance';
import PlayerBlockHeader from './PlayerBlockHeader';
import GraphQL from './GraphQL';
import Fetch from './Fetch';
import Exceptions from './Exceptions/Exceptions';
import LongTasks from './LongTasks';
// const tabs = [
// {
// key: CONSOLE,
// Component: Console,
// },
// {
// key: NETWORK,
// Component: Network,
// },
// {
// key: STORAGE,
// Component:
// }
// ]
const tabsByKey = {};
// tabs.map()
export function switchTab(tabKey) {
tabKey
}