ordering-ui-react-native 0.23.96 → 0.23.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,12 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const HelpSubItem = styled.TouchableOpacity`
4
- border-bottom-color: #E9ECEF;
4
+ border-bottom-color: ${(props: any) => props.theme.colors.border};
5
5
  border-bottom-width: 1px;
6
6
  padding-vertical: 15px;
7
+ flex-direction: row;
8
+ justify-content: space-between;
9
+ align-items: center;
7
10
  `
8
11
 
9
12
  export const LastOrdersContainer = styled.View`
@@ -0,0 +1,44 @@
1
+ import React from 'react'
2
+ import { Dimensions, Platform } from 'react-native'
3
+ import { WebView } from 'react-native-webview'
4
+ import { useLanguage } from 'ordering-components/native'
5
+
6
+ import { Container } from '../../layouts/Container'
7
+ import { NotFoundSource } from '../NotFoundSource'
8
+ import NavBar from '../NavBar'
9
+
10
+ const HEIGHT_SCREEN = Dimensions.get('screen').height
11
+
12
+ export const HelpOptions = (props: any) => {
13
+ const { item, goToBack } = props
14
+ const [, t] = useLanguage()
15
+
16
+ return (
17
+ <Container
18
+ pt={Platform.OS === 'ios' ? 20 : 10}
19
+ noPadding
20
+ >
21
+ <NavBar
22
+ title={t('HELP', 'Help')}
23
+ titleAlign={'center'}
24
+ onActionLeft={goToBack}
25
+ showCall={false}
26
+ btnStyle={{ paddingLeft: 0 }}
27
+ />
28
+ {!!item?.body && (
29
+ <WebView
30
+ originWhitelist={['*']}
31
+ automaticallyAdjustContentInsets={false}
32
+ source={{ html: item.body }}
33
+ style={{ flex: 1, height: HEIGHT_SCREEN }}
34
+ />
35
+ )}
36
+ {!item?.body && (
37
+ <NotFoundSource
38
+ simple
39
+ content={t('NO_CONTENT_TO_SHOW', 'Nothing to show')}
40
+ />
41
+ )}
42
+ </Container>
43
+ )
44
+ }
@@ -5,48 +5,49 @@ import { NotFoundSourceParams } from '../../types'
5
5
  import { useTheme } from 'styled-components/native';
6
6
  import Foundation from 'react-native-vector-icons/Foundation'
7
7
  import {
8
- NotFound,
9
- NotFoundImage
8
+ NotFound,
9
+ NotFoundImage
10
10
  } from './styles'
11
11
 
12
12
  export const NotFoundSource = (props: NotFoundSourceParams) => {
13
- const {
14
- hideImage,
15
- content,
16
- btnTitle,
17
- btnStyle,
18
- conditioned,
19
- onClickButton
20
- } = props
13
+ const {
14
+ hideImage,
15
+ content,
16
+ btnTitle,
17
+ btnStyle,
18
+ conditioned,
19
+ onClickButton,
20
+ simple
21
+ } = props
21
22
 
22
- const theme = useTheme();
23
+ const theme = useTheme();
23
24
 
24
- return (
25
- <NotFound>
26
- {!hideImage && (
27
- <NotFoundImage>
28
- <Foundation
29
- name='page-search'
30
- color={theme.colors.primary}
31
- size={60}
32
- style={{ marginBottom: 10 }}
33
- />
34
- </NotFoundImage>
35
- )}
36
- {content && conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
37
- {content && !conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
38
- {!onClickButton && props.children && (
39
- props.children
40
- )}
41
- {onClickButton && (
42
- <View style={{ marginTop: 10, width: '100%' }}>
43
- <OButton
44
- style={{ width: '100%', height: 50, ...btnStyle }}
45
- onClick={() => onClickButton()}
46
- text={btnTitle}
47
- />
48
- </View>
49
- )}
50
- </NotFound>
51
- )
25
+ return (
26
+ <NotFound simple={simple}>
27
+ {!hideImage && !simple && (
28
+ <NotFoundImage>
29
+ <Foundation
30
+ name='page-search'
31
+ color={theme.colors.primary}
32
+ size={60}
33
+ style={{ marginBottom: 10 }}
34
+ />
35
+ </NotFoundImage>
36
+ )}
37
+ {content && conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
38
+ {content && !conditioned && <OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>{content}</OText>}
39
+ {!onClickButton && props.children && (
40
+ props.children
41
+ )}
42
+ {onClickButton && (
43
+ <View style={{ marginTop: 10, width: '100%' }}>
44
+ <OButton
45
+ style={{ width: '100%', height: 50, ...btnStyle }}
46
+ onClick={() => onClickButton()}
47
+ text={btnTitle}
48
+ />
49
+ </View>
50
+ )}
51
+ </NotFound>
52
+ )
52
53
  }
@@ -1,14 +1,23 @@
1
- import styled from 'styled-components/native'
1
+ import styled, { css } from 'styled-components/native'
2
2
 
3
3
  export const NotFound = styled.View`
4
- display: flex;
5
- flex-direction: column;
6
- justify-content: center;
7
- align-items: center;
8
- width: 100%;
9
- height: auto;
10
- margin: 10px auto;
11
- padding: 10px;
4
+ ${(props: any) => props.simple
5
+ ? css`
6
+ background-color: ${(props: any) => props.theme.colors?.white};
7
+ border-radius: 10px;
8
+ padding: 15px;
9
+ padding-horizontal: 20px;
10
+ border: 1px ${(props: any) => props.theme.colors?.border};
11
+ ` : css`
12
+ display: flex;
13
+ flex-direction: column;
14
+ justify-content: center;
15
+ align-items: center;
16
+ width: 100%;
17
+ height: auto;
18
+ margin: auto auto;
19
+ padding: 10px;
20
+ `}
12
21
  `
13
22
 
14
23
  export const NotFoundImage = styled.View`