|
|
|
@ -12,41 +12,52 @@ import Links from "../Content/Links"; |
|
|
|
|
//assets
|
|
|
|
|
import tw from "tailwind-rn"; |
|
|
|
|
import Colors from "../../../constants/Colors"; |
|
|
|
|
import fontSize from "../../../constants/fontSize"; |
|
|
|
|
|
|
|
|
|
const { width } = Dimensions.get("window"); |
|
|
|
|
|
|
|
|
|
function Tab({ data, theme }) { |
|
|
|
|
const [dataType, setDataType] = useState("all"); |
|
|
|
|
|
|
|
|
|
const light = React.useMemo(() => { |
|
|
|
|
return theme === "light"; |
|
|
|
|
}, [theme]); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View |
|
|
|
|
style={[ |
|
|
|
|
tw("w-full flex rounded-md overflow-hidden mt-4"), |
|
|
|
|
{ borderWidth: 1, borderColor: Colors.theme1.blue5 }, |
|
|
|
|
{ borderWidth: 1, borderColor: Colors.theme1.greenBA + "aa" }, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<View style={tw("w-full flex flex-row-reverse justify-between px-0.5")}> |
|
|
|
|
<View style={tw("w-full flex flex-row-reverse justify-between")}> |
|
|
|
|
<TouchableOpacity |
|
|
|
|
onPress={() => setDataType("all")} |
|
|
|
|
style={[ |
|
|
|
|
tw("py-2 w-1/6"), |
|
|
|
|
{ |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderColor: |
|
|
|
|
dataType === "all" |
|
|
|
|
? Colors.theme1.blue3 |
|
|
|
|
: Colors.theme1.blue5, |
|
|
|
|
borderBottomWidth: dataType === "all" ? 0 : 1, |
|
|
|
|
borderColor: Colors.theme1.greenBA + "aa", |
|
|
|
|
backgroundColor: |
|
|
|
|
dataType === "all" ? Colors.theme1.blue3 : "white", |
|
|
|
|
dataType === "all" |
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 38, |
|
|
|
|
fontFamily: dataType === "all" ? "bold" : "light", |
|
|
|
|
fontSize: fontSize.xs, |
|
|
|
|
fontFamily: dataType === "all" ? "regular" : "light", |
|
|
|
|
textAlign: "center", |
|
|
|
|
color: Colors.theme1.blue5, |
|
|
|
|
color: |
|
|
|
|
dataType === "all" |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
تمامی محتوا |
|
|
|
@ -57,22 +68,28 @@ function Tab({ data, theme }) { |
|
|
|
|
style={[ |
|
|
|
|
tw("py-2 w-1/6"), |
|
|
|
|
{ |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderColor: |
|
|
|
|
dataType === "voice" |
|
|
|
|
? Colors.theme1.blue3 |
|
|
|
|
: Colors.theme1.blue5, |
|
|
|
|
borderBottomWidth: dataType === "voice" ? 0 : 1, |
|
|
|
|
borderColor: Colors.theme1.greenBA + "aa", |
|
|
|
|
backgroundColor: |
|
|
|
|
dataType === "voice" ? Colors.theme1.blue3 : "white", |
|
|
|
|
dataType === "voice" |
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 38, |
|
|
|
|
fontSize: fontSize.xs, |
|
|
|
|
fontFamily: dataType === "voice" ? "bold" : "light", |
|
|
|
|
textAlign: "center", |
|
|
|
|
color: Colors.theme1.blue5, |
|
|
|
|
color: |
|
|
|
|
dataType === "voice" |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
صوت |
|
|
|
@ -84,21 +101,27 @@ function Tab({ data, theme }) { |
|
|
|
|
tw("py-2 w-1/6"), |
|
|
|
|
{ |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderColor: |
|
|
|
|
dataType === "video" |
|
|
|
|
? Colors.theme1.blue3 |
|
|
|
|
: Colors.theme1.blue5, |
|
|
|
|
borderColor: Colors.theme1.greenBA + "aa", |
|
|
|
|
backgroundColor: |
|
|
|
|
dataType === "video" ? Colors.theme1.blue3 : "white", |
|
|
|
|
dataType === "video" |
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 38, |
|
|
|
|
fontSize: fontSize.xs, |
|
|
|
|
fontFamily: dataType === "video" ? "bold" : "light", |
|
|
|
|
textAlign: "center", |
|
|
|
|
color: Colors.theme1.blue5, |
|
|
|
|
color: |
|
|
|
|
dataType === "video" |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
ویدئو |
|
|
|
@ -110,21 +133,27 @@ function Tab({ data, theme }) { |
|
|
|
|
tw("py-2 w-1/6"), |
|
|
|
|
{ |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderColor: |
|
|
|
|
dataType === "pdf" |
|
|
|
|
? Colors.theme1.blue3 |
|
|
|
|
: Colors.theme1.blue5, |
|
|
|
|
borderColor: Colors.theme1.greenBA + "aa", |
|
|
|
|
backgroundColor: |
|
|
|
|
dataType === "pdf" ? Colors.theme1.blue3 : "white", |
|
|
|
|
dataType === "pdf" |
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 38, |
|
|
|
|
fontSize: fontSize.xs, |
|
|
|
|
fontFamily: dataType === "pdf" ? "bold" : "light", |
|
|
|
|
textAlign: "center", |
|
|
|
|
color: Colors.theme1.blue5, |
|
|
|
|
color: |
|
|
|
|
dataType === "pdf" |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
پی دی اف |
|
|
|
@ -136,21 +165,27 @@ function Tab({ data, theme }) { |
|
|
|
|
tw("py-2 w-1/6"), |
|
|
|
|
{ |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderColor: |
|
|
|
|
dataType === "ppt" |
|
|
|
|
? Colors.theme1.blue3 |
|
|
|
|
: Colors.theme1.blue5, |
|
|
|
|
borderColor: Colors.theme1.greenBA + "aa", |
|
|
|
|
backgroundColor: |
|
|
|
|
dataType === "ppt" ? Colors.theme1.blue3 : "white", |
|
|
|
|
dataType === "ppt" |
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 38, |
|
|
|
|
fontSize: fontSize.xs, |
|
|
|
|
fontFamily: dataType === "ppt" ? "bold" : "light", |
|
|
|
|
textAlign: "center", |
|
|
|
|
color: Colors.theme1.blue5, |
|
|
|
|
color: |
|
|
|
|
dataType === "ppt" |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
پاور پوینت |
|
|
|
@ -162,21 +197,27 @@ function Tab({ data, theme }) { |
|
|
|
|
tw("py-2 w-1/6"), |
|
|
|
|
{ |
|
|
|
|
borderBottomWidth: 1, |
|
|
|
|
borderColor: |
|
|
|
|
dataType === "links" |
|
|
|
|
? Colors.theme1.blue3 |
|
|
|
|
: Colors.theme1.blue5, |
|
|
|
|
borderColor: Colors.theme1.greenBA + "aa", |
|
|
|
|
backgroundColor: |
|
|
|
|
dataType === "links" ? Colors.theme1.blue3 : "white", |
|
|
|
|
dataType === "links" |
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: Colors.theme1.dark, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 38, |
|
|
|
|
fontSize: fontSize.xs, |
|
|
|
|
fontFamily: dataType === "links" ? "bold" : "light", |
|
|
|
|
textAlign: "center", |
|
|
|
|
color: Colors.theme1.blue5, |
|
|
|
|
color: |
|
|
|
|
dataType === "links" |
|
|
|
|
? Colors.theme1.white |
|
|
|
|
: light |
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
: Colors.theme1.white, |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
لینک ها |
|
|
|
@ -186,23 +227,24 @@ function Tab({ data, theme }) { |
|
|
|
|
<View style={tw("flex w-full p-4")}> |
|
|
|
|
{dataType === "all" ? ( |
|
|
|
|
<> |
|
|
|
|
{data.voice ? <Voice data={data.voice} /> : null} |
|
|
|
|
{data.video ? <Video data={data.video} /> : null} |
|
|
|
|
{data.ppt ? <PPT data={data.ppt} /> : null} |
|
|
|
|
{data.pdf ? <PDF data={data.pdf} /> : null} |
|
|
|
|
{data.links ? <Links data={data.links} /> : null} |
|
|
|
|
{data.voice ? <Voice data={data.voice} theme={theme} /> : null} |
|
|
|
|
{data.video ? <Video data={data.video} theme={theme} /> : null} |
|
|
|
|
{data.ppt ? <PPT data={data.ppt} theme={theme} /> : null} |
|
|
|
|
{data.pdf ? <PDF data={data.pdf} theme={theme} /> : null} |
|
|
|
|
{data.links ? <Links data={data.links} theme={theme} /> : null} |
|
|
|
|
</> |
|
|
|
|
) : null} |
|
|
|
|
{dataType === "voice" ? ( |
|
|
|
|
<> |
|
|
|
|
{data.voice ? ( |
|
|
|
|
<Voice data={data.voice} /> |
|
|
|
|
<Voice data={data.voice} theme={theme} /> |
|
|
|
|
) : ( |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 31, |
|
|
|
|
color: "#707070", |
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
color: light ? Colors.theme1.gray2077 : Colors.theme1.white, |
|
|
|
|
fontFamily: "light", |
|
|
|
|
textAlign: "right", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
فایل صدا یافت نشد. |
|
|
|
@ -213,13 +255,14 @@ function Tab({ data, theme }) { |
|
|
|
|
{dataType === "video" ? ( |
|
|
|
|
<> |
|
|
|
|
{data.video ? ( |
|
|
|
|
<Video data={data.video} /> |
|
|
|
|
<Video data={data.video} theme={theme} /> |
|
|
|
|
) : ( |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 31, |
|
|
|
|
color: "#707070", |
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
color: light ? Colors.theme1.gray2077 : Colors.theme1.white, |
|
|
|
|
fontFamily: "light", |
|
|
|
|
textAlign: "right", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
فایل تصویری یافت نشد. |
|
|
|
@ -230,13 +273,14 @@ function Tab({ data, theme }) { |
|
|
|
|
{dataType === "ppt" ? ( |
|
|
|
|
<> |
|
|
|
|
{data.ppt ? ( |
|
|
|
|
<PPT data={data.ppt} /> |
|
|
|
|
<PPT data={data.ppt} theme={theme} /> |
|
|
|
|
) : ( |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 31, |
|
|
|
|
color: "#707070", |
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
color: light ? Colors.theme1.gray2077 : Colors.theme1.white, |
|
|
|
|
fontFamily: "light", |
|
|
|
|
textAlign: "right", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
فایل پاورپوینت یافت نشد. |
|
|
|
@ -247,13 +291,14 @@ function Tab({ data, theme }) { |
|
|
|
|
{dataType === "pdf" ? ( |
|
|
|
|
<> |
|
|
|
|
{data.pdf ? ( |
|
|
|
|
<PDF data={data.pdf} /> |
|
|
|
|
<PDF data={data.pdf} theme={theme} /> |
|
|
|
|
) : ( |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 31, |
|
|
|
|
color: "#707070", |
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
color: light ? Colors.theme1.gray2077 : Colors.theme1.white, |
|
|
|
|
fontFamily: "light", |
|
|
|
|
textAlign: "right", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
فایل پی دی اف یافت نشد. |
|
|
|
@ -264,13 +309,14 @@ function Tab({ data, theme }) { |
|
|
|
|
{dataType === "links" ? ( |
|
|
|
|
<> |
|
|
|
|
{data.links ? ( |
|
|
|
|
<Links data={data.links} /> |
|
|
|
|
<Links data={data.links} theme={theme} /> |
|
|
|
|
) : ( |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontSize: width / 31, |
|
|
|
|
color: "#707070", |
|
|
|
|
fontSize: fontSize.tiny, |
|
|
|
|
color: light ? Colors.theme1.gray2077 : Colors.theme1.white, |
|
|
|
|
fontFamily: "light", |
|
|
|
|
textAlign: "right", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
لینکی پیدا نشد. |
|
|
|
|