-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: troubleshoot notification #5198
Merged
dnlsilva
merged 8 commits into
TC-782-Mobile-Troubleshoot-notifications
from
new.troubleshoot-notification-layout
Sep 28, 2023
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
289ce36
navigation done
reinaldonetof 51fb411
create the icon inside roomslistview, navigation to push troubleshot …
reinaldonetof 0f50243
custom header
reinaldonetof e65a468
fix the rooms list view header icon
reinaldonetof 727caf5
layout done
reinaldonetof 88f8459
update the pt-br i18n
reinaldonetof 478763a
Merge branch 'develop' into new.troubleshoot-notification-layout
reinaldonetof a9e3cd2
tweak on colors
reinaldonetof File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.pushConsumptionOnSuccess; | ||
if (value > 70 && value < 90) { | ||
percentageTextColor = colors.pushConsumptionOnWarning; | ||
} | ||
if (value >= 90) { | ||
percentageTextColor = colors.pushConsumptionOnDanger; | ||
} | ||
|
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use figma colors name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but there are already
successColor
anddangerColor
in this file, if I just addedonSuccess
oronDanger
it would be weird. ThedangerColor
is used in other places of the app and the difference between the names will be minimal, but there is a difference between the colors. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not strange, the right thing is to correct the mistake of the past and not make the same mistake again because it was wrong in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even a good thing would be to check the colors used in figma, Jose is using some deprecated colors, you could ask him to change and use the colors that are already in the new design system.