-
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
[IMPROVEMENT] Change bottom sheet lib #847
[IMPROVEMENT] Change bottom sheet lib #847
Conversation
@IlarionHalushka Cool!! The idea is to show an amount of items and let the user swipe up if he wants to show the rest. For small screens: the tallest person in the world can have the smallest device, so he still needs a way to tap on the buttons :) |
@IlarionHalushka this is how our design looks like for commands, autocomplete, etc: Use your lib with our design and you're fine :) |
@IlarionHalushka Looking so much better already! |
…-sheet' into issue-759-use-reanimated-bottom-sheet
Improved the transitions: https://drive.google.com/file/d/1V4JmmbyzgIqmTaLjBfdjbLdzMbvPF8Q1/view?usp=sharing |
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 tested locally on iOS and this PR is becoming "better and better" really :)
I'm missing this in Messagebox's autocomplete.
app/containers/MessageActions.js
Outdated
getPermalink = async(message) => { | ||
try { | ||
return await RocketChat.getPermalink(message); | ||
} catch (error) { | ||
return null; | ||
} | ||
} | ||
}; |
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.
Unnecessary semicolons in this file
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.
removed
app/containers/MessageActions.js
Outdated
const { actionsHide } = this.props; | ||
actionsHide(); | ||
hideActionSheet() { | ||
this.bottomSheetRef.current.snapTo(hiddenBottomSheet); |
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.
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.
fixed
app/containers/MessageActions.js
Outdated
render() { | ||
return ( | ||
null | ||
<BottomSheet |
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.
A backdrop is missing.
You can use something like this: https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/views/RoomsListView/SortDropdown.js#L121
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.
unfortunately the bottomsheet doesn't have function onPositionChange
or something similar, but I did manage to do backdrop using Animated.Code
app/views/RoomView/index.js
Outdated
@@ -131,6 +130,8 @@ export default class RoomView extends LoggedView { | |||
} else { | |||
EventEmitter.addEventListener('connected', this.handleConnected); | |||
} | |||
|
|||
navigation.addListener('willBlur', () => this.hideActionSheet()); |
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 think this is not needed as RoomView will be removed from the stack, but test it.
If it's necessary, check if it's opened and move it to componentWillUnmount
.
This is similar to editCancel
and replyCancel
.
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 necessary, because when I open Bottom Action Sheet in RoomView and then go to Threads Single View (thread chat) then ActionSheet is still displayed there and same happens when changing RoomViews(chats)
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.
And also I tried to move it to componentWillUnmount
but as we use StackNavigator - the view in not unmounted when opening Threads View or Settings view and bottom sheet stays constantly opened.
@@ -1684,20 +1693,32 @@ | |||
CLANG_CXX_LIBRARY = "libc++"; | |||
CLANG_ENABLE_MODULES = YES; | |||
CLANG_ENABLE_OBJC_ARC = YES; | |||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; |
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 think you all these CLANG*
are from your Xcode setup and shouldn't be commited.
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.
removed in latest commit
app/views/RoomView/index.js
Outdated
{room._id && showActions | ||
? <MessageActions room={room} user={user} /> | ||
{room._id | ||
? <MessageActions room={room} user={user} setRef={ref => this.setRef(ref)} /> |
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.
Creating arrow functions on render is a bad practice and it should be avoided.
This creates functions on every render.
You should always be using the class function directly like this:
setRef={this.setRef}
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.
did bind this.setRef
and then used like you suggested setRef={this.setRef}
@@ -22,6 +22,7 @@ | |||
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; | |||
24A2AEF2383D44B586D31C01 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 06BB44DD4855498082A744AD /* libz.tbd */; }; | |||
2C800DF680F8451599E80AF1 /* libSafariViewManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3BB00B9ABF44EA9BD71318 /* libSafariViewManager.a */; }; | |||
3EAC15CC2271955100AD43B2 /* libRNReanimated.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EAC15CB2271937800AD43B2 /* libRNReanimated.a */; }; |
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.
Am I wrong or did you tried to add reanimated from imports and from pods?
If I'm right, it's just a matter of changing Podfile
and lines like this one is trash.
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 did link the library manually using Xcode, but not sure what all these lines are about... :(
- remove unnecessary changes in IOS xcode files; - fix bug: 'When swiping to close RoomView on iOS'; - add backdrop; - bind 'this.setRef' so that function is not created on every render;
@IlarionHalushka can you resolve conflicts |
@IlarionHalushka the vibration are setting off immediately after opening the room and not after we long press to open the message action |
In my testing no button work https://drive.google.com/file/d/1k_GCnqwkCICWKUEjbR8iTuyOIpByAPAK/view?usp=sharing |
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 dont think we need the cancel button anymore
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.
covers full screen screen in landscape
its showing start all the time (unstar is not showing up) |
pin is not working |
1. 2. 3. 4. |
@RocketChat/ReactNative
Closes #759
This PR aims to replace Action Sheet with Reanimated Bottom Sheet on message actions.
As you could notice I am not a great designer so suggestions are welcome :)
big screen Iphone X:
small screen Iphone SE: