Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
testshallpass committed Jan 4, 2022
1 parent 9fe6308 commit 20d0ff8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
8 changes: 4 additions & 4 deletions DropdownAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,11 @@ export default class DropdownAlert extends Component {
const src = isRemote ? {uri: source} : source;
return <Image style={style} source={src} />;
};
_renderTitle = title => {
_renderTitle = (title) => {
if (this.props.renderTitle) {
return this.props.renderTitle(this.props, this.alertData);
}
if (!title || title.length == 0) {
if (!title || title.length === 0) {
return null;
}
const {titleTextProps, titleStyle, titleNumOfLines} = this.props;
Expand All @@ -529,11 +529,11 @@ export default class DropdownAlert extends Component {
</Text>
);
};
_renderMessage = message => {
_renderMessage = (message) => {
if (this.props.renderMessage) {
return this.props.renderMessage(this.props, this.alertData);
}
if (!message || message.length == 0) {
if (!message || message.length === 0) {
return null;
}
const {messageTextProps, messageStyle, messageNumOfLines} = this.props;
Expand Down
15 changes: 9 additions & 6 deletions Example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ const App = () => {
{
color: Color.info,
type: 'info',
message: 'System maintenance starts at midnight. System will be down for approximately 3 hours.',
message:
'System maintenance starts at midnight. System will be down for approximately 3 hours.',
},
{
color: Color.warn,
type: 'warn',
message: 'Warning: Low disk space. Please add more at your earliest convenience.',
message:
'Warning: Low disk space. Please add more at your earliest convenience.',
},
{
color: Color.error,
type: 'error',
message: 'Sorry, we are having some technical difficulties. Please try again.',
message:
'Sorry, we are having some technical difficulties. Please try again.',
},
{
color: Color.success,
Expand All @@ -37,8 +40,7 @@ const App = () => {
{
color: Color.purple,
type: 'custom',
message:
`Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
message: `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`,
Expand Down Expand Up @@ -80,7 +82,8 @@ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deseru

const _showAlertQueue = () => {
const types = ['info', 'warn', 'error', 'success', 'custom'];
const message = 'Officia eu do labore incididunt consequat sunt sint ullamco cillum.';
const message =
'Officia eu do labore incididunt consequat sunt sint ullamco cillum.';
let count = 1;
types.map(type => {
dropDownAlertRef.alertWithType(
Expand Down
2 changes: 1 addition & 1 deletion docs/PROPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
| Name | Type | Description | Default |
| ----------------------- | :----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `defaultContainer` | Object | Style for inner view container (**override paddingTop with this**) | `{ flexDirection: 'row', padding: 8 }` |
| `defaultTextContainer` | Object | Style for inner text container (holds title and message) | `{ flex: 1, padding: 8 }` |
| `defaultTextContainer` | Object | Style for inner text container (holds title and message) | `{ flex: 1, padding: 8 }` |
| `wrapperStyle` | Object | styles for the view that wraps the container. For [React Native Web](https://github.com/necolas/react-native-web) support you might want to set this to `{ position: 'fixed' }` | `null` |
| `containerStyle` | Object | styles for container for custom type only | `{ flexDirection: 'row', backgroundColor: '#202020' }` |
| `contentContainerStyle` | Object | styles for ContentView | `{ flex: 1, flexDirection: 'row' }` |
Expand Down

0 comments on commit 20d0ff8

Please sign in to comment.