[IMPROVEMENT] Close announcement banner#2064
Merged
diegolmello merged 8 commits intoRocketChat:developfrom May 8, 2020
Merged
Conversation
Signed-off-by: Ezequiel De Oliveira <[email protected]>
Signed-off-by: Ezequiel De Oliveira <[email protected]>
Signed-off-by: Ezequiel De Oliveira <[email protected]>
Signed-off-by: Ezequiel De Oliveira <[email protected]>
djorkaeffalexandre
suggested changes
Apr 27, 2020
app/constants/colors.js
Outdated
| buttonBackground: '#414852', | ||
| buttonText: '#ffffff' | ||
| buttonText: '#ffffff', | ||
| bannerIcon: '#6d6d72' |
Contributor
There was a problem hiding this comment.
Instead of create a new color, I think you can use auxiliaryText, as on other places, or change all places that describe a cross icon to use a new color declared here.
app/views/RoomView/index.js
Outdated
Comment on lines
+822
to
+824
| const db = database.active; | ||
| const subCollection = db.collections.get('subscriptions'); | ||
| const newRoom = await subCollection.find(rid); |
Contributor
There was a problem hiding this comment.
You don't need to fetch this from database, this.state.room is a database reference, you can use this directly.
Comment on lines
+125
to
+129
| if (subscription.announcement) { | ||
| if (subscription.announcement !== sub.announcement) { | ||
| s.bannerClosed = false; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
I think you need some logic like this on findSubscriptionsRooms, try the follow steps and you'll able to see an error:
- Close the banner
- Close the app
- Change the announcement on other client (Web/Desktop)
- Open the app again
- Banner isn't showed
app/views/RoomView/Banner.js
Outdated
| onPress={closeBanner} | ||
| > | ||
| <CustomIcon | ||
| style={styles.icon} |
app/views/RoomView/styles.js
Outdated
| paddingVertical: 12, | ||
| paddingHorizontal: 15, | ||
| alignItems: 'center' | ||
| display: 'flex', |
app/views/RoomView/styles.js
Outdated
| width: 22, | ||
| height: 22 | ||
| }, | ||
| textContainer: { |
Contributor
app/views/RoomView/styles.js
Outdated
Comment on lines
+73
to
+76
| icon: { | ||
| width: 22, | ||
| height: 22 | ||
| }, |
Contributor
There was a problem hiding this comment.
Can be removed.
Signed-off-by: Ezequiel De Oliveira <[email protected]>
Contributor
Author
|
The requested changes are ready. |
8cb4493 to
b983756
Compare
diegolmello
added a commit
that referenced
this pull request
May 25, 2020

@RocketChat/ReactNative
This PR adds a feature to close the banner on top of Room View.
When someone change the room's announcement, The banner return to the top.