You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

84 lines
3.0 KiB

import React from "react";
import { View, Text, Image, Dimensions } from "react-native";
import tw from "tailwind-rn";
import Tab from "../Tab";
import Colors from "../../../constants/Colors";
const { width} = Dimensions.get("window");
export default function Content({ data, grades }) {
return (
<View style={tw("flex-1 flex flex-col px-4 pb-20")}>
<View style={tw("flex flex-1 flex-col")}>
<View style={tw("flex w-full flex-row-reverse justify-between")}>
<View style={tw("flex flex-row-reverse")}>
<Image
source={{ uri: "https://dnvn.ir/api/v1/file/2105" }}
style={[{ width: 80, height: 120 }, tw("rounded-md")]}
/>
<View style={tw("flex flex-col items-end mr-3")}>
<Text
style={{
fontFamily: "bold",
fontSize: width / 27,
color: Colors.theme1.light.blue6,
}}
>
{data.book.name}
</Text>
<Text
style={[
tw("mt-1"),
{
fontFamily: "regular",
fontSize: width / 34,
color: Colors.theme1.light.blue5,
},
]}
>
{ 'پایه' + ' ' + grades[data.book.gradeId]}
</Text>
<Text
style={[
tw("mt-1"),
{
fontFamily: "regular",
fontSize: width / 34,
color: Colors.theme1.light.blue5,
},
]}
>{`شما در حال مشاهده صفحه ${data.qr.pageNumber} هستید.`}</Text>
</View>
</View>
</View>
</View>
<Tab
data={{
voice: data.qr.content.filter((obj) => obj.type === 'voice')[0],
video: data.qr.content.filter((obj) => obj.type === 'video')[0],
pdf: data.qr.content.filter((obj) => obj.type === 'pdf')[0],
ppt: data.qr.content.filter((obj) => obj.type === 'ppt')[0],
links: data.qr.content.filter((obj) => obj.type === 'links')[0],
}}
/>
</View>
);
}
Content.defaultProps = {
data: {
name: "ریاضیات گسسته خیلی پیشرفته",
grade: "پایه هفتم ابتدایی",
page: "67",
percent: "62",
voice: { name: "استاد رضایی: فصل پنجم توضیح در مورد آتش فشان ها", file: 1 },
video: { name: "ویدئوی آزمایش آتشفشان سرکه ای", file: 1 },
pdf: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
ppt: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
links: [
"وبسایت آموزشی دانوین",
"وبسایت رسمی مدیریت راهبردی کشور",
"سازمان تبلیغات صنایع سبک ",
],
},
};