-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathAutoCompleteSuggestionCommandIcon.tsx
More file actions
62 lines (55 loc) · 1.84 KB
/
AutoCompleteSuggestionCommandIcon.tsx
File metadata and controls
62 lines (55 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { CommandVariants } from 'stream-chat';
import { useTheme } from '../../contexts/themeContext/ThemeContext';
import { Flag, GiphyIcon, Mute, Sound, UserAdd, UserDelete } from '../../icons';
import { Imgur } from '../../icons/Imgur';
import { Lightning } from '../../icons/Lightning';
export const SuggestionCommandIcon = ({ name }: { name: CommandVariants }) => {
const {
theme: { semantics },
} = useTheme();
if (name === 'ban') {
return <UserDelete height={20} stroke={semantics.textSecondary} width={20} />;
} else if (name === 'flag') {
return <Flag height={20} stroke={semantics.textSecondary} width={20} />;
} else if (name === 'giphy') {
return <GiphyIcon height={20} width={20} />;
} else if (name === 'imgur') {
return <Imgur height={20} width={20} />;
} else if (name === 'mute') {
return <Mute height={20} fill={semantics.textSecondary} width={20} />;
} else if (name === 'unban') {
return <UserAdd height={20} stroke={semantics.textSecondary} width={20} />;
} else if (name === 'unmute') {
return <Sound height={20} stroke={semantics.textSecondary} width={20} />;
} else {
return <Lightning fill={semantics.textSecondary} height={16} width={16} />;
}
};
export const AutoCompleteSuggestionCommandIcon = ({ name }: { name: CommandVariants }) => {
const {
theme: {
messageComposer: {
suggestions: {
command: { iconContainer },
},
},
},
} = useTheme();
return (
<View style={[styles.iconContainer, iconContainer]}>
<SuggestionCommandIcon name={name} />
</View>
);
};
const styles = StyleSheet.create({
iconContainer: {
alignItems: 'center',
borderRadius: 12,
height: 24,
justifyContent: 'center',
marginRight: 8,
width: 24,
},
});