Skip to content

Commit

Permalink
feat(ui): Add redux context ui (#19807)
Browse files Browse the repository at this point in the history
  • Loading branch information
matejminar committed Jul 27, 2020
1 parent 4ca2cee commit a9471ac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Expand Up @@ -15,6 +15,7 @@ const CONTEXT_TYPES = {
user: require('app/components/events/contexts/user/user').default,
gpu: require('app/components/events/contexts/gpu/gpu').default,
trace: require('app/components/events/contexts/trace/trace').default,
'redux.state': require('app/components/events/contexts/redux').default,
};

function getContextComponent(type) {
Expand Down
33 changes: 33 additions & 0 deletions src/sentry/static/sentry/app/components/events/contexts/redux.tsx
@@ -0,0 +1,33 @@
import React from 'react';

import {t} from 'app/locale';
import ContextBlock from 'app/components/events/contexts/contextBlock';
import {KeyValueListData} from 'app/components/events/interfaces/keyValueList/types';
import ClippedBox from 'app/components/clippedBox';

type Props = {
alias: string;
data: Record<string, any>;
};

class ReduxContextType extends React.Component<Props> {
getKnownData(): KeyValueListData[] {
return [
{
key: 'value',
subject: t('Latest State'),
value: this.props.data,
},
];
}

render() {
return (
<ClippedBox clipHeight={250}>
<ContextBlock knownData={this.getKnownData()} />
</ClippedBox>
);
}
}

export default ReduxContextType;

0 comments on commit a9471ac

Please sign in to comment.