Skip to content

Commit

Permalink
storybook (#5598)
Browse files Browse the repository at this point in the history
  • Loading branch information
carocao-msft authored Jan 30, 2025
1 parent 9f8eff9 commit 2a16f41
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { CaptionsBanner, usePropsFor } from '@azure/communication-react';
import React from 'react';

export const CaptionsBannerStory = (): JSX.Element => {
/**
* This is a snippet for the CaptionsBanner component.
* For this snippet we set the isCaptionsOn and isRealTimeTextOn to true so the captions banner will be visible at all times with both functionalities enabled.
* Without setting the isCaptionsOn and isRealTimeTextOn to true, the captions banner will not be visible until start Captions is called or a first real time text message is received.
*/
const captionsBannerProps = usePropsFor(CaptionsBanner);
return (
<>
{(captionsBannerProps?.isCaptionsOn || captionsBannerProps?.isRealTimeTextOn) && (
<CaptionsBanner {...captionsBannerProps} />
)}
</>
);
return <CaptionsBanner {...captionsBannerProps} isCaptionsOn={true} isRealTimeTextOn={true} />;
};

0 comments on commit 2a16f41

Please sign in to comment.