Add error bar
Summary: Red error bar at bottom when something goes wrong. Reviewed By: danielbuechele Differential Revision: D15536042 fbshipit-source-id: 6a20e22489f9346864b78f9102a0917f94c1c74f
This commit is contained in:
committed by
Facebook Github Bot
parent
13e942f59a
commit
cfbc84e5bc
@@ -16,6 +16,7 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Input,
|
Input,
|
||||||
|
colors,
|
||||||
getStringFromErrorLike,
|
getStringFromErrorLike,
|
||||||
} from 'flipper';
|
} from 'flipper';
|
||||||
import {Component} from 'react';
|
import {Component} from 'react';
|
||||||
@@ -38,6 +39,12 @@ const BoldSpan = styled('span')({
|
|||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
});
|
});
|
||||||
|
const ErrorBar = styled('div')({
|
||||||
|
backgroundColor: colors.cherry,
|
||||||
|
color: colors.white,
|
||||||
|
lineHeight: '26px',
|
||||||
|
textAlign: 'center',
|
||||||
|
});
|
||||||
|
|
||||||
type DatabasesPluginState = {|
|
type DatabasesPluginState = {|
|
||||||
selectedDatabase: number,
|
selectedDatabase: number,
|
||||||
@@ -758,7 +765,9 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
|||||||
) : null}
|
) : null}
|
||||||
</FlexRow>
|
</FlexRow>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
{this.state.error && getStringFromErrorLike(this.state.error)}
|
{this.state.error && (
|
||||||
|
<ErrorBar>{getStringFromErrorLike(this.state.error)}</ErrorBar>
|
||||||
|
)}
|
||||||
</FlexColumn>
|
</FlexColumn>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user