Skip to content

Commit

Permalink
Update ControlBar and PreJoin props
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocupe committed Nov 6, 2023
1 parent e3994a1 commit 7416860
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions packages/react/etc/components-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export interface ConnectionStatusProps extends React_2.HTMLAttributes<HTMLDivEle
}

// @public
export function ControlBar({ variation, controls, saveDeviceSettings, ...props }: ControlBarProps): React_2.JSX.Element;
export function ControlBar({ variation, controls, saveUserChoices, ...props }: ControlBarProps): React_2.JSX.Element;

// @public (undocumented)
export type ControlBarControls = {
Expand All @@ -198,7 +198,8 @@ export type ControlBarControls = {
export interface ControlBarProps extends React_2.HTMLAttributes<HTMLDivElement> {
// (undocumented)
controls?: ControlBarControls;
saveDeviceSettings?: boolean;
// @alpha
saveUserChoices?: boolean;
// (undocumented)
variation?: 'minimal' | 'verbose' | 'textOnly';
}
Expand Down Expand Up @@ -426,7 +427,7 @@ export interface ParticipantTileProps extends React_2.HTMLAttributes<HTMLDivElem
}

// @public
export function PreJoin({ defaults, onValidate, onSubmit, onError, debug, joinLabel, micLabel, camLabel, userLabel, showE2EEOptions, saveDeviceSettings, ...htmlProps }: PreJoinProps): React_2.JSX.Element;
export function PreJoin({ defaults, onValidate, onSubmit, onError, debug, joinLabel, micLabel, camLabel, userLabel, showE2EEOptions, persistUserChoices, ...htmlProps }: PreJoinProps): React_2.JSX.Element;

// @public
export interface PreJoinProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onSubmit' | 'onError'> {
Expand All @@ -442,7 +443,8 @@ export interface PreJoinProps extends Omit<React_2.HTMLAttributes<HTMLDivElement
onError?: (error: Error) => void;
onSubmit?: (values: LocalUserChoices) => void;
onValidate?: (values: LocalUserChoices) => boolean;
saveDeviceSettings?: boolean;
// @alpha
persistUserChoices?: boolean;
// (undocumented)
showE2EEOptions?: boolean;
// (undocumented)
Expand Down Expand Up @@ -830,7 +832,7 @@ export interface UseParticipantTileProps<T extends HTMLElement> extends React_2.

// @alpha
export function usePersistentUserChoices(options?: UsePersistentUserChoicesOptions): {
deviceSettings: UserChoices;
userChoices: UserChoices;
saveAudioInputEnabled: (isEnabled: boolean) => void;
saveVideoInputEnabled: (isEnabled: boolean) => void;
saveAudioInputDeviceId: (deviceId: string) => void;
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/prefabs/ControlBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface ControlBarProps extends React.HTMLAttributes<HTMLDivElement> {
* If `true`, the user's device choices will be persisted.
* This will enables the user to have the same device choices when they rejoin the room.
* @defaultValue true
* @alpha
*/
saveUserChoices?: boolean;
}
Expand All @@ -52,7 +53,7 @@ export interface ControlBarProps extends React.HTMLAttributes<HTMLDivElement> {
export function ControlBar({
variation,
controls,
saveUserChoices: saveDeviceSettings = true,
saveUserChoices = true,
...props
}: ControlBarProps) {
const [isChatOpen, setIsChatOpen] = React.useState(false);
Expand Down Expand Up @@ -107,7 +108,7 @@ export function ControlBar({
saveVideoInputEnabled,
saveAudioInputDeviceId,
saveVideoInputDeviceId,
} = usePersistentUserChoices({ preventSave: !saveDeviceSettings });
} = usePersistentUserChoices({ preventSave: !saveUserChoices });

return (
<div {...htmlProps}>
Expand Down

0 comments on commit 7416860

Please sign in to comment.