Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8d65741
create new view for the composite
dmceachernmsft Sep 13, 2022
62b14b7
Add base component and strings
dmceachernmsft Sep 13, 2022
128a0ea
remove button
dmceachernmsft Sep 13, 2022
637b487
create new story files
dmceachernmsft Sep 13, 2022
20a53b9
add story book content and build
dmceachernmsft Sep 13, 2022
776332c
fix icons
dmceachernmsft Sep 14, 2022
0c639f5
Merge branch 'main' into dmceachernmsft/unsupportedBrowserUI
dmceachernmsft Sep 14, 2022
62275b3
move styles to own file
dmceachernmsft Sep 14, 2022
5fee8e3
Merge branch 'dmceachernmsft/unsupportedBrowserUI' of https://github.…
dmceachernmsft Sep 14, 2022
f4031f9
Merge branch 'main' into dmceachernmsft/unsupportedBrowserUI
dmceachernmsft Sep 14, 2022
4eb1fa0
add CC for unsupported browser
dmceachernmsft Sep 14, 2022
9d65d96
more CC work
dmceachernmsft Sep 14, 2022
0d3d0e1
Change files
dmceachernmsft Sep 14, 2022
f562e9a
fix linter errors
dmceachernmsft Sep 14, 2022
b508922
Merge branch 'main' into dmceachernmsft/unsupportedBrowserUI
dmceachernmsft Sep 14, 2022
e344c64
Merge branch 'main' into dmceachernmsft/unsupportedBrowserUI
dmceachernmsft Sep 14, 2022
81ecd76
make component beta
dmceachernmsft Sep 14, 2022
7084c58
remove console
dmceachernmsft Sep 14, 2022
26f9460
fix cc error
dmceachernmsft Sep 14, 2022
061a4a2
make supporting types interfaces
dmceachernmsft Sep 14, 2022
3a161f3
build API
dmceachernmsft Sep 14, 2022
26d9c62
Merge branch 'main' into dmceachernmsft/unsupportedBrowserUI
dmceachernmsft Sep 14, 2022
9478170
fix cc
dmceachernmsft Sep 14, 2022
4aea0e0
Merge branch 'main' of https://github.com/Azure/communication-ui-libr…
dmceachernmsft Sep 15, 2022
8a0b829
rebuild api
dmceachernmsft Sep 15, 2022
de34437
fix nits
dmceachernmsft Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ export interface ComponentStrings {
screenShareButton: ScreenShareButtonStrings;
sendBox: SendBoxStrings;
typingIndicator: TypingIndicatorStrings;
UnsupportedBrowser: UnsupportedBrowserStrings;
videoGallery: VideoGalleryStrings;
videoTile: VideoTileStrings;
}
Expand Down Expand Up @@ -1595,6 +1596,7 @@ export const DEFAULT_COMPONENT_ICONS: {
SendBoxSendHovered: JSX.Element;
VideoTileMicOff: JSX.Element;
BackSpace: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
};

// @public
Expand Down Expand Up @@ -1678,6 +1680,7 @@ export const DEFAULT_COMPOSITE_ICONS: {
HoldCallButton: JSX.Element;
ResumeCall: JSX.Element;
BackSpace: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
};

// @public
Expand Down Expand Up @@ -2758,6 +2761,22 @@ export interface TypingIndicatorStylesProps extends BaseCustomStyles {
typingUserDisplayName?: IStyle;
}

// @internal (undocumented)
export const _UnsupportedBrowser: (props: _UnsupportedBrowserProps) => JSX.Element;

// @internal (undocumented)
export type _UnsupportedBrowserProps = {
onTroubleShootingClick: () => void;
strings: UnsupportedBrowserStrings;
};

// @beta (undocumented)
export type UnsupportedBrowserStrings = {
primaryText: string;
secondaryText: string;
moreHelpLink: string;
};

// @public
export type UpdateMessageCallback = (messageId: string, content: string, metadata?: Record<string, string>, options?: {
attachedFilesMetadata?: FileMetadata[];
Expand Down
5 changes: 5 additions & 0 deletions packages/communication-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,8 @@ export type {
} from '../../chat-stateful-client/src';
export * from '../../react-composites/src/index-public';
export * from './mergedHooks';

/* @conditional-compile-remove(call-readiness) */
export { _UnsupportedBrowser } from '../../react-components/src';
/* @conditional-compile-remove(call-readiness) */
export type { UnsupportedBrowserStrings, _UnsupportedBrowserProps } from '../../react-components/src';
18 changes: 18 additions & 0 deletions packages/react-components/review/beta/react-components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export interface ComponentStrings {
screenShareButton: ScreenShareButtonStrings;
sendBox: SendBoxStrings;
typingIndicator: TypingIndicatorStrings;
UnsupportedBrowser: UnsupportedBrowserStrings;
videoGallery: VideoGalleryStrings;
videoTile: VideoTileStrings;
}
Expand Down Expand Up @@ -415,6 +416,7 @@ export const DEFAULT_COMPONENT_ICONS: {
SendBoxSendHovered: JSX.Element;
VideoTileMicOff: JSX.Element;
BackSpace: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
};

// @public
Expand Down Expand Up @@ -1355,6 +1357,22 @@ export interface TypingIndicatorStylesProps extends BaseCustomStyles {
typingUserDisplayName?: IStyle;
}

// @internal (undocumented)
export const _UnsupportedBrowser: (props: _UnsupportedBrowserProps) => JSX.Element;

// @internal (undocumented)
export type _UnsupportedBrowserProps = {
onTroubleShootingClick: () => void;
strings: UnsupportedBrowserStrings;
};

// @beta (undocumented)
export type UnsupportedBrowserStrings = {
primaryText: string;
secondaryText: string;
moreHelpLink: string;
};

// @public
export type UpdateMessageCallback = (messageId: string, content: string, metadata?: Record<string, string>, options?: {
attachedFilesMetadata?: FileMetadata[];
Expand Down
65 changes: 65 additions & 0 deletions packages/react-components/src/components/UnsupportedBrowser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { Icon, Link, Stack, Text } from '@fluentui/react';
import { _pxToRem } from '@internal/acs-ui-common';
import React from 'react';
/* @conditional-compile-remove(call-readiness) */
import { useLocale } from '../localization';
import {
containerStyles,
linkTextStyles,
mainTextStyles,
secondaryTextStyles
} from './styles/UnsupportedBrowser.styles';

/**
* @beta
*/
export type UnsupportedBrowserStrings = {
primaryText: string;
secondaryText: string;
moreHelpLink: string;
};

/**
* @internal
*/
export type _UnsupportedBrowserProps = {
onTroubleShootingClick: () => void;
strings: UnsupportedBrowserStrings;
};

/**
* @internal
*/
export const _UnsupportedBrowserContainer = (props: _UnsupportedBrowserProps): JSX.Element => {
const { onTroubleShootingClick, strings } = props;
console.log('test2');
Comment thread
dmceachernmsft marked this conversation as resolved.
Outdated
return (
<Stack styles={containerStyles}>
<Icon iconName="UnsupportedBrowserWarning"></Icon>
Comment thread
dmceachernmsft marked this conversation as resolved.
Outdated
<Text styles={mainTextStyles}>{strings.primaryText}</Text>
<Text styles={secondaryTextStyles}>{strings.secondaryText}</Text>
<Link
styles={linkTextStyles}
onClick={() => {
onTroubleShootingClick();
}}
>
{strings.moreHelpLink}
</Link>
</Stack>
);
};

/**
*
* @internal
*/
export const _UnsupportedBrowser = (props: _UnsupportedBrowserProps): JSX.Element => {
console.log('test1');
/* @conditional-compile-remove(call-readiness) */
const strings = useLocale().strings.UnsupportedBrowser;
return <_UnsupportedBrowserContainer {...props} strings={strings} />;
};
5 changes: 5 additions & 0 deletions packages/react-components/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,8 @@ export type { HoldButtonProps, HoldButtonStrings } from './HoldButton';

export { _LocalVideoTile } from './LocalVideoTile';
export { _RemoteVideoTile } from './RemoteVideoTile';

/* @conditional-compile-remove(call-readiness) */
export { _UnsupportedBrowser } from './UnsupportedBrowser';
/* @conditional-compile-remove(call-readiness) */
export type { UnsupportedBrowserStrings, _UnsupportedBrowserProps } from './UnsupportedBrowser';
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { ILinkStyles, IStackStyles, ITextStyles } from '@fluentui/react';
import { _pxToRem } from '@internal/acs-ui-common';

/**
* @internal
*/
export const mainTextStyles: ITextStyles = {
root: {
fontWeight: 600,
fontSize: _pxToRem(20),
lineHeight: _pxToRem(28),
paddingBottom: '1rem',
margin: 'auto'
}
};

/**
* @internal
*/
export const secondaryTextStyles: ITextStyles = {
root: {
margin: 'auto',
fontWeight: 400,
paddingBottom: '0.5rem'
}
};

/**
* @internal
*/
export const linkTextStyles: ILinkStyles = {
root: {
margin: 'auto',
fontWeight: 600,
textAlign: 'inherit'
}
};

/**
* @internal
*/
export const containerStyles: IStackStyles = {
root: {
padding: '2rem',
maxWidth: '25.374rem'
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
import { HoldButtonStrings } from '../components';
/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
import { DialpadStrings } from '../components';
/* @conditional-compile-remove(call-readiness) */
import { UnsupportedBrowserStrings } from '../components/UnsupportedBrowser';
/* @conditional-compile-remove(one-to-n-calling) */
// @conditional-compile-remove(PSTN-calls)
import { VideoTileStrings } from '../components/VideoTile';
Expand Down Expand Up @@ -84,6 +86,9 @@ export interface ComponentStrings {
/* @conditional-compile-remove(one-to-n-calling) */ /* @condtional-compile-remove(one-to-n-calling) */
/** Strings for HoldButton */
holdButton: HoldButtonStrings;
/* @conditional-compile-remove(call-readiness) */
/** Strings for unsupported browser UI */
UnsupportedBrowser: UnsupportedBrowserStrings;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,10 @@
"participantStateConnecting": "Calling...",
"participantStateRinging": "Calling...",
"participantStateHold": "On hold"
},
"UnsupportedBrowser": {
"primaryText": "Browser not supported",
"secondaryText": "Please join this call using a compatible browser.",
"moreHelpLink": "More help?"
}
}
45 changes: 43 additions & 2 deletions packages/react-components/src/theming/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { mergeStyles } from '@fluentui/react';
import { IStyle, mergeStyles, Stack, Theme } from '@fluentui/react';
import {
ArrowClockwise16Regular,
CallEnd20Filled,
Expand Down Expand Up @@ -49,7 +49,13 @@ import { ArrowDownload16Regular } from '@fluentui/react-icons';
/* @conditional-compile-remove(PSTN-calls) */
import { CallPause20Regular, CallPause20Filled, Play20Regular, People20Regular } from '@fluentui/react-icons';

/* @conditional-compile-remove(call-readiness) */
import { Warning20Filled } from '@fluentui/react-icons';
import { _pxToRem } from '@internal/acs-ui-common';

import React from 'react';
/* @conditional-compile-remove(call-readiness) */
import { useTheme } from './FluentThemeProvider';

/**
* Icons used by the React components exported from this library.
Expand All @@ -76,6 +82,28 @@ const MoreHorizontal18Regular = (): JSX.Element => (
</div>
);

const UnsupportedBrowserWarning = (): JSX.Element => {
const theme = useTheme();
return (
<Stack
horizontalAlign={'center'}
styles={{
root: {
width: _pxToRem(92),
borderRadius: '100%',
background: theme.palette.themeLighterAlt,
padding: '2rem',
margin: 'auto'
}
}}
>
<div className={mergeStyles(scaledIconStyles(theme))}>
<Warning20Filled />
</div>
</Stack>
);
};

/**
* The default set of icons that are available to use in the UI components.
*
Expand Down Expand Up @@ -142,5 +170,18 @@ export const DEFAULT_COMPONENT_ICONS = {
SendBoxSendHovered: <Send20Filled />,
VideoTileMicOff: <MicOff16Filled />,
/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
BackSpace: <Backspace20Regular />
BackSpace: <Backspace20Regular />,
/* @conditional-compile-remove(call-readiness) */
UnsupportedBrowserWarning: <UnsupportedBrowserWarning />
};

const scaledIconStyles = (theme: Theme): IStyle => {
return {
transform: 'scale(2)',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
color: theme.palette.themePrimary,
zIndex: 1
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ export const DEFAULT_COMPOSITE_ICONS: {
HoldCallButton: JSX.Element;
ResumeCall: JSX.Element;
BackSpace: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
};

// @public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import React from 'react';

/**
* @internal
*/
export type UnsupportedBrowserProps = {
onTroubleshootingClick: () => void;
// strings type from new component...
};

/**
*
* @internal
*/
export const UnsupportedBrowser = (props: UnsupportedBrowserProps): JSX.Element => {
return <></>;
};
Loading