update 10 files

master
Reza_ashrafi 2 years ago
parent e7bd957157
commit 9e67bae334
  1. 2
      src/components/CustomTextInput.js
  2. 2
      src/redux/reducers/blog.js
  3. 2
      src/screens/Blogs/index.js
  4. 21
      src/screens/Blogs/layouts/Hashtags.js
  5. 18
      src/screens/Home/components/Header.js
  6. 6
      src/screens/Home/index.js
  7. 1
      src/screens/Login/index.js
  8. 1
      src/screens/Otp/index.js
  9. 2
      src/screens/Videos/components/MostViewedVideo.js

@ -25,6 +25,7 @@ const FloatingLabelInput = ({
theme, theme,
defaultValue, defaultValue,
editable = true, editable = true,
onSubmitEditing = () => {},
...props ...props
}) => { }) => {
const [isFocused, setIsFocused] = React.useState(false); const [isFocused, setIsFocused] = React.useState(false);
@ -96,6 +97,7 @@ const FloatingLabelInput = ({
multiline={multiline} multiline={multiline}
editable={editable} editable={editable}
placeholderTextColor={theme === 'light' ? Colors.theme1.gray20 + 'aa' : Colors.theme1.white + '55'} placeholderTextColor={theme === 'light' ? Colors.theme1.gray20 + 'aa' : Colors.theme1.white + '55'}
onSubmitEditing={() => onSubmitEditing()}
/> />
</View> </View>
); );

@ -4,7 +4,7 @@ const initialState = {
list: null, list: null,
info: null, info: null,
hashtags : [], hashtags : [],
hashtag : null, hashtag : "همه",
}; };
export default function blog(state = initialState, action) { export default function blog(state = initialState, action) {
let { type, data } = action; let { type, data } = action;

@ -75,7 +75,7 @@ function Blogs({ getList, blogs, hashtag, setHashtag, theme }) {
/> />
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<Hashtags /> <Hashtags />
{hashtag ? ( {hashtag !== 'همه' ? (
<FlatList <FlatList
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={tw("px-4")} style={tw("px-4")}

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

@ -21,7 +21,8 @@ const Header = ({ title, route, mobile, theme, state = null }) => {
<Text <Text
style={[ style={[
{ {
color: theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white, color:
theme === "light" ? Colors.theme1.green79 : Colors.theme1.white,
fontFamily: "demi", fontFamily: "demi",
fontSize: fontSize.lg, fontSize: fontSize.lg,
}, },
@ -34,11 +35,16 @@ const Header = ({ title, route, mobile, theme, state = null }) => {
onPress={() => navigation.navigate(route, state)} onPress={() => navigation.navigate(route, state)}
style={{ transform: [{ translateX: -fontSize.xl6 / 3 }] }} style={{ transform: [{ translateX: -fontSize.xl6 / 3 }] }}
> >
<Entypo <Text
name="chevron-small-left" style={{
size={fontSize.xl6} color:
color={theme === 'light' ? Colors.theme1.green79 : Colors.theme1.white} theme === "light" ? Colors.theme1.green79 : Colors.theme1.white,
/> fontSize: fontSize.sm,
fontFamily: "light",
}}
>
مشاهده همه
</Text>
</Pressable> </Pressable>
) : null} ) : null}
</View> </View>

@ -50,9 +50,11 @@ const Home = ({
React.useEffect(() => { React.useEffect(() => {
if (!blogs) { if (!blogs) {
getBlogs(); getBlogs();
} else if (!books) { }
if (!books) {
getBooks({ vod: true }); getBooks({ vod: true });
} else if (!userProducts) { }
if (!userProducts) {
getUserProducts(); getUserProducts();
} }
}, []); }, []);

@ -155,6 +155,7 @@ function Login(props) {
autoFocus={true} autoFocus={true}
direction="ltr" direction="ltr"
regex={(text) => onInput.phonenumber(text)} regex={(text) => onInput.phonenumber(text)}
onSubmitEditing={() => submit()}
/> />
</View> </View>
{!props.mobile ? <View style={tw("mt-10")}></View> : null} {!props.mobile ? <View style={tw("mt-10")}></View> : null}

@ -350,6 +350,7 @@ function Otp(props) {
regex={onInput.numberOnly} regex={onInput.numberOnly}
direction="ltr" direction="ltr"
keyboardType="numeric" keyboardType="numeric"
onSubmitEditing={() => submit()}
/> />
</View> </View>
<TouchableOpacity <TouchableOpacity

@ -110,7 +110,7 @@ function MostViewedVideo({ videos, grades, mobile, theme }) {
}, },
]} ]}
> >
{separate(video?.product[2]?.price)} {console.log(video?.product?.filter((product) => product?.productType === 4)[0]?.price)}
</Text> </Text>
</View> </View>

Loading…
Cancel
Save