Skip to content

Commit

Permalink
Fix import + run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Apr 11, 2024
1 parent 84e631c commit 351f318
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/libs/PersonalDetailsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type {OnyxData} from '@src/types/onyx/Request';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import * as LocalePhoneNumber from './LocalePhoneNumber';
import * as Localize from './Localize';
import * as UserUtils from './UserUtils';
import Log from './Log';

Check failure on line 12 in src/libs/PersonalDetailsUtils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'Log' is defined but never used
import * as UserUtils from './UserUtils';

type FirstAndLastName = {
firstName: string;
Expand Down
10 changes: 9 additions & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import type {
SetNameValuePairParams,
TogglePinnedChatParams,
UpdateCommentParams,
UpdateGroupChatAvatarParams,
UpdateGroupChatMemberRolesParams,
UpdateGroupChatNameParams,
UpdatePolicyRoomNameParams,
Expand Down Expand Up @@ -833,7 +834,14 @@ function openReport(
* @param userLogins list of user logins to start a chat report with.
* @param shouldDismissModal a flag to determine if we should dismiss modal before navigate to report or navigate to report directly.
*/
function navigateToAndOpenReport(userLogins: string[], shouldDismissModal = true, reportName?: string, avatarUri?: string, avatarFile?: File | CustomRNImageManipulatorResult | undefined, optimisticReportID?: string) {
function navigateToAndOpenReport(
userLogins: string[],
shouldDismissModal = true,
reportName?: string,
avatarUri?: string,
avatarFile?: File | CustomRNImageManipulatorResult | undefined,
optimisticReportID?: string,
) {
let newChat: ReportUtils.OptimisticChatReport | EmptyObject = {};
let chat: OnyxEntry<Report> | EmptyObject = {};
const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins(userLogins);
Expand Down
16 changes: 9 additions & 7 deletions src/pages/NewChatConfirmPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import AvatarWithImagePicker from '@components/AvatarWithImagePicker';
import Badge from '@components/Badge';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Expensicons from '@components/Icon/Expensicons';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
Expand All @@ -12,6 +13,7 @@ import InviteMemberListItem from '@components/SelectionList/InviteMemberListItem
import type {ListItem} from '@components/SelectionList/types';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types';
import Navigation from '@libs/Navigation/Navigation';
Expand All @@ -23,8 +25,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type * as OnyxTypes from '@src/types/onyx';
import type {Participant} from '@src/types/onyx/IOU';
import useStyleUtils from '@hooks/useStyleUtils';
import Badge from '@components/Badge';

type NewChatConfirmPageOnyxProps = {
/** New group chat draft data */
Expand Down Expand Up @@ -70,11 +70,13 @@ function NewChatConfirmPage({newGroupDraft, allPersonalDetails}: NewChatConfirmP
accountID,
icons: selectedOption?.icons,
alternateText: selectedOption?.login ?? '',
rightElement: isAdmin ? (<Badge
text={translate('common.admin')}
textStyles={styles.textStrong}
badgeStyles={[styles.justifyContentCenter, StyleUtils.getMinimumWidth(60), styles.badgeBordered]}
/>) : undefined,
rightElement: isAdmin ? (
<Badge
text={translate('common.admin')}
textStyles={styles.textStrong}
badgeStyles={[styles.justifyContentCenter, StyleUtils.getMinimumWidth(60), styles.badgeBordered]}
/>
) : undefined,
};
return section;
})
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
/>
);

const reportName = useMemo(() => isGroupChat ? ReportUtils.getGroupChatName(undefined, true, report.reportID ?? '') : ReportUtils.getReportName(report), [report, isGroupChat]);
const reportName = useMemo(() => (isGroupChat ? ReportUtils.getGroupChatName(undefined, true, report.reportID ?? '') : ReportUtils.getReportName(report)), [report, isGroupChat]);
return (
<ScreenWrapper testID={ReportDetailsPage.displayName}>
<FullPageNotFoundView shouldShow={isEmptyObject(report)}>
Expand Down

0 comments on commit 351f318

Please sign in to comment.