-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(toolbar) Move getButtons to functions (#13502)
Move visible logic inside each button Move click functionality inside each button Extract getButtons function from Toolbox components to functions file
- Loading branch information
Showing
21 changed files
with
637 additions
and
726 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
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
26 changes: 26 additions & 0 deletions
26
react/features/reactions/components/web/RaiseHandContainerButtons.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,26 @@ | ||
import React from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
import { IReduxState } from '../../../app/types'; | ||
import { isMobileBrowser } from '../../../base/environment/utils'; | ||
import { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton'; | ||
import { isReactionsButtonEnabled, isReactionsEnabled } from '../../functions.web'; | ||
|
||
import RaiseHandButton from './RaiseHandButton'; | ||
import ReactionsMenuButton from './ReactionsMenuButton'; | ||
|
||
const RaiseHandContainerButton = (props: AbstractButtonProps) => { | ||
const reactionsButtonEnabled = useSelector(isReactionsButtonEnabled); | ||
const reactionsEnabled = useSelector(isReactionsEnabled); | ||
const isNarrowLayout = useSelector((state: IReduxState) => state['features/base/responsive-ui'].isNarrowLayout); | ||
const showReactionsAsPartOfRaiseHand | ||
= !reactionsButtonEnabled && reactionsEnabled && !isNarrowLayout && !isMobileBrowser(); | ||
|
||
return showReactionsAsPartOfRaiseHand | ||
? <ReactionsMenuButton | ||
{ ...props } | ||
showRaiseHand = { true } /> | ||
: <RaiseHandButton { ...props } />; | ||
}; | ||
|
||
export default RaiseHandContainerButton; |
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
Oops, something went wrong.