Skip to content

Commit

Permalink
remove empty lines (#5521)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmceachernmsft authored Dec 20, 2024
1 parent 28586d8 commit 4257c57
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 33 deletions.
9 changes: 0 additions & 9 deletions samples/Calling/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,15 @@ type AppPages = 'home' | 'call';

const App = (): JSX.Element => {
const [page, setPage] = useState<AppPages>('home');

// User credentials to join a call with - these are retrieved from the server
const [token, setToken] = useState<string>();
const [userId, setUserId] = useState<CommunicationUserIdentifier | MicrosoftTeamsUserIdentifier>();
const [userCredentialFetchError, setUserCredentialFetchError] = useState<boolean>(false);

// Call details to join a call - these are collected from the user on the home screen
const [callLocator, setCallLocator] = useState<CallAdapterLocator>();
const [targetCallees, setTargetCallees] = useState<StartCallIdentifier[] | undefined>(undefined);
const [displayName, setDisplayName] = useState<string>('');

const [isTeamsCall, setIsTeamsCall] = useState<boolean>(false);

const [alternateCallerId, setAlternateCallerId] = useState<string | undefined>();

// Get Azure Communications Service token from the server
Expand Down Expand Up @@ -149,9 +145,7 @@ const App = (): JSX.Element => {
throw 'Invalid userId!';
}
}

setCallLocator(callLocator);

// Update window URL to have a joinable link
if (callLocator && !joiningExistingCall) {
window.history.pushState(
Expand All @@ -163,11 +157,8 @@ const App = (): JSX.Element => {
getIsCTEParam(!!callDetails.teamsToken)
);
}

setIsTeamsCall(!!callDetails.teamsToken);

callDetails.teamsToken && setToken(callDetails.teamsToken);

callDetails.teamsId &&
setUserId(fromFlatCommunicationIdentifier(callDetails.teamsId) as MicrosoftTeamsUserIdentifier);
setPage('call');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export interface SwitchableFluentThemeProviderProps {
export const SwitchableFluentThemeProvider = (props: SwitchableFluentThemeProviderProps): JSX.Element => {
const { children, scopeId } = props;
const [themeStore, setThemeCollection] = useState<ThemeCollection>(props.themes ?? defaultThemes);

const themeFromStorage = getThemeFromLocalStorage(scopeId);
const initialTheme = themeStore[themeFromStorage || defaultTheme.name] ?? defaultTheme;
const [currentTheme, _setCurrentTheme] = useState<NamedTheme>(initialTheme);
Expand Down
1 change: 0 additions & 1 deletion samples/Calling/src/app/theming/ThemeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const ThemeSelector = (props: ThemeSelectorProps): JSX.Element => {
if (!theme) {
throw new Error(`Theme ${themeName} not found in theme store`);
}

setCurrentTheme(theme);
}
};
Expand Down
1 change: 0 additions & 1 deletion samples/Calling/src/app/views/CallScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export interface CallScreenProps {
targetCallees?: StartCallIdentifier[];
displayName: string;
alternateCallerId?: string;

isTeamsIdentityCall?: boolean;
}

Expand Down
1 change: 0 additions & 1 deletion samples/Calling/src/app/views/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
paneFooterTokens,
textFieldStyles
} from '../styles/Footer.styles';

import React from 'react';

const invitePeopleString = 'Invite people to join';
Expand Down
20 changes: 0 additions & 20 deletions samples/Calling/src/app/views/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ export interface HomeScreenProps {
role?: string;
outboundParticipants?: string[];
alternateCallerId?: string;

teamsToken?: string;

teamsId?: string;
outboundTeamsUsers?: string[];
}): void;
Expand All @@ -78,17 +76,13 @@ export const HomeScreen = (props: HomeScreenProps): JSX.Element => {
{ key: 'StartRooms', text: 'Start a Rooms call' },
{ key: 'TeamsMeeting', text: 'Join a Teams meeting using ACS identity' },
{ key: 'Rooms', text: 'Join a Rooms Call' },

{ key: 'TeamsIdentity', text: 'Join a Teams call using Teams identity' },

{ key: '1:N', text: 'Start a 1:N ACS Call' },
{ key: 'PSTN', text: 'Start a PSTN Call' },
{ key: 'TeamsAdhoc', text: 'Call a Teams User or voice application' }
];
const roomIdLabel = 'Room ID';

const teamsTokenLabel = 'Enter a Teams token';

const teamsIdLabel = 'Enter a Teams Id';
const roomsRoleGroupLabel = 'Rooms Role';
const roomRoleOptions: IChoiceGroupOption[] = [
Expand All @@ -100,7 +94,6 @@ export const HomeScreen = (props: HomeScreenProps): JSX.Element => {
// Get display name from local storage if available
const defaultDisplayName = localStorageAvailable ? getDisplayNameFromLocalStorage() : null;
const [displayName, setDisplayName] = useState<string | undefined>(defaultDisplayName ?? undefined);

const [chosenCallOption, setChosenCallOption] = useState(callOptions[0] as ICallChoiceGroupOption);
const [callLocator, setCallLocator] = useState<TeamsMeetingLinkLocator | RoomLocator | TeamsMeetingIdLocator>();
const [meetingId, setMeetingId] = useState<string>();
Expand All @@ -109,22 +102,16 @@ export const HomeScreen = (props: HomeScreenProps): JSX.Element => {
const [alternateCallerId, setAlternateCallerId] = useState<string>();
const [outboundParticipants, setOutboundParticipants] = useState<string | undefined>();
const [dialPadParticipant, setDialpadParticipant] = useState<string>();

const [teamsToken, setTeamsToken] = useState<string>();

const [teamsId, setTeamsId] = useState<string>();
const [outboundTeamsUsers, setOutboundTeamsUsers] = useState<string | undefined>();

const [alternateCallerIdCalloutVisible, setAlternateCallerIdCalloutVisible] = useState<boolean>(false);

const startGroupCall: boolean = chosenCallOption.key === 'ACSCall';
const teamsCallChosen: boolean = chosenCallOption.key === 'TeamsMeeting';

const teamsIdentityChosen = chosenCallOption.key === 'TeamsIdentity';
const pstnCallChosen: boolean = chosenCallOption.key === 'PSTN';
const acsCallChosen: boolean = chosenCallOption.key === '1:N';
const teamsAdhocChosen: boolean = chosenCallOption.key === 'TeamsAdhoc';

const buttonEnabled =
(displayName || teamsToken) &&
(startGroupCall ||
Expand All @@ -137,13 +124,9 @@ export const HomeScreen = (props: HomeScreenProps): JSX.Element => {
(teamsIdentityChosen && callLocator && teamsToken && teamsId));

registerIcons({ icons: { DialpadBackspace: <Backspace20Regular /> } });

const isMobileSession = useIsMobile();

let showDisplayNameField = true;

showDisplayNameField = !teamsIdentityChosen;

const [teamsIdFormatError, setTeamsIdFormatError] = useState<boolean>(false);

return (
Expand Down Expand Up @@ -379,7 +362,6 @@ export const HomeScreen = (props: HomeScreenProps): JSX.Element => {
onClick={() => {
if (displayName || teamsIdentityChosen) {
displayName && saveDisplayNameToLocalStorage(displayName);

const acsParticipantsToCall = parseParticipants(outboundParticipants);
const teamsParticipantsToCall = parseParticipants(outboundTeamsUsers);
const dialpadParticipantToCall = parseParticipants(dialPadParticipant);
Expand All @@ -391,9 +373,7 @@ export const HomeScreen = (props: HomeScreenProps): JSX.Element => {
role: chosenRoomsRoleOption?.key,
outboundParticipants: acsParticipantsToCall ? acsParticipantsToCall : dialpadParticipantToCall,
alternateCallerId,

teamsToken,

teamsId,
outboundTeamsUsers: teamsParticipantsToCall
});
Expand Down

0 comments on commit 4257c57

Please sign in to comment.