mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-03-03 18:58:01 +03:00
fix(devui): clean up after fixing UI bugs (#728)
* fix(devui): clean up after fixing UI bugs * Fix references to props * Update snapshot
This commit is contained in:
parent
ed25a72e99
commit
dbc08ab1b4
|
@ -6,8 +6,7 @@ export const MainContainerWrapper = styled.div`
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
flex-shrink: 1;
|
overflow: auto;
|
||||||
min-height: 0;
|
|
||||||
background-color: ${(props) => color(props.theme.base00, 'lighten', 0.03)};
|
background-color: ${(props) => color(props.theme.base00, 'lighten', 0.03)};
|
||||||
color: ${(props) => props.theme.base07};
|
color: ${(props) => props.theme.base07};
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -32,8 +31,7 @@ export const MainContainerWrapper = styled.div`
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
flex-shrink: 1;
|
overflow: auto;
|
||||||
min-height: 0;
|
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@ -46,6 +44,5 @@ export const ContainerWrapper = styled.div`
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
flex-shrink: 1;
|
overflow: auto;
|
||||||
min-height: 0;
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -15,12 +15,6 @@ export interface TabsProps<P> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Tabs<P> extends Component<TabsProps<P>> {
|
export default class Tabs<P> extends Component<TabsProps<P>> {
|
||||||
constructor(props: TabsProps<P>) {
|
|
||||||
super(props);
|
|
||||||
this.updateTabs(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
tabsHeader?: ReactButtonElement[];
|
|
||||||
SelectedComponent?: React.ComponentType<P>;
|
SelectedComponent?: React.ComponentType<P>;
|
||||||
selector?: () => P;
|
selector?: () => P;
|
||||||
|
|
||||||
|
@ -32,11 +26,11 @@ export default class Tabs<P> extends Component<TabsProps<P>> {
|
||||||
this.props.onClick(e.currentTarget.value);
|
this.props.onClick(e.currentTarget.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
updateTabs(props: TabsProps<P>): void {
|
renderTabs() {
|
||||||
const tabs = props.tabs;
|
const tabs = this.props.tabs;
|
||||||
const selected = props.selected;
|
const selected = this.props.selected;
|
||||||
|
|
||||||
this.tabsHeader = tabs.map((tab, i) => {
|
return tabs.map((tab, i) => {
|
||||||
let isSelected;
|
let isSelected;
|
||||||
const value = typeof tab.value !== 'undefined' ? tab.value : tab.name;
|
const value = typeof tab.value !== 'undefined' ? tab.value : tab.name;
|
||||||
if (value === selected) {
|
if (value === selected) {
|
||||||
|
@ -61,11 +55,9 @@ export default class Tabs<P> extends Component<TabsProps<P>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
this.updateTabs(nextProps);
|
|
||||||
|
|
||||||
const tabsHeader = (
|
const tabsHeader = (
|
||||||
<TabsHeader
|
<TabsHeader
|
||||||
tabs={this.tabsHeader!}
|
tabs={this.renderTabs()}
|
||||||
items={this.props.tabs}
|
items={this.props.tabs}
|
||||||
main={this.props.main}
|
main={this.props.main}
|
||||||
collapsible={this.props.collapsible}
|
collapsible={this.props.collapsible}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
exports[`Container renders correctly 1`] = `
|
exports[`Container renders correctly 1`] = `
|
||||||
<div
|
<div
|
||||||
class="sc-AxjAm jlQKkV"
|
class="sc-AxjAm eccWTt"
|
||||||
>
|
>
|
||||||
Text
|
Text
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user