-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added component to conditionally render empty state of search results (…
- Loading branch information
1 parent
0b5dcba
commit af5be82
Showing
7 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* @flow */ | ||
import React from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
import { ZulipButton, Label } from './'; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
padding: 16, | ||
marginTop: 10, | ||
}, | ||
text: { | ||
fontSize: 18, | ||
textAlign: 'center', | ||
}, | ||
button: { | ||
marginTop: 15, | ||
fontSize: 12, | ||
}, | ||
}); | ||
|
||
export default class SearchEmptyState extends React.PureComponent { | ||
props: { | ||
text?: string, | ||
buttonText?: string, | ||
buttonAction?: () => void, | ||
}; | ||
|
||
static defaultProps = { | ||
text: 'No Results', | ||
buttonText: 'Show All', | ||
}; | ||
|
||
render() { | ||
const { text, buttonText, buttonAction } = this.props; | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Label style={styles.text} text={text} /> | ||
{buttonAction && | ||
<ZulipButton style={styles.button} secondary text={buttonText} onPress={buttonAction} />} | ||
</View> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters