forked from mattermost/mattermost-plugin-msteams
-
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.
[MI-3842]: Review fixes frontend phase 1
- Loading branch information
1 parent
20e6f16
commit e76a2b0
Showing
26 changed files
with
150 additions
and
420 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export default 'SvgrURL'; | ||
export const ReactComponent = 'div'; |
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 |
---|---|---|
@@ -1,35 +1,30 @@ | ||
import React from 'react'; | ||
import {useDispatch} from 'react-redux'; | ||
|
||
import {Dialog as MMDialog, LinearProgress, DialogProps} from '@brightscout/mattermost-ui-library'; | ||
|
||
import usePluginApi from 'hooks/usePluginApi'; | ||
import {getDialogState} from 'selectors'; | ||
import {closeDialog} from 'reducers/dialog'; | ||
|
||
export const Dialog = ({onCloseHandler, onSubmitHandler}: Pick<DialogProps, 'onCloseHandler' | 'onSubmitHandler'>) => { | ||
const dispatch = useDispatch(); | ||
const {state} = usePluginApi(); | ||
const {show, title, description, destructive, primaryButtonText, secondaryButtonText, isLoading} = getDialogState(state); | ||
|
||
const handleClose = () => dispatch(closeDialog()); | ||
|
||
return ( | ||
<MMDialog | ||
description={description} | ||
destructive={destructive} | ||
show={show} | ||
primaryButtonText={primaryButtonText} | ||
secondaryButtonText={secondaryButtonText} | ||
onCloseHandler={() => { | ||
handleClose(); | ||
onCloseHandler(); | ||
}} | ||
onSubmitHandler={onSubmitHandler} | ||
className='disconnect-dialog' | ||
title={title} | ||
> | ||
{isLoading && <LinearProgress/>} | ||
</MMDialog> | ||
); | ||
}; | ||
export const Dialog = ({ | ||
show, | ||
title, | ||
destructive, | ||
primaryButtonText, | ||
secondaryButtonText, | ||
onSubmitHandler, | ||
onCloseHandler, | ||
children, | ||
isLoading, | ||
className, | ||
}: DialogProps & {isLoading?: boolean, children: React.ReactNode}) => ( | ||
<MMDialog | ||
show={show} | ||
destructive={destructive} | ||
primaryButtonText={primaryButtonText} | ||
secondaryButtonText={secondaryButtonText} | ||
onCloseHandler={() => onCloseHandler()} | ||
onSubmitHandler={onSubmitHandler} | ||
className={className} | ||
title={title} | ||
> | ||
{isLoading && <LinearProgress className='absolute w-full left-0 top-62'/>} | ||
{children} | ||
</MMDialog> | ||
); |
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
Oops, something went wrong.