-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #762 from stasgm/old_selectors
chore: total in PalletView
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 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
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
45 changes: 45 additions & 0 deletions
45
apps/app-pallet/src/screens/Pallet/components/ViewTotal.tsx
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 @@ | ||
import React from 'react'; | ||
import { View, StyleSheet } from 'react-native'; | ||
import { globalStyles as styles, MediumText } from '@lib/mobile-ui'; | ||
import { Divider } from 'react-native-paper'; | ||
|
||
import { useTheme } from '@react-navigation/native'; | ||
|
||
export interface IItem { | ||
total?: number; | ||
scan?: boolean; | ||
} | ||
|
||
const ViewTotal = ({ total }: IItem) => { | ||
const { colors } = useTheme(); | ||
|
||
return ( | ||
<View> | ||
<Divider style={{ backgroundColor: colors.primary }} /> | ||
<View style={[localStyles.total, styles.directionRow]}> | ||
<View style={localStyles.groupWidth}> | ||
<MediumText style={styles.textTotal}>Итого: </MediumText> | ||
</View> | ||
<View style={localStyles.quantity}> | ||
<MediumText>{total || 0}</MediumText> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
export default ViewTotal; | ||
|
||
const localStyles = StyleSheet.create({ | ||
groupWidth: { | ||
width: '62%', | ||
}, | ||
quantity: { | ||
alignItems: 'flex-end', | ||
width: '35%', | ||
}, | ||
total: { | ||
margin: 5, | ||
alignItems: 'center', | ||
}, | ||
}); |