|
|
|
@ -13,7 +13,9 @@ export const Hashtags = ({ hashtags, theme, setHashtag, hashtag }) => { |
|
|
|
|
return ( |
|
|
|
|
<View |
|
|
|
|
style={[ |
|
|
|
|
tw("flex flex-row-reverse pl-3 rounded-full items-center w-full mb-7 mt-3"), |
|
|
|
|
tw( |
|
|
|
|
"flex flex-row-reverse pl-3 rounded-full items-center w-full mb-7 mt-3" |
|
|
|
|
), |
|
|
|
|
{ |
|
|
|
|
borderWidth: 2, |
|
|
|
|
borderColor: Colors.theme1.greenFF1 + (theme === "light" ? "" : "55"), |
|
|
|
@ -35,13 +37,13 @@ export const Hashtags = ({ hashtags, theme, setHashtag, hashtag }) => { |
|
|
|
|
horizontal={true} |
|
|
|
|
inverted={true} |
|
|
|
|
style={[tw("flex flex-row mt-3 pb-3 mr-2")]} |
|
|
|
|
data={hashtags} |
|
|
|
|
data={["همه", ...hashtags]} |
|
|
|
|
renderItem={({ item }) => ( |
|
|
|
|
<Hashtag |
|
|
|
|
hashtag={item} |
|
|
|
|
theme={theme} |
|
|
|
|
setHashtag={setHashtag} |
|
|
|
|
activeTag={hashtag} |
|
|
|
|
activeTag={hashtag || "همه"} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
keyExtractor={(item, index) => { |
|
|
|
@ -56,9 +58,20 @@ const Hashtag = ({ hashtag, theme, setHashtag, activeTag }) => { |
|
|
|
|
const active = React.useMemo(() => { |
|
|
|
|
return activeTag === hashtag; |
|
|
|
|
}, [hashtag, activeTag]); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Pressable |
|
|
|
|
onPress={() => (active ? setHashtag(null) : setHashtag(hashtag))} |
|
|
|
|
onPress={() => { |
|
|
|
|
if (hashtag === "همه") { |
|
|
|
|
return setHashtag("همه"); |
|
|
|
|
} else { |
|
|
|
|
if (active) { |
|
|
|
|
setHashtag("همه"); |
|
|
|
|
} else { |
|
|
|
|
setHashtag(hashtag); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={[ |
|
|
|
|