@towsila/expo-ui-library 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towsila/expo-ui-library",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import { Ionicons } from "@expo/vector-icons";
4
+
5
+ interface RatingStarsProps {
6
+ rating: number;
7
+ size?: number;
8
+ color?: string;
9
+ }
10
+
11
+ export default function RatingStars({
12
+ rating,
13
+ size = 16,
14
+ color = "#F59E0B",
15
+ }: RatingStarsProps) {
16
+ return (
17
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
18
+ {[0, 1, 2, 3, 4].map((index) => {
19
+ let icon: React.ComponentProps<typeof Ionicons>["name"];
20
+
21
+ if (rating >= index + 1) {
22
+ icon = "star";
23
+ } else if (rating >= index + 0.5) {
24
+ icon = "star-half";
25
+ } else {
26
+ icon = "star-outline";
27
+ }
28
+
29
+ return (
30
+ <Ionicons
31
+ key={index}
32
+ name={icon}
33
+ size={size}
34
+ color={color}
35
+ />
36
+ );
37
+ })}
38
+ </View>
39
+ );
40
+ }
@@ -26,7 +26,7 @@ export default function Toast({
26
26
  }: ToastProps) {
27
27
  const { colors } = useAppTheme();
28
28
 
29
- const translateY = useRef(new Animated.Value(-120)).current;
29
+ const translateY = useRef(new Animated.Value(-200)).current;
30
30
  const opacity = useRef(new Animated.Value(0)).current;
31
31
 
32
32
  useEffect(() => {
@@ -48,7 +48,7 @@ export default function Toast({
48
48
  const timer = setTimeout(() => {
49
49
  Animated.parallel([
50
50
  Animated.timing(translateY, {
51
- toValue: -120,
51
+ toValue: -200,
52
52
  duration: 250,
53
53
  useNativeDriver: true,
54
54
  }),
@@ -132,6 +132,7 @@ const styles = StyleSheet.create({
132
132
 
133
133
  container: {
134
134
  flexDirection:"row",
135
+ alignItems: "flex-start",
135
136
  gap:10,
136
137
  position: "absolute",
137
138
  top: 60,
@@ -156,5 +157,6 @@ const styles = StyleSheet.create({
156
157
  text: {
157
158
  fontFamily: Fonts.montserrat.semiBold,
158
159
  fontSize: textSize.sm,
160
+ flex: 1,
159
161
  },
160
162
  });
package/src/index.ts CHANGED
@@ -60,4 +60,5 @@ export {default as WarningModel} from "./components/ui/warningModel";
60
60
  export {default as Toast} from "./components/ui/toast";
61
61
  export {default as AccountStatusScreen} from "./components/screens/AccountStatusScreen";
62
62
  export {sendEmail} from "./service/sendEmail";
63
- export {useToast} from "./hooks/useToast";
63
+ export {useToast} from "./hooks/useToast";
64
+ export {default as RatingStars} from "./components/ui/rating";