Skip to content

Commit 0767c6d

Browse files
committed
feat: message swipe content redesign
1 parent 3914be6 commit 0767c6d

File tree

5 files changed

+48
-39
lines changed

5 files changed

+48
-39
lines changed

package/src/components/Message/MessageSimple/MessageBubble.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@ const useStyles = ({ alignment }: { alignment?: 'left' | 'right' }) => {
236236
...contentContainer,
237237
},
238238
swipeContentContainer: {
239-
flexShrink: 0,
240-
overflow: 'hidden',
241-
position: 'relative',
242239
...swipeContentContainer,
243240
},
244241
errorContainer: {
Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
1-
import React from 'react';
1+
import React, { useMemo } from 'react';
22
import { StyleSheet, View } from 'react-native';
33

44
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
5-
import { CurveLineLeftUpReply } from '../../../icons';
5+
import { ArrowShareLeft } from '../../../icons';
6+
import { primitives } from '../../../theme';
67

78
export const MessageSwipeContent = () => {
9+
const styles = useStyles();
10+
const {
11+
theme: { semantics },
12+
} = useTheme();
13+
14+
return (
15+
<View style={styles.container}>
16+
<ArrowShareLeft stroke={semantics.buttonSecondaryTextOnAccent} height={20} width={20} />
17+
</View>
18+
);
19+
};
20+
21+
const useStyles = () => {
822
const {
923
theme: {
10-
semantics,
1124
messageSimple: {
1225
swipeLeftContent: { container },
1326
},
27+
semantics,
1428
},
1529
} = useTheme();
16-
return (
17-
<View style={[styles.container, container]}>
18-
<CurveLineLeftUpReply pathFill={semantics.textSecondary} />
19-
</View>
20-
);
21-
};
2230

23-
const styles = StyleSheet.create({
24-
container: {
25-
justifyContent: 'center',
26-
paddingRight: 16,
27-
},
28-
});
31+
return useMemo(() => {
32+
return StyleSheet.create({
33+
container: {
34+
backgroundColor: semantics.buttonSecondaryBg,
35+
height: 32,
36+
width: 32,
37+
alignItems: 'center',
38+
justifyContent: 'center',
39+
borderRadius: primitives.radiusMax,
40+
...container,
41+
},
42+
});
43+
}, [container, semantics.buttonSecondaryBg]);
44+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
3+
import { Path, Svg } from 'react-native-svg';
4+
5+
import { IconProps } from './utils/base';
6+
7+
export const ArrowShareLeft = ({ height, width, ...rest }: IconProps) => (
8+
<Svg fill={'none'} height={height} viewBox={'0 0 20 20'} width={width} {...rest}>
9+
<Path
10+
d='M1.53764 9.54198L8.32555 3.26313C8.72579 2.89294 9.37496 3.17678 9.37496 3.72194V6.66743C9.37496 6.89755 9.56496 7.08372 9.79504 7.08738C16.5328 7.19454 18.3333 9.93457 18.3333 16.8757C17.1085 14.4262 16.4838 12.9767 9.79588 12.9192C9.56571 12.9172 9.37496 13.104 9.37496 13.3341V16.2796C9.37496 16.8247 8.72579 17.1086 8.32555 16.7384L1.53764 10.4596C1.27017 10.2121 1.27017 9.7894 1.53764 9.54198Z'
11+
strokeLinejoin='round'
12+
strokeWidth={1.5}
13+
{...rest}
14+
/>
15+
</Svg>
16+
);

package/src/icons/CurveLineLeftUpReply.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

package/src/icons/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ export * from './SendPoll';
103103
export * from './UnreadIndicator';
104104
export * from './FilePickerIcon';
105105
export * from './CommandsIcon';
106-
export * from './CurveLineLeftUpReply';
106+
export * from './ArrowShareLeft';
107107
export * from './Bell';

0 commit comments

Comments
 (0)