-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a custom styled ControlBar example to e2e samples (#1288)
* Add boilerplate for custom styled component example * Add custom styled component buttons for e2e testing * Update js bundle automation snapshots Co-authored-by: edwardlee-msft <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
69e789e
commit bc9764e
Showing
4 changed files
with
43 additions
and
0 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
41 changes: 41 additions & 0 deletions
41
samples/ComponentExamples/src/examples/StyledControlBarExample.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,41 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
import { | ||
CameraButton, | ||
ControlBar, | ||
ControlBarButtonStyles, | ||
DevicesButton, | ||
EndCallButton, | ||
MicrophoneButton, | ||
ScreenShareButton, | ||
usePropsFor | ||
} from '@azure/communication-react'; | ||
import React from 'react'; | ||
|
||
export const StyledControlBarExample = (): JSX.Element => { | ||
const cameraButtonProps = usePropsFor(CameraButton); | ||
const microphoneButtonProps = usePropsFor(MicrophoneButton); | ||
const screenShareButtonProps = usePropsFor(ScreenShareButton); | ||
const deviceButtonProps = usePropsFor(DevicesButton); | ||
const endCallButtonProps = usePropsFor(EndCallButton); | ||
|
||
const controlBarButtonStyle: ControlBarButtonStyles = { | ||
root: { | ||
background: '#ffff00' | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<h3>An example of custom sytled Call ControlBar:</h3> | ||
<br /> | ||
<ControlBar layout={'horizontal'}> | ||
<CameraButton styles={controlBarButtonStyle} {...cameraButtonProps} /> | ||
<MicrophoneButton styles={controlBarButtonStyle} {...microphoneButtonProps} /> | ||
<ScreenShareButton styles={controlBarButtonStyle} {...screenShareButtonProps} /> | ||
<DevicesButton styles={controlBarButtonStyle} {...deviceButtonProps} /> | ||
<EndCallButton styles={controlBarButtonStyle} {...endCallButtonProps} /> | ||
</ControlBar> | ||
</> | ||
); | ||
}; |
Binary file modified
BIN
+7.02 KB
(110%)
...amples.test.ts-snapshots/componentExamples-localVideoStarted-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.06 KB
(110%)
...amples.test.ts-snapshots/componentExamples-localVideoStopped-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.