diff --git a/src/components/CustomTextInput.js b/src/components/CustomTextInput.js index 1b87b3e..c4c39f4 100644 --- a/src/components/CustomTextInput.js +++ b/src/components/CustomTextInput.js @@ -25,6 +25,7 @@ const FloatingLabelInput = ({ theme, defaultValue, editable = true, + onSubmitEditing = () => {}, ...props }) => { const [isFocused, setIsFocused] = React.useState(false); @@ -96,6 +97,7 @@ const FloatingLabelInput = ({ multiline={multiline} editable={editable} placeholderTextColor={theme === 'light' ? Colors.theme1.gray20 + 'aa' : Colors.theme1.white + '55'} + onSubmitEditing={() => onSubmitEditing()} /> ); diff --git a/src/redux/reducers/blog.js b/src/redux/reducers/blog.js index b8e0eb9..560f55d 100644 --- a/src/redux/reducers/blog.js +++ b/src/redux/reducers/blog.js @@ -4,7 +4,7 @@ const initialState = { list: null, info: null, hashtags : [], - hashtag : null, + hashtag : "همه", }; export default function blog(state = initialState, action) { let { type, data } = action; diff --git a/src/screens/Blogs/index.js b/src/screens/Blogs/index.js index 18186df..65ec77f 100644 --- a/src/screens/Blogs/index.js +++ b/src/screens/Blogs/index.js @@ -75,7 +75,7 @@ function Blogs({ getList, blogs, hashtag, setHashtag, theme }) { /> - {hashtag ? ( + {hashtag !== 'همه' ? ( { return ( { horizontal={true} inverted={true} style={[tw("flex flex-row mt-3 pb-3 mr-2")]} - data={hashtags} + data={["همه", ...hashtags]} renderItem={({ item }) => ( )} keyExtractor={(item, index) => { @@ -56,9 +58,20 @@ const Hashtag = ({ hashtag, theme, setHashtag, activeTag }) => { const active = React.useMemo(() => { return activeTag === hashtag; }, [hashtag, activeTag]); + return ( (active ? setHashtag(null) : setHashtag(hashtag))} + onPress={() => { + if (hashtag === "همه") { + return setHashtag("همه"); + } else { + if (active) { + setHashtag("همه"); + } else { + setHashtag(hashtag); + } + } + }} > { { onPress={() => navigation.navigate(route, state)} style={{ transform: [{ translateX: -fontSize.xl6 / 3 }] }} > - + + مشاهده همه + ) : null} diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index 91b9174..d1fbac5 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -50,9 +50,11 @@ const Home = ({ React.useEffect(() => { if (!blogs) { getBlogs(); - } else if (!books) { + } + if (!books) { getBooks({ vod: true }); - } else if (!userProducts) { + } + if (!userProducts) { getUserProducts(); } }, []); diff --git a/src/screens/Login/index.js b/src/screens/Login/index.js index e3a8a6c..dcf6961 100644 --- a/src/screens/Login/index.js +++ b/src/screens/Login/index.js @@ -155,6 +155,7 @@ function Login(props) { autoFocus={true} direction="ltr" regex={(text) => onInput.phonenumber(text)} + onSubmitEditing={() => submit()} /> {!props.mobile ? : null} diff --git a/src/screens/Otp/index.js b/src/screens/Otp/index.js index 51229e2..7dfe28d 100644 --- a/src/screens/Otp/index.js +++ b/src/screens/Otp/index.js @@ -350,6 +350,7 @@ function Otp(props) { regex={onInput.numberOnly} direction="ltr" keyboardType="numeric" + onSubmitEditing={() => submit()} /> - {separate(video?.product[2]?.price)} + {console.log(video?.product?.filter((product) => product?.productType === 4)[0]?.price)}