Skip to content

Commit 9fe1495

Browse files
committed
husky added
1 parent d9dce33 commit 9fe1495

File tree

6 files changed

+170
-66
lines changed

6 files changed

+170
-66
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm tsc

app/chat.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import OthersChat from "@/components/chat/others-chat";
12
import SelfChat from "@/components/chat/self-chat";
23
import { Link } from "expo-router";
34
import { View } from "react-native";
45

56
const ChatScreen = () => {
67
return (
78
<View>
9+
<OthersChat />
810
<SelfChat />
911
<Link href="/">Home</Link>
1012
</View>

components/chat/others-chat.tsx

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import { StyleSheet, Text, useWindowDimensions, View } from "react-native";
2+
3+
const OthersChat = () => {
4+
const { height } = useWindowDimensions();
5+
6+
return (
7+
<View style={styles.othersChatContainer}>
8+
<View style={styles.ChatContainer}>
9+
<Text style={styles.text}>
10+
Lorem ipsum dolor sit amet consectetur adipisicing elit.
11+
Minus, labore neque perferendis id dolor minima ad aliquam
12+
ex, sed debitis quos, unde animi. Et eligendi quas magnam
13+
cum eveniet? Praesentium!
14+
</Text>
15+
<View
16+
style={[
17+
styles.triangle,
18+
styles.triangleBorder,
19+
{
20+
borderLeftWidth: height * 0.005,
21+
borderRightWidth: height * 0.005,
22+
borderTopWidth: height * 0.035,
23+
},
24+
]}
25+
/>
26+
<View
27+
style={[
28+
styles.triangle,
29+
styles.triangleFill,
30+
{
31+
borderLeftWidth: height * 0.004,
32+
borderRightWidth: height * 0.004,
33+
borderTopWidth: height * 0.033,
34+
},
35+
]}
36+
/>
37+
</View>
38+
</View>
39+
);
40+
};
41+
42+
const styles = StyleSheet.create({
43+
othersChatContainer: {
44+
flexDirection: "row",
45+
marginVertical: 10,
46+
marginHorizontal: 15,
47+
},
48+
ChatContainer: {
49+
maxWidth: "75%",
50+
backgroundColor: "#FFFFFF",
51+
borderWidth: 1,
52+
borderColor: "#EEEEEE",
53+
borderRadius: 10,
54+
padding: 12,
55+
position: "relative",
56+
},
57+
text: {
58+
color: "black",
59+
fontSize: 16,
60+
fontFamily: "Rubik_400Regular",
61+
lineHeight: 20,
62+
},
63+
triangle: {
64+
width: 0,
65+
height: 0,
66+
borderLeftColor: "transparent",
67+
borderRightColor: "transparent",
68+
borderStyle: "solid",
69+
position: "absolute",
70+
left: -12,
71+
bottom: 8,
72+
transform: [{ rotate: "45deg" }],
73+
},
74+
triangleBorder: {
75+
borderTopColor: "#CFD8DC",
76+
borderLeftWidth: 8,
77+
borderRightWidth: 8,
78+
borderTopWidth: 8,
79+
},
80+
triangleFill: {
81+
borderTopColor: "#FFFFFF",
82+
borderLeftWidth: 7,
83+
borderRightWidth: 7,
84+
borderTopWidth: 7,
85+
left: -11,
86+
bottom: 9,
87+
},
88+
});
89+
90+
export default OthersChat;

components/chat/self-chat.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ const styles = StyleSheet.create({
5353
color: "#fff",
5454
fontSize: 16,
5555
fontFamily: "Rubik_400Regular",
56-
textAlign: "center",
57-
paddingHorizontal: 15,
5856
},
5957
triangle: {
6058
width: 0,

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"ios": "expo start --ios",
1010
"web": "expo start --web",
1111
"test": "jest --watchAll",
12-
"lint": "expo lint"
12+
"lint": "expo lint",
13+
"ts": "tsc --noEmit",
14+
"prepare": "husky"
1315
},
1416
"jest": {
1517
"preset": "jest-expo"
@@ -20,7 +22,7 @@
2022
"@expo/vector-icons": "^14.0.4",
2123
"@react-navigation/bottom-tabs": "^7.2.0",
2224
"@react-navigation/native": "^7.0.14",
23-
"expo": "~52.0.28",
25+
"expo": "~52.0.29",
2426
"expo-blur": "~14.0.3",
2527
"expo-constants": "~17.0.5",
2628
"expo-font": "~13.0.3",
@@ -49,10 +51,11 @@
4951
"@types/jest": "^29.5.14",
5052
"@types/react": "~18.3.18",
5153
"@types/react-test-renderer": "^18.3.1",
54+
"husky": "^9.1.7",
5255
"jest": "^29.7.0",
5356
"jest-expo": "~52.0.3",
5457
"react-test-renderer": "18.3.1",
5558
"typescript": "^5.7.3"
5659
},
5760
"private": true
58-
}
61+
}

0 commit comments

Comments
 (0)