-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: troubleshoot notification (#5198)
* navigation done * create the icon inside roomslistview, navigation to push troubleshot and layout push troubleshoot * custom header * fix the rooms list view header icon * layout done * update the pt-br i18n * tweak on colors
- Loading branch information
1 parent
37c58eb
commit d2d6fb8
Showing
13 changed files
with
314 additions
and
9 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
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
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
52 changes: 52 additions & 0 deletions
52
app/views/PushTroubleshootView/components/CustomListSection.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,52 @@ | ||
import React from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
|
||
import { Header } from '../../../containers/List'; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
marginBottom: 16 | ||
}, | ||
headerContainer: { | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
alignItems: 'center' | ||
}, | ||
statusContainer: { | ||
width: 10, | ||
height: 10, | ||
borderRadius: 5, | ||
marginRight: 12 | ||
} | ||
}); | ||
|
||
interface ICustomListSection { | ||
children: (React.ReactElement | null)[] | React.ReactElement | null; | ||
title: string; | ||
translateTitle?: boolean; | ||
statusColor?: string; | ||
} | ||
|
||
const CustomHeader = ({ | ||
title, | ||
translateTitle, | ||
statusColor | ||
}: { | ||
title: string; | ||
translateTitle?: boolean; | ||
statusColor?: string; | ||
}) => ( | ||
<View style={styles.headerContainer}> | ||
<Header {...{ title, translateTitle }} /> | ||
{statusColor ? <View style={[styles.statusContainer, { backgroundColor: statusColor }]} /> : null} | ||
</View> | ||
); | ||
|
||
const CustomListSection = ({ children, title, translateTitle, statusColor }: ICustomListSection) => ( | ||
<View style={styles.container}> | ||
{title ? <CustomHeader {...{ title, translateTitle, statusColor }} /> : null} | ||
{children} | ||
</View> | ||
); | ||
|
||
export default CustomListSection; |
47 changes: 47 additions & 0 deletions
47
app/views/PushTroubleshootView/components/ListPercentage.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,47 @@ | ||
import React from 'react'; | ||
import { StyleSheet, Text } from 'react-native'; | ||
|
||
import * as List from '../../../containers/List'; | ||
import { useTheme } from '../../../theme'; | ||
import sharedStyles from '../../Styles'; | ||
|
||
const styles = StyleSheet.create({ | ||
pickerText: { | ||
...sharedStyles.textRegular, | ||
fontSize: 16 | ||
} | ||
}); | ||
|
||
const ListPercentage = ({ | ||
value = 0, | ||
title, | ||
testID, | ||
onPress | ||
}: { | ||
title: string; | ||
testID: string; | ||
value: number; | ||
onPress: () => void; | ||
}) => { | ||
const { colors } = useTheme(); | ||
|
||
const percentage = `${Math.floor(value)}%`; | ||
let percentageTextColor = colors.statusFontOnSuccess; | ||
if (value > 70 && value < 90) { | ||
percentageTextColor = colors.statusFontOnWarning; | ||
} | ||
if (value >= 90) { | ||
percentageTextColor = colors.statusFontOnDanger; | ||
} | ||
|
||
return ( | ||
<List.Item | ||
title={title} | ||
testID={testID} | ||
onPress={onPress} | ||
right={() => <Text style={[styles.pickerText, { color: percentageTextColor }]}>{percentage}</Text>} | ||
/> | ||
); | ||
}; | ||
|
||
export default ListPercentage; |
Oops, something went wrong.