diff --git a/.env b/.env index cbb576e..259859e 100644 --- a/.env +++ b/.env @@ -1 +1,11 @@ -COINGECKO_API_KEY = CG-UtAvbp9TnEjhPSvXfMFTe8Dz \ No newline at end of file +COINGECKO_API_KEY = CG-UtAvbp9TnEjhPSvXfMFTe8Dz + +FIREBASE_API_KEY = AIzaSyBo1BDdUIC_4Oiqqa0klf8KPP1JlvNhPwE +FIREBASE_AUTH_DOMAIN = mycoins-ebac8.firebaseapp.com +FIREBASE_PROJECT_ID = mycoins-ebac8 +FIREBASE_STORAGE_BUCKET = mycoins-ebac8.appspot.com +FIREBASE_MESSAGING_SENDER_ID = 597544437119 +FIREBASE_APP_ID = 1:597544437119:web:bdd50f432d6e4f0ccf464a +FIREBASE_MEASUREMENT_ID = G-3Z3ZVXZQ3V + +GOOGLE_MAPS_API_KEY = AIzaSyCLqIJhsVysRvFMdEFYXDWfCj94y-W9cuM \ No newline at end of file diff --git a/ios/MyCoins.xcodeproj/project.pbxproj b/ios/MyCoins.xcodeproj/project.pbxproj index de8d78f..8cc2a90 100644 --- a/ios/MyCoins.xcodeproj/project.pbxproj +++ b/ios/MyCoins.xcodeproj/project.pbxproj @@ -693,11 +693,7 @@ "-DFOLLY_USE_LIBCPP=1", "-DFOLLY_CFG_NO_COROUTINES=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; @@ -765,11 +761,7 @@ "-DFOLLY_USE_LIBCPP=1", "-DFOLLY_CFG_NO_COROUTINES=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index eaf5d8d..a4188a2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1115,7 +1115,7 @@ PODS: - React-jsi (= 0.73.4) - React-logger (= 0.73.4) - React-perflogger (= 0.73.4) - - RNCAsyncStorage (1.22.2): + - RNCAsyncStorage (1.22.3): - React-Core - RNPermissions (4.1.4): - React-Core @@ -1393,12 +1393,12 @@ SPEC CHECKSUMS: React-runtimescheduler: ed48e5faac6751e66ee1261c4bd01643b436f112 React-utils: 6e5ad394416482ae21831050928ae27348f83487 ReactCommon: 840a955d37b7f3358554d819446bffcf624b2522 - RNCAsyncStorage: 014a78b2cc8cc107c9e92ee428dc0c1ac3223416 + RNCAsyncStorage: 10591b9e0a91eaffee14e69b3721009759235125 RNPermissions: 58ee5afa4777d05c5922b80cd85171d5ec9e0ce9 RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312 + Yoga: 64cd2a583ead952b0315d5135bf39e053ae9be70 PODFILE CHECKSUM: 7e6c6eee90d53c14cbc62b7bfad7234b931020e1 -COCOAPODS: 1.15.2 +COCOAPODS: 1.11.3 diff --git a/src/components/MainPage/ListAllExchange.tsx b/src/components/MainPage/ListAllExchange.tsx new file mode 100644 index 0000000..5d6f768 --- /dev/null +++ b/src/components/MainPage/ListAllExchange.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { + StyleSheet, + View, + Image, + Touchable, + TouchableOpacity, +} from 'react-native'; +import {Text} from 'react-native-elements'; +import Feather from 'react-native-vector-icons/Feather'; + +interface MainItemBoxProps { + item: MainItem; + onFavoritePress: (id: string) => void; + onPress?: () => void; +} + +interface MainItem { + id: string; + name: string; +} + +const ListAllExchange: React.FC = ({ + item, + onFavoritePress, + onPress, +}: MainItemBoxProps) => { + return ( + + + + {item.name} + { + onFavoritePress(item.id); + }} + /> + + + + ); +}; + +const styles = StyleSheet.create({ + card: { + flexDirection: 'row', + height: 200, + alignItems: 'center', + backgroundColor: '#213056', + borderRadius: 10, + padding: 20, + marginBottom: 10, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2, + }, + shadowOpacity: 0.25, + shadowRadius: 3.84, + elevation: 5, + }, + image: { + width: 80, + height: 80, + resizeMode: 'contain', + marginRight: 10, + }, + details: { + flex: 1, + }, + name: { + fontSize: 20, + fontWeight: 'bold', + marginBottom: 5, + color: '#ffffff', + }, + symbol: { + fontSize: 16, + color: '#ffffff', + marginBottom: 5, + }, + + id: { + fontSize: 12, + color: '#ffffff', + }, +}); + +export default ListAllExchange; diff --git a/src/components/MainPage/ListAllNft.tsx b/src/components/MainPage/ListAllNft.tsx new file mode 100644 index 0000000..7b261b6 --- /dev/null +++ b/src/components/MainPage/ListAllNft.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { + StyleSheet, + View, + Image, + Touchable, + TouchableOpacity, +} from 'react-native'; +import {Text} from 'react-native-elements'; +import Feather from 'react-native-vector-icons/Feather'; + +interface MainItemBoxProps { + item: MainItem; + onFavoritePress: (id: string) => void; + onPress?: () => void; +} + +interface MainItem { + id: string; + name: string; +} + +const ListAllNft: React.FC = ({ + item, + onFavoritePress, + onPress, +}: MainItemBoxProps) => { + return ( + + + + {item.name} + { + onFavoritePress(item.id); + }} + /> + + + + ); +}; + +const styles = StyleSheet.create({ + card: { + flexDirection: 'row', + height: 200, + alignItems: 'center', + backgroundColor: '#213056', + borderRadius: 10, + padding: 20, + marginBottom: 10, + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2, + }, + shadowOpacity: 0.25, + shadowRadius: 3.84, + elevation: 5, + }, + image: { + width: 80, + height: 80, + resizeMode: 'contain', + marginRight: 10, + }, + details: { + flex: 1, + }, + name: { + fontSize: 20, + fontWeight: 'bold', + marginBottom: 5, + color: '#ffffff', + }, + symbol: { + fontSize: 16, + color: '#ffffff', + marginBottom: 5, + }, + + id: { + fontSize: 12, + color: '#ffffff', + }, +}); + +export default ListAllNft; diff --git a/src/components/MainPage/ListExchange.tsx b/src/components/MainPage/ListExchange.tsx index 94c96dd..a5ed485 100644 --- a/src/components/MainPage/ListExchange.tsx +++ b/src/components/MainPage/ListExchange.tsx @@ -1,11 +1,12 @@ import React from 'react'; -import {StyleSheet, View, Image} from 'react-native'; +import {StyleSheet, View, Image, Touchable, TouchableOpacity} from 'react-native'; import {Text} from 'react-native-elements'; import Feather from 'react-native-vector-icons/Feather'; interface MainItemBoxProps { item: MainItem; onFavoritePress: (id: string) => void; + onPress?: () => void; } interface MainItem { @@ -18,23 +19,26 @@ interface MainItem { const ListExchange: React.FC = ({ item, onFavoritePress, + onPress, }: MainItemBoxProps) => { return ( - - - - {item.name} - {item.symbol} - { - onFavoritePress(item.id); - }} - /> + + + + + {item.name} + {item.symbol} + { + onFavoritePress(item.id); + }} + /> + - + ); }; diff --git a/src/components/MainPage/ModalNftContent.tsx b/src/components/MainPage/ModalNftContent.tsx index a77b1b3..b295e0a 100644 --- a/src/components/MainPage/ModalNftContent.tsx +++ b/src/components/MainPage/ModalNftContent.tsx @@ -2,47 +2,84 @@ import React from 'react'; import {ScrollView, StyleSheet, View, Image} from 'react-native'; import {Text} from 'react-native-elements'; -type ModalCoinContentProps = { +type ModalNftContentProps = { item: itemContent; }; type itemContent = { - description: { - en: string; - }; + description: string; id: string; name: string; symbol: string; image: { - large: string; + small: string; }; }; -function ModalNftContent({item}: ModalCoinContentProps): React.JSX.Element { +function ModalNftContent({item}: ModalNftContentProps): React.JSX.Element { return ( - - - - - Id: {item.id} - Name: {item.name} - Symbol: {item.symbol} - Description: {item.description.en} + + + + + {item.name} + | {item.symbol} + ID: {item.id} + Description + + {truncateString(item.description, 1000)} + ); } +function truncateString(str: string, num: number) { + if (str && num) { + if (str.length <= num) { + return str; + } + return str?.slice(0, num) + '...'; + } +} + const styles = StyleSheet.create({ container: { flex: 1, }, + topRow: { + flexDirection: 'row', + alignItems: 'center', + marginTop: 10, + }, image: { width: 80, height: 80, resizeMode: 'contain', marginRight: 10, + borderRadius: 40, + }, + columnData: { + flex: 1, + flexDirection: 'column', + }, + name: { + fontSize: 25, + fontWeight: 'bold', + }, + symbol: { + fontSize: 22, + textTransform: 'uppercase', + }, + descriptionTitle: { + fontSize: 25, + fontWeight: 'bold', + marginTop: 30, + }, + description: { + marginTop: 10, + fontSize: 16, }, }); diff --git a/src/contexts/AuthContext.tsx b/src/contexts/AuthContext.tsx index 4da0107..6eb4613 100644 --- a/src/contexts/AuthContext.tsx +++ b/src/contexts/AuthContext.tsx @@ -38,12 +38,12 @@ import useToast from '../hooks/useToast'; // Your web app's Firebase configuration const firebaseConfig = { - apiKey: process.env.FIREBASE_API_KEY, - authDomain: process.env.FIREBASE_AUTH_DOMAIN, - projectId: process.env.FIREBASE_PROJECT_ID, - storageBucket: process.env.FIREBASE_STORAGE_BUCKET, - messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID, - appId: process.env.FIREBASE_APP_ID, + apiKey: 'AIzaSyBo1BDdUIC_4Oiqqa0klf8KPP1JlvNhPwE', + authDomain: 'mycoins-ebac8.firebaseapp.com', + projectId: 'mycoins-ebac8', + storageBucket: 'mycoins-ebac8.appspot.com', + messagingSenderId: '597544437119', + appId: '1:597544437119:web:bdd50f432d6e4f0ccf464a', }; // Initialize Firebase diff --git a/src/navigation/AppNavigationStack.tsx b/src/navigation/AppNavigationStack.tsx index 8dbce06..3159dd9 100644 --- a/src/navigation/AppNavigationStack.tsx +++ b/src/navigation/AppNavigationStack.tsx @@ -1,16 +1,38 @@ import * as React from 'react'; import {createNativeStackNavigator} from '@react-navigation/native-stack'; import Home from '../screens/Home'; -import Login from '../screens/Login'; -import Register from '../screens/Register'; import Search from '../screens/Search'; +import AllNft from '../screens/NftScreen'; +import {Button} from 'react-native-elements'; +import AllExchange from '../screens/ExchangeScreen'; const Stack = createNativeStackNavigator(); const AppStack: React.FC = () => { return ( - + + + ({ + headerShown: true, + headerLeft: () => ( +