Skip to content

Commit 74746e7

Browse files
committed
fix: use font size setting for edit notice/timestamp
fixes #56
1 parent fc1ff7d commit 74746e7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/common/messaging/RegularMessage.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {Dimensions, Pressable, TouchableOpacity, View} from 'react-native';
22
import {StyleSheet} from 'react-native-unistyles';
3+
import {useMMKVNumber} from 'react-native-mmkv';
34
import {observer} from 'mobx-react-lite';
45

56
import {formatRelative} from 'date-fns/formatRelative';
@@ -29,6 +30,8 @@ export const RegularMessage = observer((props: MessageProps) => {
2930
const locale = settings.get('ui.messaging.use24H') ? enGB : enUS;
3031
const mentionsUser = props.message.mention_ids?.includes(client.user?._id!);
3132

33+
const [fontSize = settings.getDefault('ui.messaging.fontSize') as unknown as number] = useMMKVNumber('ui.messaging.fontSize');
34+
3235
// check for invite links, then take the code from each
3336
const rawInvites = Array.from(
3437
props.message.content?.matchAll(RE_INVITE) ?? [],
@@ -165,7 +168,7 @@ export const RegularMessage = observer((props: MessageProps) => {
165168
style={[
166169
localStyles.editIndicator,
167170
{
168-
fontSize: 12,
171+
fontSize: fontSize - 2,
169172
right: 48,
170173
marginBottom: -16,
171174
},
@@ -201,7 +204,7 @@ export const RegularMessage = observer((props: MessageProps) => {
201204
style={[
202205
localStyles.editIndicator,
203206
{
204-
fontSize: 12,
207+
fontSize: fontSize - 2,
205208
top: 2,
206209
left: 2,
207210
},
@@ -317,7 +320,7 @@ const localStyles = StyleSheet.create(currentTheme => ({
317320
paddingLeft: 10,
318321
},
319322
timestamp: {
320-
fontSize: 12,
323+
fontSize: (settings.get('ui.messaging.fontSize') as number) - 2,
321324
color: currentTheme.foregroundTertiary,
322325
position: 'relative',
323326
top: 2,

0 commit comments

Comments
 (0)