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:
Nathan Bierema 2021-06-10 21:48:13 -04:00 committed by GitHub
parent ed25a72e99
commit dbc08ab1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 20 deletions

View File

@ -6,8 +6,7 @@ export const MainContainerWrapper = styled.div`
height: 100%;
width: 100%;
flex-flow: column nowrap;
flex-shrink: 1;
min-height: 0;
overflow: auto;
background-color: ${(props) => color(props.theme.base00, 'lighten', 0.03)};
color: ${(props) => props.theme.base07};
font-size: 12px;
@ -32,8 +31,7 @@ export const MainContainerWrapper = styled.div`
flex-grow: 1;
display: flex;
flex-flow: column nowrap;
flex-shrink: 1;
min-height: 0;
overflow: auto;
> div {
flex-grow: 1;
@ -46,6 +44,5 @@ export const ContainerWrapper = styled.div`
height: 100%;
width: 100%;
flex-flow: column nowrap;
flex-shrink: 1;
min-height: 0;
overflow: auto;
`;

View File

@ -15,12 +15,6 @@ export interface 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>;
selector?: () => P;
@ -32,11 +26,11 @@ export default class Tabs<P> extends Component<TabsProps<P>> {
this.props.onClick(e.currentTarget.value);
};
updateTabs(props: TabsProps<P>): void {
const tabs = props.tabs;
const selected = props.selected;
renderTabs() {
const tabs = this.props.tabs;
const selected = this.props.selected;
this.tabsHeader = tabs.map((tab, i) => {
return tabs.map((tab, i) => {
let isSelected;
const value = typeof tab.value !== 'undefined' ? tab.value : tab.name;
if (value === selected) {
@ -61,11 +55,9 @@ export default class Tabs<P> extends Component<TabsProps<P>> {
}
render() {
this.updateTabs(nextProps);
const tabsHeader = (
<TabsHeader
tabs={this.tabsHeader!}
tabs={this.renderTabs()}
items={this.props.tabs}
main={this.props.main}
collapsible={this.props.collapsible}

View File

@ -2,7 +2,7 @@
exports[`Container renders correctly 1`] = `
<div
class="sc-AxjAm jlQKkV"
class="sc-AxjAm eccWTt"
>
Text
</div>