Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/SelectionList/BaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function BaseListItem<TItem extends ListItem>({
}

if (typeof rightHandSideComponent === 'function') {
return rightHandSideComponent(item);
return rightHandSideComponent(item, isFocused);
}

return rightHandSideComponent;
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type UserListItem from './UserListItem';

type TRightHandSideComponent<TItem extends ListItem> = {
/** Component to display on the right side */
rightHandSideComponent?: ((item: TItem) => ReactElement | null | undefined) | ReactElement | null;
rightHandSideComponent?: ((item: TItem, isFocused?: boolean) => ReactElement | null | undefined) | ReactElement | null;
};

type CommonListItemProps<TItem extends ListItem> = {
Expand Down
5 changes: 3 additions & 2 deletions src/pages/NewChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) {
);

const itemRightSideComponent = useCallback(
(item: ListItem & OptionsListUtils.Option) => {
(item: ListItem & OptionsListUtils.Option, isFocused?: boolean) => {
if (item.isSelfDM) {
return null;
}
Expand Down Expand Up @@ -263,12 +263,13 @@ function NewChatPage({isGroupChat}: NewChatPageProps) {
</PressableWithFeedback>
);
}

const buttonInnerStyles = isFocused ? styles.buttonDefaultHovered : {};
return (
<Button
onPress={() => toggleOption(item)}
style={[styles.pl2]}
text={translate('newChatPage.addToGroup')}
innerStyles={buttonInnerStyles}
small
/>
);
Expand Down