File tree Expand file tree Collapse file tree 8 files changed +55
-81
lines changed
packages/components/modules
RoomsList/EmptyChatRoomsState Expand file tree Collapse file tree 8 files changed +55
-81
lines changed Original file line number Diff line number Diff line change 1+ import { Text } from '@baseapp-frontend/design-system/components/native/typographies'
2+ import { View } from '@baseapp-frontend/design-system/components/native/views'
3+ import { useTheme } from '@baseapp-frontend/design-system/providers/native'
4+
5+ import { createStyles } from './styles'
6+ import { EmptyViewProps } from './types'
7+
8+ const EmptyView = ( { icon, title, message } : EmptyViewProps ) => {
9+ const theme = useTheme ( )
10+ const styles = createStyles ( theme )
11+
12+ return (
13+ < View style = { styles . container } >
14+ { icon && < View style = { styles . imageWrapper } > { icon } </ View > }
15+ < View style = { styles . textWrapper } >
16+ { title && (
17+ < Text variant = "subtitle2" style = { styles . text } >
18+ { title }
19+ </ Text >
20+ ) }
21+ { message && (
22+ < Text variant = "caption" style = { styles . text } >
23+ { message }
24+ </ Text >
25+ ) }
26+ </ View >
27+ </ View >
28+ )
29+ }
30+
31+ export default EmptyView
File renamed without changes.
Original file line number Diff line number Diff line change 1+ import { ReactNode } from 'react'
2+
3+ import { StyleProp , ViewStyle } from 'react-native'
4+
5+ export interface EmptyViewProps {
6+ icon ?: ReactNode
7+ title : string
8+ message ?: string
9+ style ?: StyleProp < ViewStyle >
10+ }
Original file line number Diff line number Diff line change 1+ export { default as EmptyView } from './EmptyView'
2+ export type * from './EmptyView/types'
Original file line number Diff line number Diff line change 11import { SocialMediaDiscussionImage } from '@baseapp-frontend/design-system/components/native/illustrations'
2- import { Text } from '@baseapp-frontend/design-system/components/native/typographies'
3- import { View } from '@baseapp-frontend/design-system/components/native/views'
4- import { useTheme } from '@baseapp-frontend/design-system/providers/native'
52
6- import { createStyles } from './styles '
3+ import { EmptyView } from '../../../../__shared__/native '
74
8- const EmptyChatRoomsState = ( ) => {
9- const theme = useTheme ( )
10- const styles = createStyles ( theme )
11-
12- return (
13- < View style = { styles . container } >
14- < View style = { styles . imageWrapper } >
15- < SocialMediaDiscussionImage />
16- </ View >
17- < View style = { styles . textWrapper } >
18- < Text variant = "subtitle2" style = { styles . text } >
19- No messages to be displayed.
20- </ Text >
21- </ View >
22- </ View >
23- )
24- }
5+ const EmptyChatRoomsState = ( ) => (
6+ < EmptyView icon = { < SocialMediaDiscussionImage /> } title = "No messages to be displayed." />
7+ )
258
269export default EmptyChatRoomsState
Original file line number Diff line number Diff line change 11import { SearchingImage } from '@baseapp-frontend/design-system/components/native/illustrations'
2- import { Text } from '@baseapp-frontend/design-system/components/native/typographies'
3- import { View } from '@baseapp-frontend/design-system/components/native/views'
4- import { useTheme } from '@baseapp-frontend/design-system/providers/native'
52
6- import { createStyles } from './styles'
7- import { SearchNotFoundStateProps } from './types'
3+ import { EmptyView } from '../../../__shared__/native'
84
9- const SearchNotFoundState = ( {
10- message = 'Check your spelling or try another search.' ,
11- } : SearchNotFoundStateProps ) => {
12- const theme = useTheme ( )
13- const styles = createStyles ( theme )
14-
15- return (
16- < View style = { styles . container } >
17- < View style = { styles . imageWrapper } >
18- < SearchingImage />
19- </ View >
20- < View style = { styles . textWrapper } >
21- < Text variant = "subtitle2" style = { styles . text } >
22- No results found
23- </ Text >
24- < Text variant = "caption" style = { styles . text } >
25- { message }
26- </ Text >
27- </ View >
28- </ View >
29- )
30- }
5+ const SearchNotFoundState = ( ) => (
6+ < EmptyView
7+ icon = { < SearchingImage /> }
8+ title = "No results found"
9+ message = "Check your spelling or try another search."
10+ />
11+ )
3112
3213export default SearchNotFoundState
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments