Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 5 additions & 7 deletions app/containers/Check.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { StyleSheet } from 'react-native';

import { CustomIcon } from '../lib/Icons';
import { themes } from '../constants/colors';
import { useTheme } from '../theme';

interface ICheck {
style?: object;
theme: string;
}
const styles = StyleSheet.create({
icon: {
width: 22,
Expand All @@ -16,8 +13,9 @@ const styles = StyleSheet.create({
}
});

const Check = React.memo(({ theme, style }: ICheck) => (
<CustomIcon style={[styles.icon, style]} color={themes[theme].tintColor} size={22} name='check' />
));
const Check = React.memo(() => {
const { theme } = useTheme();
return <CustomIcon style={styles.icon} color={themes[theme].tintColor} size={22} name='check' />;
});

export default Check;
2 changes: 1 addition & 1 deletion app/containers/UIKit/MultiSelect/Items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Item = ({ item, selected, onSelect, theme }: IItem) => {
<>
{item.imageUrl ? <FastImage style={styles.itemImage} source={{ uri: item.imageUrl }} /> : null}
<Text style={{ color: themes[theme].titleText }}>{textParser([item.text])}</Text>
{selected ? <Check theme={theme} /> : null}
{selected ? <Check /> : null}
</>
</Touchable>
);
Expand Down
2 changes: 1 addition & 1 deletion app/presentation/ServerItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ServerItem = React.memo(({ item, onPress, onLongPress, hasCheck, theme }:
{item.id}
</Text>
</View>
{hasCheck ? <Check theme={theme!} /> : null}
{hasCheck ? <Check /> : null}
</View>
</Pressable>
));
Expand Down
2 changes: 1 addition & 1 deletion app/views/DirectoryView/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class DirectoryOptions extends PureComponent<IDirectoryOptionsPro
<View style={styles.dropdownItemContainer}>
<CustomIcon style={[styles.dropdownItemIcon, { color: themes[theme].bodyText }]} size={22} name={icon} />
<Text style={[styles.dropdownItemText, { color: themes[theme].bodyText }]}>{I18n.t(text)}</Text>
{propType === itemType ? <Check theme={theme} /> : null}
{propType === itemType ? <Check /> : null}
</View>
</Touch>
);
Expand Down