-
Notifications
You must be signed in to change notification settings - Fork 107
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
[#157929923] add-badge-messages #979
Changes from 3 commits
4fa82d7
2c986b9
1f775c1
4f7653e
cc4db3a
740cf3d
3c3eee9
c6076fa
d6c5379
c1c8ff7
1e29f4f
b5163eb
1715e8d
99c794d
571cefb
0e75fd4
31e64be
cb0706a
c6c1a47
15f204f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ import { MessageState } from "../../store/reducers/entities/messages/messagesByI | |
import { PaymentByRptIdState } from "../../store/reducers/entities/payments"; | ||
import { ServicesByIdState } from "../../store/reducers/entities/services/servicesById"; | ||
import { MessageListItemComponent } from "./MessageListItemComponent"; | ||
|
||
// tslint:disable-next-line: no-var-keyword | ||
var messagesToRead = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use vars, the tslint rule is there for a reason :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, can i use let? |
||
type OwnProps = { | ||
messages: ReadonlyArray<MessageState>; | ||
servicesById: ServicesByIdState; | ||
|
@@ -67,11 +68,13 @@ class MessageListComponent extends React.Component<Props> { | |
paymentByRptId, | ||
ListEmptyComponent | ||
} = this.props; | ||
|
||
const refreshControl = ( | ||
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} /> | ||
); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, i think i removed the line during implementing an other const that i removed later |
||
messagesToRead = messages.filter(obj => !obj.isRead).length; | ||
alert(messagesToRead); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's this alert? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was only for tests and I forgot to remove it |
||
|
||
return ( | ||
<FlatList | ||
contentContainerStyle={styles.contentContainerStyle} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why you removed the comment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I didn't even notice it. Most likely I removed it while importing a library There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still removed |
||
* Main navigator, handling the navigation within | ||
* the app *after* the login has occurred. This takes | ||
* care of displaying a tab navigator with the | ||
* appropriate icons | ||
*/ | ||
|
||
import { Badge, Right } from "native-base"; | ||
import * as React from "react"; | ||
import { Platform, StyleSheet, Text } from "react-native"; | ||
import { Platform, StyleSheet, Text, View } from "react-native"; | ||
|
||
import { | ||
createBottomTabNavigator, | ||
NavigationRoute, | ||
NavigationScreenProp, | ||
NavigationState, | ||
StackActions | ||
} from "react-navigation"; | ||
|
||
import IconFont from "../components/ui/IconFont"; | ||
import I18n from "../i18n"; | ||
import { makeFontStyleObject } from "../theme/fonts"; | ||
|
@@ -86,6 +80,27 @@ const styles = StyleSheet.create({ | |
shadowRadius: variables.footerShadowRadius, | ||
// Android shadow | ||
elevation: variables.footerElevation | ||
}, | ||
textBadgeStyle: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not used anymore? |
||
fontSize: 10, | ||
fontFamily: "Titillium Web", | ||
fontWeight: "bold", | ||
color: "white", | ||
flex: 1, | ||
position: "absolute", | ||
height: 19, | ||
width: 19, | ||
paddingLeft: 2 | ||
}, | ||
badgeStyle: { | ||
backgroundColor: variables.brandPrimary, | ||
borderColor: "white", | ||
borderWidth: 2, | ||
position: "absolute", | ||
elevation: 0.1, | ||
shadowColor: "white", | ||
height: 19, | ||
width: 19 | ||
} | ||
}); | ||
|
||
|
@@ -111,7 +126,6 @@ const getTabBarVisibility = ( | |
if (NoTabBarRoutes.indexOf(routeName) !== -1) { | ||
return false; | ||
} | ||
|
||
return true; | ||
}; | ||
|
||
|
@@ -165,11 +179,20 @@ const navigation = createBottomTabNavigator( | |
const { routeName } = nav.state; | ||
const iconName: string = getIcon(routeName); | ||
return ( | ||
<IconFont | ||
name={iconName} | ||
size={variables.iconSize3} | ||
color={options.tintColor === null ? undefined : options.tintColor} | ||
/> | ||
<View> | ||
{routeName === ROUTES.MESSAGES_NAVIGATOR ? ( | ||
<Right> | ||
<Badge style={styles.badgeStyle}> | ||
<Text style={styles.textBadgeStyle}>99</Text> | ||
</Badge> | ||
</Right> | ||
) : null} | ||
<IconFont | ||
name={iconName} | ||
size={variables.iconSize3} | ||
color={options.tintColor === null ? undefined : options.tintColor} | ||
/> | ||
</View> | ||
); | ||
}, | ||
tabBarOnPress: options => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1071,6 +1071,13 @@ | |
version "2.0.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since you didn't add any package, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @matgentili please check this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fpersico Can i remove yarn.lock ? I don't add any package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just revert the changes. |
||
resolved "https://registry.yarnpkg.com/@types/react-native-background-timer/-/react-native-background-timer-2.0.0.tgz#c44c57f8fbca9d9d5521fdd72a8f55232b79381e" | ||
|
||
"@types/react-native-elements@^0.18.0": | ||
version "0.18.0" | ||
resolved "https://registry.yarnpkg.com/@types/react-native-elements/-/react-native-elements-0.18.0.tgz#81cf92d75a5d9ed73599761da37bd2b05b107a91" | ||
integrity sha512-Tt0aq6HlN31Wexica9MwTwxnt46fLyx6yzMFJWPx2hqACrvBZfFTlwCoWMRa6ArR/kX3XJbAe6vKEBuZ08Zvtw== | ||
dependencies: | ||
react-native-elements "*" | ||
|
||
"@types/react-native-i18n@^2.0.0": | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/@types/react-native-i18n/-/react-native-i18n-2.0.0.tgz#2df92b3392d813b39530bd126aad429eedc9c3de" | ||
|
@@ -2633,6 +2640,14 @@ color@^3.0.0: | |
color-convert "^1.9.1" | ||
color-string "^1.5.2" | ||
|
||
color@^3.1.0: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/color/-/color-3.1.0.tgz#d8e9fb096732875774c84bf922815df0308d0ffc" | ||
integrity sha512-CwyopLkuRYO5ei2EpzpIh6LqJMt6Mt+jZhO5VI5f/wJLZriXQE32/SSqzmrh+QB+AZT81Cj8yv+7zwToW8ahZg== | ||
dependencies: | ||
color-convert "^1.9.1" | ||
color-string "^1.5.2" | ||
|
||
color@~1.0.3: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/color/-/color-1.0.3.tgz#e48e832d85f14ef694fb468811c2d5cfe729b55d" | ||
|
@@ -2996,6 +3011,11 @@ deep-is@~0.1.3: | |
version "0.1.3" | ||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" | ||
|
||
deepmerge@^3.1.0: | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e" | ||
integrity sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow== | ||
|
||
default-require-extensions@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" | ||
|
@@ -4199,6 +4219,13 @@ hoist-non-react-statics@^3.0.1: | |
dependencies: | ||
react-is "^16.3.2" | ||
|
||
hoist-non-react-statics@^3.1.0: | ||
version "3.3.0" | ||
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b" | ||
integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA== | ||
dependencies: | ||
react-is "^16.7.0" | ||
|
||
hoist-non-react-statics@^3.2.1: | ||
version "3.2.1" | ||
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.2.1.tgz#c09c0555c84b38a7ede6912b61efddafd6e75e1e" | ||
|
@@ -6677,6 +6704,11 @@ ono@^4.0.3, ono@^4.0.5: | |
dependencies: | ||
format-util "^1.0.3" | ||
|
||
opencollective-postinstall@^2.0.0: | ||
version "2.0.2" | ||
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" | ||
integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== | ||
|
||
opn@^3.0.2: | ||
version "3.0.3" | ||
resolved "https://registry.yarnpkg.com/opn/-/opn-3.0.3.tgz#b6d99e7399f78d65c3baaffef1fb288e9b85243a" | ||
|
@@ -7271,7 +7303,7 @@ react-is@^16.6.3: | |
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz#c1bd21c64f1f1364c6f70695ec02d69392f41bfa" | ||
integrity sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g== | ||
|
||
react-is@^16.8.3, react-is@^16.8.4: | ||
react-is@^16.7.0, react-is@^16.8.3, react-is@^16.8.4: | ||
version "16.8.6" | ||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" | ||
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== | ||
|
@@ -7328,6 +7360,19 @@ [email protected]: | |
dependencies: | ||
lodash "4.17.11" | ||
|
||
react-native-elements@*: | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/react-native-elements/-/react-native-elements-1.1.0.tgz#f99bcda4459a886f3ab4591c684c099d37aedf2b" | ||
integrity sha512-n1eOL0kUdlH01zX7bn1p7qhYXn7kquqxYQ0oWlxoAck9t5Db/KeK5ViOsAk8seYSvAG6Pe7OxgzRFnMfFhng0Q== | ||
dependencies: | ||
color "^3.1.0" | ||
deepmerge "^3.1.0" | ||
hoist-non-react-statics "^3.1.0" | ||
opencollective-postinstall "^2.0.0" | ||
prop-types "^15.5.8" | ||
react-native-ratings "^6.3.0" | ||
react-native-status-bar-height "^2.2.0" | ||
|
||
[email protected]: | ||
version "2.10.0" | ||
resolved "https://registry.yarnpkg.com/react-native-exception-handler/-/react-native-exception-handler-2.10.0.tgz#0d828a4f2c7c4469a2929fa46d20535def726903" | ||
|
@@ -7408,6 +7453,14 @@ react-native-qrcode-scanner@^1.1.0: | |
prop-types "^15.5.10" | ||
react-native-permissions "^1.1.1" | ||
|
||
react-native-ratings@^6.3.0: | ||
version "6.3.1" | ||
resolved "https://registry.yarnpkg.com/react-native-ratings/-/react-native-ratings-6.3.1.tgz#4e4bd87f376423dc62c933f570fc1932c78adaa4" | ||
integrity sha512-+WEtk4wPvnoN5YbfWcmyM4LpKOlvkrFlpQe0KrqeWBAOkN6OXOZYBtiCh97dCIb8Ovpm7goOEcTf3T1MGCi2LA== | ||
dependencies: | ||
lodash "^4.17.4" | ||
prop-types "^15.5.10" | ||
|
||
react-native-safe-area-view@^0.12.0: | ||
version "0.12.0" | ||
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.12.0.tgz#5c312f087300ecf82e8541c3eac25d560e147f22" | ||
|
@@ -7430,6 +7483,11 @@ react-native-splash-screen@^3.2.0: | |
resolved "https://registry.yarnpkg.com/react-native-splash-screen/-/react-native-splash-screen-3.2.0.tgz#d47ec8557b1ba988ee3ea98d01463081b60fff45" | ||
integrity sha512-Ls9qiNZzW/OLFoI25wfjjAcrf2DZ975hn2vr6U9gyuxi2nooVbzQeFoQS5vQcbCt9QX5NY8ASEEAtlLdIa6KVg== | ||
|
||
react-native-status-bar-height@^2.2.0: | ||
version "2.3.1" | ||
resolved "https://registry.yarnpkg.com/react-native-status-bar-height/-/react-native-status-bar-height-2.3.1.tgz#b92ce9112c2367290847ac11284d9d84a6330169" | ||
integrity sha512-m9nGKYfFn6ljF1abafzF5cFaD9JCzXwj7kNE9CuF+g0TgtItH70eY2uHaCV9moENTftqd5XIS3Cx0mf4WfistA== | ||
|
||
react-native-svg@^6.5.3: | ||
version "6.5.3" | ||
resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-6.5.3.tgz#44004c4cdc4a289acb613d718eda6f80e0c5a026" | ||
|
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.
this need to be removed too
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.
Ok