Skip to content

Commit 5c3a35d

Browse files
committed
fix: improve icons and usage
1 parent f7cc9d4 commit 5c3a35d

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import Svg, { Path } from 'react-native-svg';
3+
import { useTheme } from 'stream-chat-react-native';
4+
5+
import { IconProps } from '../utils/base';
6+
7+
export const Bell: React.FC<IconProps> = ({ height = 512, width = 512 }) => {
8+
const {
9+
theme: {
10+
colors: { grey },
11+
},
12+
} = useTheme();
13+
14+
return (
15+
<Svg height={height} viewBox={'0 0 24 24'} width={width}>
16+
<Path
17+
d='M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zM18,16v-5c0,-3.07 -1.63,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.64,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2zM16,17L8,17v-6c0,-2.48 1.51,-4.5 4,-4.5s4,2.02 4,4.5v6z'
18+
fill={grey}
19+
/>
20+
</Svg>
21+
);
22+
};

examples/SampleApp/src/screens/ChannelScreen.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
118118
const navigation = useNavigation();
119119
const { bottom } = useSafeAreaInsets();
120120
const {
121-
theme: {
122-
colors: { white },
123-
},
121+
theme: { colors },
124122
} = useTheme();
125123
const { t } = useTranslationContext();
126124

@@ -168,7 +166,7 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
168166
}
169167

170168
return (
171-
<View style={[styles.flex, { backgroundColor: white, paddingBottom: bottom }]}>
169+
<View style={[styles.flex, { backgroundColor: colors.white, paddingBottom: bottom }]}>
172170
<Channel
173171
audioRecordingEnabled={true}
174172
channel={channel}
@@ -181,6 +179,7 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
181179
params,
182180
chatClient,
183181
t,
182+
colors,
184183
});
185184
}}
186185
MessageHeader={MessageReminderHeader}

examples/SampleApp/src/utils/messageActions.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { Alert } from 'react-native';
22
import { StreamChat } from 'stream-chat';
33
import {
4+
Colors,
45
messageActions,
56
MessageActionsParams,
67
Time,
78
TranslationContextValue,
89
} from 'stream-chat-react-native';
10+
import { Bell } from '../icons/Bell';
911

1012
export function channelMessageActions({
1113
params,
1214
chatClient,
15+
colors,
1316
t,
1417
}: {
1518
params: MessageActionsParams;
1619
chatClient: StreamChat;
1720
t: TranslationContextValue['t'];
21+
colors?: typeof Colors;
1822
}) {
1923
const { dismissOverlay } = params;
2024
const actions = messageActions(params);
@@ -37,7 +41,7 @@ export function channelMessageActions({
3741
},
3842
actionType: reminder ? 'remove-from-later' : 'save-for-later',
3943
title: reminder ? 'Remove from Later' : 'Save for Later',
40-
icon: <Time />,
44+
icon: <Time pathFill={colors?.grey} />,
4145
});
4246
actions.push({
4347
action: () => {
@@ -82,7 +86,7 @@ export function channelMessageActions({
8286
},
8387
actionType: reminder ? 'remove-reminder' : 'remind-me',
8488
title: reminder ? 'Remove Reminder' : 'Remind Me',
85-
icon: <Time />,
89+
icon: <Bell height={24} width={24} />,
8690
});
8791

8892
return actions;

0 commit comments

Comments
 (0)