parent
f6955073f0
commit
48de8b9d4d
8 changed files with 280 additions and 17 deletions
Binary file not shown.
@ -0,0 +1,147 @@ |
||||
import React, { useState } from "react"; |
||||
import { |
||||
View, |
||||
Text, |
||||
Dimensions, |
||||
Pressable, |
||||
} from "react-native"; |
||||
import tw from "tailwind-rn"; |
||||
import Colors from "../../../../constants/Colors"; |
||||
import { useNavigation } from "@react-navigation/native"; |
||||
const { width, height } = Dimensions.get("window"); |
||||
|
||||
const Season = ({ season }) => { |
||||
const navigation = useNavigation(); |
||||
const Unit = ({ unit }) => { |
||||
return ( |
||||
<View |
||||
style={[ |
||||
tw("w-full flex flex-col rounded-md overflow-hidden mb-3"), |
||||
{ borderWidth: 1, borderColor: Colors.theme1.light.blue3 }, |
||||
]} |
||||
> |
||||
<View |
||||
style={[ |
||||
tw( |
||||
"w-full flex flex-row-reverse justify-between items-center py-1.5 px-2" |
||||
), |
||||
{ |
||||
borderBottomWidth: 1, |
||||
borderColor: Colors.theme1.light.blue3, |
||||
backgroundColor: Colors.theme1.light.blue8, |
||||
}, |
||||
]} |
||||
> |
||||
<Text |
||||
style={[ |
||||
{ |
||||
fontFamily: "regular", |
||||
fontSize: width / 34, |
||||
color: Colors.theme1.light.blue5, |
||||
}, |
||||
]} |
||||
> |
||||
{unit.name} |
||||
</Text> |
||||
<Text |
||||
style={[ |
||||
{ |
||||
fontFamily: "regular", |
||||
fontSize: width / 36, |
||||
color: Colors.theme1.light.blue5, |
||||
}, |
||||
]} |
||||
> |
||||
{unit.duration} |
||||
</Text> |
||||
</View> |
||||
<View style={[tw("w-full flex flex-row-reverse")]}> |
||||
{unit.play && ( |
||||
<Pressable |
||||
style={[ |
||||
tw("flex flex-1 flex-row items-center py-1.5 px-2"), |
||||
{ |
||||
borderLeftWidth: 1, |
||||
borderColor: Colors.theme1.light.blue3, |
||||
backgroundColor: Colors.theme1.light.blue8, |
||||
}, |
||||
]} |
||||
onPress={() => navigation.navigate("VideoDisplay")} |
||||
> |
||||
<Text |
||||
style={{ |
||||
width: "100%", |
||||
textAlign: "center", |
||||
fontFamily: "regular", |
||||
fontSize: width / 34, |
||||
color: Colors.theme1.light.blue5, |
||||
}} |
||||
> |
||||
نمایش |
||||
</Text> |
||||
</Pressable> |
||||
)} |
||||
{unit.download && ( |
||||
<Pressable |
||||
style={tw("flex flex-1 flex-row items-center py-1.5 px-2")} |
||||
> |
||||
<Text |
||||
style={{ |
||||
width: "100%", |
||||
textAlign: "center", |
||||
fontFamily: "regular", |
||||
fontSize: width / 34, |
||||
color: Colors.theme1.light.blue5, |
||||
backgroundColor: Colors.theme1.light.blue8, |
||||
}} |
||||
> |
||||
دانلود |
||||
</Text> |
||||
</Pressable> |
||||
)} |
||||
</View> |
||||
</View> |
||||
); |
||||
}; |
||||
return ( |
||||
<View style={tw("w-full flex flex-col mt-5")}> |
||||
<Pressable |
||||
style={[ |
||||
tw( |
||||
"flex flex-row-reverse justify-between items-center rounded-md py-2 px-3 mb-3" |
||||
), |
||||
{ backgroundColor: Colors.theme1.light.blue5 }, |
||||
]} |
||||
> |
||||
<Text |
||||
style={[ |
||||
{ |
||||
fontFamily: "regular", |
||||
fontSize: width / 34, |
||||
color: "white", |
||||
}, |
||||
]} |
||||
> |
||||
{season.name} |
||||
</Text> |
||||
<Text |
||||
style={[ |
||||
{ |
||||
fontFamily: "regular", |
||||
fontSize: width / 36, |
||||
color: "white", |
||||
}, |
||||
]} |
||||
> |
||||
{season.duration} |
||||
</Text> |
||||
</Pressable> |
||||
|
||||
{season.units.map((unit, index) => ( |
||||
<Unit unit={unit} key={index} /> |
||||
))} |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
export default Season; |
Loading…
Reference in new issue