From 92eaadbb19ae875a23ec3e8fdf93a8f71e2ba593 Mon Sep 17 00:00:00 2001 From: symphony-dev Date: Wed, 6 Apr 2022 14:21:17 +0500 Subject: [PATCH] Dependencies updated & Stack navigator issues fixed --- navigation/Menu.js | 73 ++++++++++++++++++++++------------------- navigation/Screens.js | 29 ++++++++++++++--- screens/Articles.js | 59 +++++++++++++++++---------------- screens/Elements.js | 76 ++++++++++++++++++++++++++++--------------- 4 files changed, 143 insertions(+), 94 deletions(-) diff --git a/navigation/Menu.js b/navigation/Menu.js index 6c59efe..fda94f7 100644 --- a/navigation/Menu.js +++ b/navigation/Menu.js @@ -1,26 +1,23 @@ -import React from "react"; -import { - ScrollView, - StyleSheet, - Image -} from "react-native"; import { Block, Text, theme } from "galio-framework"; +import { Image, ScrollView, StyleSheet } from "react-native"; +import { DrawerItem as DrawerCustomItem } from "../components"; import Images from "../constants/Images"; -import { DrawerItem as DrawerCustomItem } from '../components'; +import React from "react"; -function CustomDrawerContent({ drawerPosition, navigation, profile, focused, state, ...rest }) { - const screens = [ - "Home", - "Profile", - "Account", - "Elements", - "Articles", - ]; +function CustomDrawerContent({ + drawerPosition, + navigation, + profile, + focused, + state, + ...rest +}) { + const screens = ["Home", "Profile", "Account", "Elements", "Articles"]; return ( @@ -28,27 +25,37 @@ function CustomDrawerContent({ drawerPosition, navigation, profile, focused, sta {screens.map((item, index) => { - return ( - - ); - })} - - - DOCUMENTATION - - + return ( + + ); + })} + + + + DOCUMENTATION + + + ); } - const styles = StyleSheet.create({ container: { flex: 1, @@ -57,8 +64,8 @@ const styles = StyleSheet.create({ paddingHorizontal: 28, paddingBottom: theme.SIZES.BASE, paddingTop: theme.SIZES.BASE * 3, - justifyContent: 'center' - } + justifyContent: "center", + }, }); export default CustomDrawerContent; diff --git a/navigation/Screens.js b/navigation/Screens.js index 8bc7051..804a0ba 100644 --- a/navigation/Screens.js +++ b/navigation/Screens.js @@ -66,7 +66,12 @@ function ElementsStack(props) { function ArticlesStack(props) { return ( - + + + + @@ -125,7 +126,7 @@ class Articles extends React.Component { showsHorizontalScrollIndicator={false} snapToInterval={cardWidth + theme.SIZES.BASE * 0.375} contentContainerStyle={{ - paddingHorizontal: theme.SIZES.BASE / 2 + paddingHorizontal: theme.SIZES.BASE / 2, }} > {categories && @@ -183,9 +184,7 @@ class Articles extends React.Component { render() { return ( - + {this.renderCards()} {this.renderAlbum()} @@ -199,33 +198,33 @@ const styles = StyleSheet.create({ paddingBottom: theme.SIZES.BASE, paddingHorizontal: theme.SIZES.BASE * 2, marginTop: 22, - color: argonTheme.COLORS.HEADER + color: argonTheme.COLORS.HEADER, }, group: { - paddingTop: theme.SIZES.BASE + paddingTop: theme.SIZES.BASE, }, albumThumb: { borderRadius: 4, marginVertical: 4, alignSelf: "center", width: thumbMeasure, - height: thumbMeasure + height: thumbMeasure, }, category: { backgroundColor: theme.COLORS.WHITE, marginVertical: theme.SIZES.BASE / 2, - borderWidth: 0 + borderWidth: 0, }, categoryTitle: { height: "100%", paddingHorizontal: theme.SIZES.BASE, backgroundColor: "rgba(0, 0, 0, 0.5)", justifyContent: "center", - alignItems: "center" + alignItems: "center", }, imageBlock: { overflow: "hidden", - borderRadius: 4 + borderRadius: 4, }, productItem: { width: cardWidth - theme.SIZES.BASE * 2, @@ -233,21 +232,21 @@ const styles = StyleSheet.create({ shadowColor: "black", shadowOffset: { width: 0, height: 7 }, shadowRadius: 10, - shadowOpacity: 0.2 + shadowOpacity: 0.2, }, productImage: { width: cardWidth - theme.SIZES.BASE, height: cardWidth - theme.SIZES.BASE, - borderRadius: 3 + borderRadius: 3, }, productPrice: { paddingTop: theme.SIZES.BASE, - paddingBottom: theme.SIZES.BASE / 2 + paddingBottom: theme.SIZES.BASE / 2, }, productDescription: { - paddingTop: theme.SIZES.BASE + paddingTop: theme.SIZES.BASE, // paddingBottom: theme.SIZES.BASE * 2, - } + }, }); export default Articles; diff --git a/screens/Elements.js b/screens/Elements.js index da540eb..7a73d80 100644 --- a/screens/Elements.js +++ b/screens/Elements.js @@ -1,20 +1,26 @@ -import React from "react"; -import { ScrollView, StyleSheet, Dimensions, TouchableOpacity } from "react-native"; // Galio components -import { Block, Text, Button as GaButton, theme } from "galio-framework"; +import { Block, Button as GaButton, Text, theme } from "galio-framework"; +import { Button, Header, Icon, Input, Select, Switch } from "../components/"; +import { + Dimensions, + ScrollView, + StyleSheet, + TouchableOpacity, +} from "react-native"; // Argon themed components import { argonTheme, tabs } from "../constants/"; -import { Button, Select, Icon, Input, Header, Switch } from "../components/"; + +import React from "react"; const { width } = Dimensions.get("screen"); class Elements extends React.Component { state = { "switch-1": true, - "switch-2": false + "switch-2": false, }; - toggleSwitch = switchId => + toggleSwitch = (switchId) => this.setState({ [switchId]: !this.state[switchId] }); renderButtons = () => { @@ -62,7 +68,7 @@ class Elements extends React.Component { - +