minor govno

This commit is contained in:
2023-10-13 05:40:03 +03:00
parent fd74b5b79a
commit 67258c8114
17 changed files with 329 additions and 23 deletions

View File

@@ -30,13 +30,11 @@ const styles = StyleSheet.create({
backgroundColor: '#2478F8',
borderRadius: responsiveWidth(1),
padding: responsiveWidth(2),
flex: 1,
},
text: {
color: "white",
fontSize: RFPercentage(2),
textAlignVertical:"center",
textAlignVertical: "center",
}
});

View File

@@ -1,9 +1,10 @@
import React, {FC, ReactElement} from "react";
import {StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';
import {RFPercentage} from "react-native-responsive-fontsize";
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
type Props = {
children: string;
children: any;
style?: StyleProp<TextStyle>;
}
const DText: FC<Props> = ({children, style}) => {
@@ -13,7 +14,8 @@ const DText: FC<Props> = ({children, style}) => {
}
const styles = StyleSheet.create({
text: {
fontFamily: 'SF Pro Text',
// fontFamily: 'SF Pro Text',
fontSize: responsiveWidth(3),
}
})
export default DText;

View File

@@ -0,0 +1,21 @@
import React, {FC, ReactElement} from "react";
import {StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';
import {RFPercentage} from "react-native-responsive-fontsize";
import DText from "../DText/DText";
import {responsiveWidth} from "react-native-responsive-dimensions";
type Props = {
children: string;
style?: StyleProp<TextStyle>;
}
const DTitle: FC<Props> = ({children, style}) => {
return (<DText style={[style, styles.text]}>{children}</DText>)
}
const styles = StyleSheet.create({
text: {
fontSize: responsiveWidth(4.5),
fontWeight: "600",
fontStyle: "normal"
}
})
export default DTitle;

View File

@@ -0,0 +1,27 @@
import React, {ReactNode} from 'react';
import {TouchableOpacity, Linking} from 'react-native';
type HyperlinkProps = {
url: string;
children: ReactNode;
};
const Hyperlink: React.FC<HyperlinkProps> = ({url, children}) => {
const handlePress = () => {
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url);
} else {
console.log("Don't know how to open URI: " + url);
}
});
};
return (
<TouchableOpacity onPress={handlePress}>
{children}
</TouchableOpacity>
);
};
export default Hyperlink;

View File

@@ -0,0 +1,98 @@
import {FC, useState} from "react";
import {GestureResponderEvent, Image, StyleSheet, TouchableOpacity, View} from "react-native";
import {RFPercentage} from "react-native-responsive-fontsize";
import DText from "../DText/DText";
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
import DTitle from "../DTitle/DTitle";
type Props = {
onPress?: (event: GestureResponderEvent) => void
}
const OrderCard: FC<Props> = ({onPress}) => {
const [order, setOrder] = useState({
article: 183658,
imageUrl: "https://421421.selcdn.ru/denco/996956/thumbzoom/h0b41036e5dc84a88b3dd344a46ab33edt.jpg-640x640.jpg",
orderNumber: "93757290-0104-7",
productName: "Фигурки животных «Собачки» 258, 5-7 см., статичные / 12 шт.",
supplierName: "simaland",
marketplaceName: "Wildberries РЕНТА",
sellerName: "DENCO",
assembled: false
});
return (
<TouchableOpacity onPress={() => {
console.log("pressed11")
}}>
<View style={styles.container}>
<View style={styles.imageWrapper}>
<Image style={styles.image} source={{uri: order.imageUrl}}/>
</View>
<View style={styles.description}>
<View style={styles.title}>
<DTitle>{order.orderNumber}</DTitle>
<Image source={require('assets/icons/marketplaces/ozon.png')} style={styles.titleImage}/>
</View>
<DText>Количество: 5</DText>
<DText>Поставщик: {order.supplierName}</DText>
<DText>Селлер: {order.sellerName}</DText>
<DText>Цвет: ГОЛУБОЙ</DText>
<View style={styles.statusContainer}>
<DText>
Ожидает сборки
</DText>
</View>
</View>
</View>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
container: {
backgroundColor: "white",
display: "flex",
borderRadius: RFPercentage(5),
height: responsiveHeight(20),
flexDirection: "row",
padding: RFPercentage(2),
},
imageWrapper: {
width: responsiveWidth(30),
},
image: {
width: "100%",
height: "100%",
},
description: {
backgroundColor:"red",
flex: 1,
display: "flex",
flexDirection: "column",
paddingLeft: responsiveWidth(3),
gap: 0,
},
title: {
marginBottom: responsiveHeight(1),
flexDirection: "row",
alignItems: "center"
},
titleImage: {
width: responsiveWidth(4),
height: responsiveHeight(4),
resizeMode: "center",
marginLeft: responsiveHeight(1)
},
statusContainer: {
alignSelf: "flex-end",
}
});
export default OrderCard;