From d348688f14899b0afd8ab16794410cb659c35d98 Mon Sep 17 00:00:00 2001 From: ABHIJEET VISHWAKARMA Date: Sun, 23 Jun 2024 17:45:01 +0530 Subject: [PATCH] first --- .gitignore | 6 + api/index.js | 26 +++ app.json | 6 +- app/(tabs)/_layout.tsx | 59 ------- app/(tabs)/index.tsx | 31 ---- app/(tabs)/two.tsx | 31 ---- app/+html.tsx | 38 ----- app/+not-found.tsx | 40 ----- app/_layout.js | 18 ++ app/_layout.tsx | 59 ------- app/home/index.js | 182 ++++++++++++++++++++ app/index.js | 87 ++++++++++ app/modal.tsx | 35 ---- assets/welcome.png | Bin 0 -> 2678559 bytes assets/welcome1.png | Bin 0 -> 803968 bytes babel.config.js | 3 +- components/EditScreenInfo.tsx | 77 --------- components/ExternalLink.tsx | 25 --- components/StyledText.tsx | 5 - components/Themed.tsx | 45 ----- components/__tests__/StyledText-test.js | 10 -- components/categories.js | 62 +++++++ components/imageCard.js | 41 +++++ components/imageGrid.js | 27 +++ components/useClientOnlyValue.ts | 4 - components/useClientOnlyValue.web.ts | 12 -- components/useColorScheme.ts | 1 - components/useColorScheme.web.ts | 8 - constants/Colors.ts | 19 --- constants/data.js | 8 + constants/theme.js | 20 +++ helpers/common.js | 39 +++++ package-lock.json | 217 +++++++++++++++++++++++- package.json | 11 +- 34 files changed, 748 insertions(+), 504 deletions(-) create mode 100644 api/index.js delete mode 100644 app/(tabs)/_layout.tsx delete mode 100644 app/(tabs)/index.tsx delete mode 100644 app/(tabs)/two.tsx delete mode 100644 app/+html.tsx delete mode 100644 app/+not-found.tsx create mode 100644 app/_layout.js delete mode 100644 app/_layout.tsx create mode 100644 app/home/index.js create mode 100644 app/index.js delete mode 100644 app/modal.tsx create mode 100644 assets/welcome.png create mode 100644 assets/welcome1.png delete mode 100644 components/EditScreenInfo.tsx delete mode 100644 components/ExternalLink.tsx delete mode 100644 components/StyledText.tsx delete mode 100644 components/Themed.tsx delete mode 100644 components/__tests__/StyledText-test.js create mode 100644 components/categories.js create mode 100644 components/imageCard.js create mode 100644 components/imageGrid.js delete mode 100644 components/useClientOnlyValue.ts delete mode 100644 components/useClientOnlyValue.web.ts delete mode 100644 components/useColorScheme.ts delete mode 100644 components/useColorScheme.web.ts delete mode 100644 constants/Colors.ts create mode 100644 constants/data.js create mode 100644 constants/theme.js create mode 100644 helpers/common.js diff --git a/.gitignore b/.gitignore index 05647d5..0b37b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,9 @@ yarn-error.* # typescript *.tsbuildinfo + +# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb +# The following patterns were generated by expo-cli + +expo-env.d.ts +# @end expo-cli \ No newline at end of file diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..af4685f --- /dev/null +++ b/api/index.js @@ -0,0 +1,26 @@ +import axios from "axios"; + +const API_KEY = '44542612-f003b071cda57c2bc0b251748'; +const apiUrl = `https://pixabay.com/api/?key=${API_KEY}` +const formateUrl=(params)=>{ + let url = apiUrl + '&per_page=25&safesearch=true&editors_choice=true'; + if(!params) return url; + let paramKeys= Object.keys(params); + paramKeys.map(key=>{ + let value = key=='q' ? encodeURIComponent(params[key]): params[key]; + url += `&${key}=${value}` + }) + // console.log('final url', url); + return url; +} + +export const apiCall = async (params)=>{ + try{ + const response = await axios.get(formateUrl(params)); + const {data}= response; + return {success:true, data}; + }catch(err){ + console.log(err.message); + return {success : false, msg:err.message}; + } +} \ No newline at end of file diff --git a/app.json b/app.json index a430b20..d2ab368 100644 --- a/app.json +++ b/app.json @@ -13,13 +13,15 @@ "backgroundColor": "#ffffff" }, "ios": { - "supportsTablet": true + "supportsTablet": true }, "android": { "adaptiveIcon": { "foregroundImage": "./assets/images/adaptive-icon.png", "backgroundColor": "#ffffff" - } + }, + "bundleIdentifier": "com.ABHIJEET.wallpaper-app" + }, "web": { "bundler": "metro", diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx deleted file mode 100644 index 30914fb..0000000 --- a/app/(tabs)/_layout.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import FontAwesome from '@expo/vector-icons/FontAwesome'; -import { Link, Tabs } from 'expo-router'; -import { Pressable } from 'react-native'; - -import Colors from '@/constants/Colors'; -import { useColorScheme } from '@/components/useColorScheme'; -import { useClientOnlyValue } from '@/components/useClientOnlyValue'; - -// You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/ -function TabBarIcon(props: { - name: React.ComponentProps['name']; - color: string; -}) { - return ; -} - -export default function TabLayout() { - const colorScheme = useColorScheme(); - - return ( - - , - headerRight: () => ( - - - {({ pressed }) => ( - - )} - - - ), - }} - /> - , - }} - /> - - ); -} diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx deleted file mode 100644 index 6cbee6d..0000000 --- a/app/(tabs)/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { StyleSheet } from 'react-native'; - -import EditScreenInfo from '@/components/EditScreenInfo'; -import { Text, View } from '@/components/Themed'; - -export default function TabOneScreen() { - return ( - - Tab One - - - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - }, - title: { - fontSize: 20, - fontWeight: 'bold', - }, - separator: { - marginVertical: 30, - height: 1, - width: '80%', - }, -}); diff --git a/app/(tabs)/two.tsx b/app/(tabs)/two.tsx deleted file mode 100644 index f2ea47e..0000000 --- a/app/(tabs)/two.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { StyleSheet } from 'react-native'; - -import EditScreenInfo from '@/components/EditScreenInfo'; -import { Text, View } from '@/components/Themed'; - -export default function TabTwoScreen() { - return ( - - Tab Two - - - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - }, - title: { - fontSize: 20, - fontWeight: 'bold', - }, - separator: { - marginVertical: 30, - height: 1, - width: '80%', - }, -}); diff --git a/app/+html.tsx b/app/+html.tsx deleted file mode 100644 index cb31090..0000000 --- a/app/+html.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { ScrollViewStyleReset } from 'expo-router/html'; - -// This file is web-only and used to configure the root HTML for every -// web page during static rendering. -// The contents of this function only run in Node.js environments and -// do not have access to the DOM or browser APIs. -export default function Root({ children }: { children: React.ReactNode }) { - return ( - - - - - - - {/* - Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. - However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. - */} - - - {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */} -