Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Martins <luacmartins@gmail.com>
Co-authored-by: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 13, 2024
1 parent 3d51305 commit cc1ca4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/SelectionList/BaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function BaseListItem<TItem extends ListItem>({
onCheckboxPress,
onDismissError = () => {},
rightHandSideComponent,
checkmarkPosition = 'left',
checkmarkPosition = CONST.DIRECTION.LEFT,
keyForList,
errors,
pendingAction,
Expand Down Expand Up @@ -78,7 +78,7 @@ function BaseListItem<TItem extends ListItem>({
style={pressableStyle}
>
<View style={wrapperStyle}>
{canSelectMultiple && checkmarkPosition === 'left' && (
{canSelectMultiple && checkmarkPosition === CONST.DIRECTION.LEFT && (
<PressableWithFeedback
accessibilityLabel={item.text ?? ''}
role={CONST.ROLE.BUTTON}
Expand All @@ -101,7 +101,7 @@ function BaseListItem<TItem extends ListItem>({

{typeof children === 'function' ? children(hovered) : children}

{canSelectMultiple && checkmarkPosition === 'right' && (
{canSelectMultiple && checkmarkPosition === CONST.DIRECTION.RIGHT && (
<PressableWithFeedback
onPress={handleCheckboxPress}
disabled={isDisabled}
Expand Down
4 changes: 2 additions & 2 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type CommonListItemProps<TItem> = {
rightHandSideComponent?: ((item: TItem) => ReactElement<TItem>) | ReactElement | null;

/** Direction of checkmark to show */
checkmarkPosition?: 'left' | 'right';
checkmarkPosition?: ValueOf<typeof CONST.DIRECTION>;

Check failure on line 38 in src/components/SelectionList/types.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find name 'ValueOf'.

/** Styles for the pressable component */
pressableStyle?: StyleProp<ViewStyle>;
Expand Down Expand Up @@ -271,7 +271,7 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
rightHandSideComponent?: ((item: ListItem) => ReactElement<ListItem>) | ReactElement | null;

/** Direction of checkmark to show */
checkmarkPosition?: 'left' | 'right';
checkmarkPosition?: ValueOf<typeof CONST.DIRECTION>;

/** Whether to show the loading indicator for new options */
isLoadingNewOptions?: boolean;

Check failure on line 277 in src/components/SelectionList/types.ts

View workflow job for this annotation

GitHub Actions / typecheck

Cannot find name 'ValueOf'.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceInvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function WorkspaceInvitePage({
showScrollIndicator
showLoadingPlaceholder={!didScreenTransitionEnd || !OptionsListUtils.isPersonalDetailsReady(personalDetailsProp)}
shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()}
checkmarkPosition="right"
checkmarkPosition={CONST.DIRECTION.RIGHT}
/>
<View style={[styles.flexShrink0]}>
<FormAlertWithSubmitButton
Expand Down

0 comments on commit cc1ca4e

Please sign in to comment.