forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RN] Implement a new UI for the Toolbox
- 5 buttons in the (now single) toolbar - Overflow menu in the form of a BottomSheet - Filmstrip on the right when in wide mode
- Loading branch information
Showing
9 changed files
with
407 additions
and
307 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// @flow | ||
|
||
import React, { Component } from 'react'; | ||
import { connect } from 'react-redux'; | ||
|
||
import { hideDialog, BottomSheet } from '../../../base/dialog'; | ||
import { AudioRouteButton } from '../../../mobile/audio-mode'; | ||
import { PictureInPictureButton } from '../../../mobile/picture-in-picture'; | ||
import { RoomLockButton } from '../../../room-lock'; | ||
|
||
import AudioOnlyButton from './AudioOnlyButton'; | ||
import ToggleCameraButton from './ToggleCameraButton'; | ||
|
||
import { overflowMenuItemStyles } from './styles'; | ||
|
||
type Props = { | ||
|
||
/** | ||
* Used for hiding the dialog when the selection was completed. | ||
*/ | ||
dispatch: Function, | ||
}; | ||
|
||
/** | ||
* The exported React {@code Component}. We need a reference to the wrapped | ||
* component in order to be able to hide it using the dialog hiding logic. | ||
*/ | ||
|
||
// eslint-disable-next-line prefer-const | ||
let OverflowMenu_; | ||
|
||
/** | ||
* Implements a React {@code Component} with some extra actions in addition to | ||
* those in the toolbar. | ||
*/ | ||
class OverflowMenu extends Component<Props> { | ||
/** | ||
* Initializes a new {@code OverflowMenu} instance. | ||
* | ||
* @inheritdoc | ||
*/ | ||
constructor(props: Props) { | ||
super(props); | ||
|
||
this._onCancel = this._onCancel.bind(this); | ||
} | ||
|
||
/** | ||
* Implements React's {@link Component#render()}. | ||
* | ||
* @inheritdoc | ||
* @returns {ReactElement} | ||
*/ | ||
render() { | ||
return ( | ||
<BottomSheet onCancel = { this._onCancel }> | ||
<AudioRouteButton | ||
showLabel = { true } | ||
styles = { overflowMenuItemStyles } /> | ||
<ToggleCameraButton | ||
showLabel = { true } | ||
styles = { overflowMenuItemStyles } /> | ||
<AudioOnlyButton | ||
showLabel = { true } | ||
styles = { overflowMenuItemStyles } /> | ||
<RoomLockButton | ||
showLabel = { true } | ||
styles = { overflowMenuItemStyles } /> | ||
<PictureInPictureButton | ||
showLabel = { true } | ||
styles = { overflowMenuItemStyles } /> | ||
</BottomSheet> | ||
); | ||
} | ||
|
||
_onCancel: () => void; | ||
|
||
/** | ||
* Hides the dialog. | ||
* | ||
* @private | ||
* @returns {void} | ||
*/ | ||
_onCancel() { | ||
this.props.dispatch(hideDialog(OverflowMenu_)); | ||
} | ||
} | ||
|
||
OverflowMenu_ = connect()(OverflowMenu); | ||
|
||
export default OverflowMenu_; |
39 changes: 39 additions & 0 deletions
39
react/features/toolbox/components/native/OverflowMenuButton.js
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,39 @@ | ||
// @flow | ||
|
||
import { connect } from 'react-redux'; | ||
|
||
import { openDialog } from '../../../base/dialog'; | ||
import { translate } from '../../../base/i18n'; | ||
import { AbstractButton } from '../../../base/toolbox'; | ||
import type { AbstractButtonProps } from '../../../base/toolbox'; | ||
|
||
import OverflowMenu from './OverflowMenu'; | ||
|
||
type Props = AbstractButtonProps & { | ||
|
||
/** | ||
* The redux {@code dispatch} function. | ||
*/ | ||
dispatch: Function | ||
} | ||
|
||
/** | ||
* An implementation of a button for showing the {@code OverflowMenu}. | ||
*/ | ||
class OverflowMenuButton extends AbstractButton<Props, *> { | ||
accessibilityLabel = 'Overflow menu'; | ||
iconName = 'icon-thumb-menu'; | ||
label = 'toolbar.moreActions'; | ||
|
||
/** | ||
* Handles clicking / pressing the button. | ||
* | ||
* @private | ||
* @returns {void} | ||
*/ | ||
_handleClick() { | ||
this.props.dispatch(openDialog(OverflowMenu)); | ||
} | ||
} | ||
|
||
export default translate(connect()(OverflowMenuButton)); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.