-
Notifications
You must be signed in to change notification settings - Fork 78
[Gallery layouts] Update storybook for gallery layouts #3616
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
Merged
dmceachernmsft
merged 17 commits into
main
from
dmceachernmsft/gallery-layout-storybook
Sep 27, 2023
Merged
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2b2ca1c
update storybook for gallery layouts
dmceachernmsft 0770950
Change files
dmceachernmsft 4a7fa51
Duplicate change files for beta release
dmceachernmsft d878f33
Merge branch 'main' into dmceachernmsft/gallery-layout-storybook
dmceachernmsft 7e0f89c
Update packages/storybook/stories/VideoGallery/VideoGallery.stories.tsx
dmceachernmsft 4928d8d
Update packages/storybook/stories/CallComposite/CallCompositeDocs.tsx
dmceachernmsft d1ed655
Merge branch 'main' into dmceachernmsft/gallery-layout-storybook
dmceachernmsft db0fd8a
add missing layout to storybook controls
dmceachernmsft 68d2a48
fix prettier
dmceachernmsft 606dbb2
videogallery QOL improvements
dmceachernmsft 71696ba
move layout state to composite
dmceachernmsft 30cbdd5
track overflow gallery position in composite
dmceachernmsft 0509114
fix build
dmceachernmsft 509e6d7
large gallery fixes
dmceachernmsft 506eed1
Merge branch 'main' of https://github.com/Azure/communication-ui-libr…
dmceachernmsft 05a4e3f
Merge branch 'main' into dmceachernmsft/gallery-layout-storybook
dmceachernmsft b238252
Merge branch 'main' into dmceachernmsft/gallery-layout-storybook
dmceachernmsft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
change-beta/@azure-communication-react-80f39aac-d334-4781-b857-56079cde393e.json
This file contains hidden or 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,9 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "area": "feature", | ||
| "workstream": "Gallery layouts", | ||
| "comment": "Introduce storybook docs for gallery layouts", | ||
| "packageName": "@azure/communication-react", | ||
| "email": "94866715+dmceachernmsft@users.noreply.github.com", | ||
| "dependentChangeType": "patch" | ||
| } |
9 changes: 9 additions & 0 deletions
9
change/@azure-communication-react-80f39aac-d334-4781-b857-56079cde393e.json
This file contains hidden or 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,9 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "area": "feature", | ||
| "workstream": "Gallery layouts", | ||
| "comment": "Introduce storybook docs for gallery layouts", | ||
| "packageName": "@azure/communication-react", | ||
| "email": "94866715+dmceachernmsft@users.noreply.github.com", | ||
| "dependentChangeType": "patch" | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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
62 changes: 62 additions & 0 deletions
62
packages/storybook/stories/VideoGallery/snippets/FocusedContent.snippet.tsx
This file contains hidden or 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,62 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { VideoGallery } from '@azure/communication-react'; | ||
| import { Stack } from '@fluentui/react'; | ||
| import React from 'react'; | ||
|
|
||
| const MockLocalParticipant = { | ||
| userId: 'user1', | ||
| displayName: 'You', | ||
| state: 'Connected', | ||
| isMuted: true | ||
| }; | ||
| const mockVideoElement = document.createElement('div'); | ||
| mockVideoElement.style.width = decodeURIComponent('100%25'); | ||
| mockVideoElement.style.height = decodeURIComponent('100%25'); | ||
| mockVideoElement.style.textAlign = 'center'; | ||
| const imageElement = document.createElement('img'); | ||
| imageElement.src = 'images/screenshare-example.png'; | ||
| imageElement.style.maxWidth = decodeURIComponent('100%25'); | ||
| imageElement.style.maxHeight = decodeURIComponent('100%25'); | ||
| mockVideoElement.appendChild(imageElement); | ||
| const mockScreenShareStream = { | ||
| isAvailable: true, | ||
| renderElement: mockVideoElement as HTMLElement | ||
| }; | ||
|
|
||
| const MockRemoteParticipants = [ | ||
| { | ||
| userId: 'user2', | ||
| displayName: 'Peter Parker', | ||
| isScreenSharingOn: true, | ||
| screenShareStream: mockScreenShareStream | ||
| }, | ||
| { | ||
| userId: 'user3', | ||
| displayName: 'Thor' | ||
| }, | ||
| { | ||
| userId: 'user4', | ||
| displayName: 'Matthew Murdock' | ||
| }, | ||
| { | ||
| userId: 'user5', | ||
| displayName: 'Bruce Wayne' | ||
| } | ||
| ]; | ||
|
|
||
| // This must be the only named export from this module, and must be named to match the storybook path suffix. | ||
| // This ensures that storybook hoists the story instead of creating a folder with a single entry. | ||
| export const FocusedContentExample: () => JSX.Element = () => { | ||
| const containerStyle = { height: '50vh' }; | ||
| return ( | ||
| <Stack style={containerStyle}> | ||
| <VideoGallery | ||
| layout="focusedContent" | ||
| localParticipant={MockLocalParticipant} | ||
| remoteParticipants={MockRemoteParticipants} | ||
| /> | ||
| </Stack> | ||
| ); | ||
| }; |
48 changes: 48 additions & 0 deletions
48
packages/storybook/stories/VideoGallery/snippets/SpeakerLayout.snippet.tsx
This file contains hidden or 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,48 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { VideoGallery } from '@azure/communication-react'; | ||
| import { Stack } from '@fluentui/react'; | ||
| import React from 'react'; | ||
|
|
||
| const MockLocalParticipant = { | ||
| userId: 'user1', | ||
| displayName: 'You', | ||
| state: 'Connected', | ||
| isMuted: true | ||
| }; | ||
|
|
||
| const MockRemoteParticipants = [ | ||
| { | ||
| userId: 'user2', | ||
| displayName: 'Peter Parker', | ||
| isSpeaking: true | ||
| }, | ||
| { | ||
| userId: 'user3', | ||
| displayName: 'Thor' | ||
| }, | ||
| { | ||
| userId: 'user4', | ||
| displayName: 'Matthew Murdock' | ||
| }, | ||
| { | ||
| userId: 'user5', | ||
| displayName: 'Bruce Wayne' | ||
| } | ||
| ]; | ||
|
|
||
| // This must be the only named export from this module, and must be named to match the storybook path suffix. | ||
| // This ensures that storybook hoists the story instead of creating a folder with a single entry. | ||
| export const SpeakerLayoutExample: () => JSX.Element = () => { | ||
| const containerStyle = { height: '50vh' }; | ||
| return ( | ||
| <Stack style={containerStyle}> | ||
| <VideoGallery | ||
| layout="speaker" | ||
| localParticipant={MockLocalParticipant} | ||
| remoteParticipants={MockRemoteParticipants} | ||
| /> | ||
| </Stack> | ||
| ); | ||
| }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.