Skip to content

Commit

Permalink
fix Add to group button has same color as background
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictb committed Aug 15, 2024
1 parent 9769bff commit 651c9e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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

0 comments on commit 651c9e0

Please sign in to comment.