From 2eea2d11e8a20649afaff524668e650bcacc5747 Mon Sep 17 00:00:00 2001 From: Shawn Lauzon Date: Sun, 14 Apr 2024 23:20:15 -0500 Subject: [PATCH] Run prettier on all source files --- .github/workflows/deploy-ios-prod.yml | 89 +- .prettierignore | 3 + .vscode/settings.json | 4 +- __tests__/App.test.tsx | 12 +- babel.config.js | 34 +- index.js | 6 +- jest.config.js | 2 +- metro.config.js | 2 +- react-native.config.js | 2 +- src/app-hooks/use-app-theme.tsx | 6 +- .../use-internet-connection-handle.tsx | 12 +- src/app-hooks/use-logout.tsx | 42 +- src/app-hooks/use-strings-and-labels.tsx | 2 +- src/app-hooks/use-token.tsx | 16 +- src/app.tsx | 44 +- src/assets/constants/index.ts | 29 +- src/assets/images/index.ts | 156 +-- src/assets/strings/strings-and-labels.ts | 263 ++--- src/components/Calender/calenderComponent.tsx | 20 +- src/components/app-update/index.tsx | 46 +- src/components/app-update/style.ts | 14 +- src/components/button-component/index.tsx | 17 +- src/components/button-component/style.ts | 12 +- src/components/date-range-picker/index.tsx | 33 +- src/components/event-list/index.tsx | 57 +- src/components/event-list/style.ts | 41 +- src/components/flatlist-component/index.tsx | 24 +- src/components/flatlist-component/style.ts | 16 +- src/components/generic-webview/index.tsx | 50 +- src/components/generic-webview/style.ts | 14 +- src/components/googlePlaceSearch.tsx | 12 +- src/components/header/index.tsx | 173 +-- src/components/header/style.ts | 79 +- src/components/image-component/index.tsx | 16 +- src/components/input-error/index.tsx | 20 +- src/components/input-error/style.ts | 10 +- src/components/input/index.tsx | 23 +- src/components/input/style.ts | 6 +- src/components/loader/index.tsx | 17 +- src/components/loader/style.ts | 22 +- src/components/modal-component/index.tsx | 19 +- src/components/modal-component/style.ts | 14 +- src/components/pill/index.tsx | 30 +- src/components/pill/style.ts | 16 +- src/components/safe-area-view/index.tsx | 12 +- src/components/safe-area-view/style.ts | 8 +- src/components/sized-box/index.tsx | 8 +- src/components/subcription/index.tsx | 19 +- src/components/subcription/style.ts | 15 +- src/components/tab-component/index.tsx | 19 +- src/components/tab-component/style.ts | 10 +- .../app-navigation/bottom-navigator.tsx | 89 +- src/config/app-navigation/constant.tsx | 56 +- src/config/app-navigation/event-route.tsx | 68 +- src/config/app-navigation/home-route.tsx | 70 +- src/config/app-navigation/index.tsx | 27 +- src/config/app-navigation/map-route.tsx | 52 +- .../navigator-option-component.tsx | 14 +- src/config/app-navigation/profile-route.tsx | 51 +- src/config/app-navigation/root-navigation.tsx | 7 +- src/config/app-navigation/route.tsx | 37 +- src/config/app-navigation/style.ts | 20 +- src/config/env/env.dev.json | 16 +- src/config/env/env.json | 17 +- src/config/env/env.prod.json | 17 +- src/index.ts | 2 +- src/network/api/index.tsx | 31 +- src/network/api/services/home-service.tsx | 20 +- src/network/api/services/payment-service.tsx | 32 +- src/network/api/services/user-service.tsx | 56 +- src/network/constant.ts | 91 +- .../home-service-hooks/use-checked-in-user.ts | 4 +- .../home-service-hooks/use-create-event.ts | 4 +- .../home-service-hooks/use-create-ticket.ts | 4 +- .../home-service-hooks/use-edit-ticket.ts | 4 +- .../home-service-hooks/use-event-details.ts | 40 +- .../home-service-hooks/use-event-lists.ts | 38 +- .../home-service-hooks/use-package-plans.ts | 16 +- .../use-packageDetail-plans.ts | 22 +- .../home-service-hooks/use-purchase-ticket.ts | 4 +- .../use-subscription-plans.ts | 8 +- .../use-ticket-holder-checkin-list.ts | 12 +- .../home-service-hooks/use-update-event.ts | 4 +- .../use-create-payout-intent.ts | 4 +- .../use-create-stripe-customer.ts | 4 +- .../use-create-subscription.ts | 4 +- .../user-service-hooks/use-app-config.ts | 8 +- .../user-service-hooks/use-edit-profile.ts | 4 +- .../hooks/user-service-hooks/use-login.ts | 4 +- .../use-save-customer-id.tsx | 4 +- .../user-service-hooks/use-user-profile.ts | 16 +- .../internet-connection-handle-reducer.tsx | 12 +- src/network/reducers/logout-reducer.tsx | 6 +- src/network/reducers/root-reducer.tsx | 18 +- src/network/reducers/store.ts | 8 +- src/network/reducers/user-profile-reducer.tsx | 15 +- src/network/utils/get-api-response.tsx | 4 +- src/network/utils/get-method.tsx | 10 +- src/screens/admin-tools/add-ticket-modal.tsx | 10 +- .../admin-tools/addPayoutExpense-modal.tsx | 62 +- .../admin-tools/editPayoutExpense-modal.tsx | 1 - .../admin-tools/getAdmintoolsDropdown.tsx | 160 +-- src/screens/admin-tools/index.tsx | 52 +- src/screens/admin-tools/style.ts | 419 ++++---- src/screens/chat/index.tsx | 72 +- src/screens/chat/style.ts | 523 +++++---- src/screens/check-in/check-in-list.tsx | 11 +- src/screens/check-in/index.tsx | 70 +- src/screens/check-in/style.ts | 78 +- src/screens/createEditPost/gratisEdit.tsx | 532 +++++----- src/screens/createEditPost/offerEdit.tsx | 17 +- src/screens/createEditPost/requestEdit.tsx | 700 +++++++------ src/screens/createEditPost/style.ts | 607 ++++++----- src/screens/createPost/gratis.tsx | 465 ++++---- src/screens/createPost/index.tsx | 209 ++-- src/screens/createPost/offer.tsx | 567 +++++----- src/screens/createPost/request.tsx | 631 ++++++----- src/screens/createPost/style.ts | 607 ++++++----- src/screens/event-detail/index.tsx | 5 +- src/screens/event-detail/style.ts | 200 ++-- .../event-detail/ticket-checkout-modal.tsx | 989 +++++++++--------- src/screens/event/add-component-modal.tsx | 10 +- src/screens/event/index.tsx | 219 ++-- src/screens/event/style.ts | 191 ++-- src/screens/gratitude/index.tsx | 39 +- src/screens/gratitude/style.ts | 452 ++++---- src/screens/home/commetList/index.tsx | 22 +- src/screens/home/index.tsx | 14 +- src/screens/home/style.ts | 765 +++++++------- src/screens/login/index.tsx | 6 +- src/screens/login/style.ts | 132 ++- src/screens/payment-screen/index.tsx | 37 +- src/screens/payment-screen/style.ts | 8 +- src/screens/profile/about.tsx | 31 +- src/screens/profile/index.tsx | 10 +- .../profile/membership-checkout-modal.tsx | 373 +++---- src/screens/profile/my-events.tsx | 25 +- src/screens/profile/style.ts | 508 +++++---- src/screens/recentProfile/about.tsx | 153 ++- src/screens/recentProfile/index.tsx | 128 +-- src/screens/recentProfile/my-events.tsx | 48 +- src/screens/recentProfile/style.ts | 333 +++--- src/screens/signUp/index.tsx | 2 - src/theme/colors.ts | 72 +- src/theme/device/device.js | 6 +- src/theme/device/normalize.tsx | 10 +- src/theme/fonts.ts | 20 +- src/theme/index.ts | 10 +- src/theme/theme.d.ts | 33 +- src/utils/common.ts | 2 +- src/utils/internet-connection-handle.tsx | 12 +- src/utils/platform-padding.tsx | 8 +- src/utils/stripe.ts | 5 +- tsconfig.json | 4 +- 154 files changed, 6832 insertions(+), 6513 deletions(-) create mode 100644 .prettierignore diff --git a/.github/workflows/deploy-ios-prod.yml b/.github/workflows/deploy-ios-prod.yml index 966c5a07f..1bab0250b 100644 --- a/.github/workflows/deploy-ios-prod.yml +++ b/.github/workflows/deploy-ios-prod.yml @@ -28,22 +28,22 @@ env: DISTRIBUTION_PROFILE_STAGING: ${{ toJSON(secrets.APPLE_AD-HOC_PROFILE) }} KEY_PWD: ${{ toJSON(secrets.KEYCHAIN_PWD) }} - jobs: + jobs: build: runs-on: macos-latest - + steps: - name: Checkout uses: actions/checkout@v2 - + - name: Set up Node.js 21.5.0 uses: actions/setup-node@v1 with: node-version: 21.5.0 - + - name: Install dependencies run: npm install - + - name: Install pod dependencies run: | cd ios && pod install @@ -52,13 +52,13 @@ env: - name: Select Xcode run: sudo xcode-select -switch /Applications/Xcode_15.3.app - + - name: Xcode Version run: /usr/bin/xcodebuild -version - + - name: Create build folder run: mkdir -p build && mkdir -p dev && mkdir -p prod - + - name: Build Archive run: | xcodebuild -workspace $WORKPLACE -scheme $SCHEME -configuration $CONFIGURATION \ @@ -73,7 +73,7 @@ env: - name: Export PROD run: | xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH_PROD . -exportOptionsPlist $PLIST_PATH_PROD \ - + - name: Upload Artifacts uses: actions/upload-artifact@v3 with: @@ -87,7 +87,7 @@ env: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db rm ~/Library/MobileDevice/Provisioning\ Profiles/dist_pp.mobileprovision rm ~/Library/MobileDevice/Provisioning\ Profiles/dist_pp_adc.mobileprovision - + deploy: needs: [build] if: success() @@ -95,39 +95,38 @@ env: runs-on: ubuntu-latest steps: + - uses: actions/checkout@master + + - uses: actions/actions/download-artifact@v3 + with: + name: ${{ env.ARTIFACT_NAME }} + + - name: set up JDK 17.0.10 + uses: actions/setup-java@v1 + with: + java-version: 17.0.10 + + - name: Upload to App Center STAGING + uses: wzieba/AppCenter-Github-Action@v1 + with: + appName: ${{ env.APP_NAME_STAGING }} + token: ${{ env.APP_CENTER_TOKEN_STAGING }} + group: ${{ env.TESTING_GROUP_STAGING }} + file: ${{ env.UPLOAD_FILE_STAGING }} + notifyTesters: true + debug: false + + - name: Upload to App Center PROD + uses: wzieba/AppCenter-Github-Action@v1 + with: + appName: ${{ env.APP_NAME_PROD }} + token: ${{ env.APP_CENTER_TOKEN_PROD }} + group: ${{ env.TESTING_GROUP_PROD }} + file: ${{ env.UPLOAD_FILE_PROD }} + notifyTesters: false + debug: false - - uses: actions/checkout@master - - - uses: actions/actions/download-artifact@v3 - with: - name: ${{ env.ARTIFACT_NAME }} - - - name: set up JDK 17.0.10 - uses: actions/setup-java@v1 - with: - java-version: 17.0.10 - - - name: Upload to App Center STAGING - uses: wzieba/AppCenter-Github-Action@v1 - with: - appName: ${{ env.APP_NAME_STAGING }} - token: ${{ env.APP_CENTER_TOKEN_STAGING }} - group: ${{ env.TESTING_GROUP_STAGING }} - file: ${{ env.UPLOAD_FILE_STAGING }} - notifyTesters: true - debug: false - - - name: Upload to App Center PROD - uses: wzieba/AppCenter-Github-Action@v1 - with: - appName: ${{ env.APP_NAME_PROD }} - token: ${{ env.APP_CENTER_TOKEN_PROD }} - group: ${{ env.TESTING_GROUP_PROD }} - file: ${{ env.UPLOAD_FILE_PROD }} - notifyTesters: false - debug: false - - - name: Delete Artifact - uses: geekyeggo/delete-artifact@v1 - with: - name: ${{ env.ARTIFACT_NAME }} + - name: Delete Artifact + uses: geekyeggo/delete-artifact@v1 + with: + name: ${{ env.ARTIFACT_NAME }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..a0395de50 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +android +ios +node_modules \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b6641073..23830fb42 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "git.ignoreLimitWarning": true -} \ No newline at end of file + "git.ignoreLimitWarning": true +} diff --git a/__tests__/App.test.tsx b/__tests__/App.test.tsx index 8c28897e6..e00fc0f7d 100644 --- a/__tests__/App.test.tsx +++ b/__tests__/App.test.tsx @@ -2,16 +2,16 @@ * @format */ -import 'react-native'; -import React from 'react'; -import App from '../src/app'; +import "react-native"; +import React from "react"; +import App from "../src/app"; // Note: import explicitly to use the types shiped with jest. -import {it} from '@jest/globals'; +import { it } from "@jest/globals"; // Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; +import renderer from "react-test-renderer"; -it('renders correctly', () => { +it("renders correctly", () => { renderer.create(); }); diff --git a/babel.config.js b/babel.config.js index c3c2c623a..b91b1526b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,27 +1,27 @@ module.exports = { - presets: ['module:metro-react-native-babel-preset'], + presets: ["module:metro-react-native-babel-preset"], plugins: [ [ - require.resolve('babel-plugin-module-resolver'), + require.resolve("babel-plugin-module-resolver"), { - cwd: 'babelrc', - extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js'], + cwd: "babelrc", + extensions: [".ts", ".tsx", ".js", ".ios.js", ".android.js"], alias: { - '@assets': './src/assets', - '@theme': './src/theme', - '@constants': './src/assets/constants', - '@images': './src/assets/images', - '@components': './src/components', - '@screens': './src/screens', - '@config': './src/config', - '@utils': './src/utils', - '@network': './src/network', - '@app-hooks': './src/app-hooks', - '@store': './src/store', + "@assets": "./src/assets", + "@theme": "./src/theme", + "@constants": "./src/assets/constants", + "@images": "./src/assets/images", + "@components": "./src/components", + "@screens": "./src/screens", + "@config": "./src/config", + "@utils": "./src/utils", + "@network": "./src/network", + "@app-hooks": "./src/app-hooks", + "@store": "./src/store", }, }, ], - 'jest-hoist', - 'react-native-reanimated/plugin', + "jest-hoist", + "react-native-reanimated/plugin", ], }; diff --git a/index.js b/index.js index 4e8a28c94..e5a8ae682 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,8 @@ * @format */ -import {AppRegistry} from 'react-native'; -import {App} from './src/app'; -import {name as appName} from './app.json'; +import { AppRegistry } from "react-native"; +import { App } from "./src/app"; +import { name as appName } from "./app.json"; AppRegistry.registerComponent(appName, () => App); diff --git a/jest.config.js b/jest.config.js index 8eb675e9b..edf194615 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - preset: 'react-native', + preset: "react-native", }; diff --git a/metro.config.js b/metro.config.js index ad8f87b6d..892433a83 100644 --- a/metro.config.js +++ b/metro.config.js @@ -1,4 +1,4 @@ -const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); +const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config"); /** * Metro configuration diff --git a/react-native.config.js b/react-native.config.js index b4a4e9f02..722d3db23 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -3,5 +3,5 @@ module.exports = { ios: {}, android: {}, }, - assets: ['./src/assets/fonts/'], + assets: ["./src/assets/fonts/"], }; diff --git a/src/app-hooks/use-app-theme.tsx b/src/app-hooks/use-app-theme.tsx index 20e0689b8..3a872e2c8 100644 --- a/src/app-hooks/use-app-theme.tsx +++ b/src/app-hooks/use-app-theme.tsx @@ -1,9 +1,9 @@ -import {getTheme} from '@theme/index'; +import { getTheme } from "@theme/index"; -type ThemeProps = 'light' | 'dark'; +type ThemeProps = "light" | "dark"; export const useAppTheme = () => { - const themeType: ThemeProps = 'light'; + const themeType: ThemeProps = "light"; return { themeType, changeAppTheme: (type: ThemeProps) => type, diff --git a/src/app-hooks/use-internet-connection-handle.tsx b/src/app-hooks/use-internet-connection-handle.tsx index 2fd03df2c..80769edb2 100644 --- a/src/app-hooks/use-internet-connection-handle.tsx +++ b/src/app-hooks/use-internet-connection-handle.tsx @@ -1,13 +1,13 @@ import { checkConnectivity, InternetConnectionState, -} from '@network/reducers/internet-connection-handle-reducer'; -import {StoreType} from '@network/reducers/store'; -import {useDispatch, useSelector} from 'react-redux'; +} from "@network/reducers/internet-connection-handle-reducer"; +import { StoreType } from "@network/reducers/store"; +import { useDispatch, useSelector } from "react-redux"; export const useInternetConnectionHandle = () => { - const {isConnected} = useSelector( - state => state.internetConnectionHandleReducer, + const { isConnected } = useSelector( + (state) => state.internetConnectionHandleReducer ); const dispatch = useDispatch(); @@ -15,5 +15,5 @@ export const useInternetConnectionHandle = () => { dispatch(checkConnectivity(payload)); }; - return {isConnected, checkConnectivity: updateConnectivityState}; + return { isConnected, checkConnectivity: updateConnectivityState }; }; diff --git a/src/app-hooks/use-logout.tsx b/src/app-hooks/use-logout.tsx index 3eb6e8335..27f6423c0 100644 --- a/src/app-hooks/use-logout.tsx +++ b/src/app-hooks/use-logout.tsx @@ -1,20 +1,20 @@ -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {animationDuration} from '@assets/constants'; -import {getNavigator} from '@config/app-navigation/root-navigation'; -import {API} from '@network/api'; -import {persistKeys} from '@network/constant'; -import {clearReducer} from '@network/reducers/logout-reducer'; -import {store} from '@network/reducers/store'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import {NavigationContainerRef} from '@react-navigation/native'; -import axios from 'axios'; -import {Alert} from 'react-native'; -import {queryClient} from '../app'; -import {navigations} from '@config/app-navigation/constant'; -import { GoogleSignin } from '@react-native-google-signin/google-signin'; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { animationDuration } from "@assets/constants"; +import { getNavigator } from "@config/app-navigation/root-navigation"; +import { API } from "@network/api"; +import { persistKeys } from "@network/constant"; +import { clearReducer } from "@network/reducers/logout-reducer"; +import { store } from "@network/reducers/store"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { NavigationContainerRef } from "@react-navigation/native"; +import axios from "axios"; +import { Alert } from "react-native"; +import { queryClient } from "../app"; +import { navigations } from "@config/app-navigation/constant"; +import { GoogleSignin } from "@react-native-google-signin/google-signin"; export const logoutUser = async (navigation: NavigationContainerRef) => { - navigation.reset({index: 0, routes: [{name: navigations.LOGIN}]}); + navigation.reset({ index: 0, routes: [{ name: navigations.LOGIN }] }); store.dispatch(clearReducer()); await AsyncStorage.multiRemove([persistKeys.token, persistKeys.fcmToken]); @@ -22,20 +22,20 @@ export const logoutUser = async (navigation: NavigationContainerRef) => { queryClient.getQueryCache().clear(); }, animationDuration.D2000); - axios.defaults.headers.common.Authorization = ''; + axios.defaults.headers.common.Authorization = ""; API.initService(); }; export const useLogout = () => { - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const navigationRef = getNavigator(); - const onLogout = async () => { + const onLogout = async () => { Alert.alert( strings.logout, strings.areYouLogout, [ - {text: strings.no, onPress: () => null, style: 'cancel'}, + { text: strings.no, onPress: () => null, style: "cancel" }, { text: strings.yes, onPress: () => { @@ -43,7 +43,7 @@ export const useLogout = () => { }, }, ], - {cancelable: false}, + { cancelable: false } ); try { await GoogleSignin.revokeAccess(); @@ -54,5 +54,5 @@ export const useLogout = () => { } }; - return {onLogout}; + return { onLogout }; }; diff --git a/src/app-hooks/use-strings-and-labels.tsx b/src/app-hooks/use-strings-and-labels.tsx index 925651548..4f9e0c06a 100644 --- a/src/app-hooks/use-strings-and-labels.tsx +++ b/src/app-hooks/use-strings-and-labels.tsx @@ -1,4 +1,4 @@ -import * as strings from '@assets/strings/strings-and-labels'; +import * as strings from "@assets/strings/strings-and-labels"; export type StringsAndLabelsType = { [value in string]: string; diff --git a/src/app-hooks/use-token.tsx b/src/app-hooks/use-token.tsx index 523786ebe..e677ddad6 100644 --- a/src/app-hooks/use-token.tsx +++ b/src/app-hooks/use-token.tsx @@ -1,8 +1,8 @@ -import {API} from '@network/api'; -import {persistKeys} from '@network/constant'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import axios from 'axios'; -import {useEffect, useState} from 'react'; +import { API } from "@network/api"; +import { persistKeys } from "@network/constant"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import axios from "axios"; +import { useEffect, useState } from "react"; export const onSetToken = async (value: string) => { axios.defaults.headers.common.Authorization = `Bearer ${value}`; @@ -12,12 +12,12 @@ export const onSetToken = async (value: string) => { }; export const useToken = () => { - const [token, setToken] = useState(''); + const [token, setToken] = useState(""); const [loading, setLoading] = useState(true); useEffect(() => { const checkToken = async () => { - const tok = (await AsyncStorage.getItem(persistKeys.token)) ?? ''; + const tok = (await AsyncStorage.getItem(persistKeys.token)) ?? ""; setToken(tok); setLoading(false); }; @@ -25,5 +25,5 @@ export const useToken = () => { checkToken(); }, []); - return {token, loading, onSetToken}; + return { token, loading, onSetToken }; }; diff --git a/src/app.tsx b/src/app.tsx index 5c876a76d..0bbd9b36a 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,33 +1,33 @@ -import React, {useEffect} from 'react'; -import {queryConfig} from '@network/utils/query-config'; -import {QueryClient, QueryClientProvider} from '@tanstack/react-query'; -import {getTheme} from './theme'; -import {light} from '@assets/constants'; -import {Provider} from 'react-redux'; -import {StatusBar} from 'react-native'; -import {store} from '@network/reducers/store'; -import {InternetConnectionHandle} from '@utils/internet-connection-handle'; -import {AppNavigation} from '@config/app-navigation'; -import {SafeAreaProvider} from 'react-native-safe-area-context'; -import {initializeStripe} from '@utils/stripe'; -import {useToken} from '@app-hooks/use-token'; -import axios from 'axios'; -import {API} from '@network/api'; -import {StripeProvider} from '@stripe/stripe-react-native'; -import ActiveEnv from '@config/env/env.json'; +import React, { useEffect } from "react"; +import { queryConfig } from "@network/utils/query-config"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { getTheme } from "./theme"; +import { light } from "@assets/constants"; +import { Provider } from "react-redux"; +import { StatusBar } from "react-native"; +import { store } from "@network/reducers/store"; +import { InternetConnectionHandle } from "@utils/internet-connection-handle"; +import { AppNavigation } from "@config/app-navigation"; +import { SafeAreaProvider } from "react-native-safe-area-context"; +import { initializeStripe } from "@utils/stripe"; +import { useToken } from "@app-hooks/use-token"; +import axios from "axios"; +import { API } from "@network/api"; +import { StripeProvider } from "@stripe/stripe-react-native"; +import ActiveEnv from "@config/env/env.json"; export const queryClient = new QueryClient(queryConfig); const theme = getTheme(light); export const App = () => { - const {token} = useToken(); + const { token } = useToken(); useEffect(() => { initializeStripe(); }, []); useEffect(() => { - console.log('Hi'); + console.log("Hi"); if (token) { axios.defaults.headers.common.Authorization = `Bearer ${token}`; API.initService(); @@ -40,7 +40,11 @@ export const App = () => { - + diff --git a/src/assets/constants/index.ts b/src/assets/constants/index.ts index a8eeb1865..ebae23028 100644 --- a/src/assets/constants/index.ts +++ b/src/assets/constants/index.ts @@ -1,25 +1,24 @@ -import {Dimensions} from 'react-native'; +import { Dimensions } from "react-native"; -export const countryCode = '+91'; -export const stretch = 'stretch'; -export const cover = 'cover'; -export const contain = 'contain'; -export const screenHeight = Dimensions.get('window').height; -export const screenWidth = Dimensions.get('window').width; +export const countryCode = "+91"; +export const stretch = "stretch"; +export const cover = "cover"; +export const contain = "contain"; +export const screenHeight = Dimensions.get("window").height; +export const screenWidth = Dimensions.get("window").width; export const numericalRegexExp = /^\d+$/; -export const rupeeSymbol = '₹'; -export const light = 'light'; +export const rupeeSymbol = "₹"; +export const light = "light"; export const numericRegexWithDecimalEx = /^\d+(\.\d{1,2})?$/; export const emailRegexEx = /^([\w!#$%&'*+/=?^`{|}~-]+(?:\.[\w!#$%&'*+/=?^`{|}~-]+)*)@((?:[\dA-Za-z](?:[\dA-Za-z-]*[\dA-Za-z])?\.)+[\dA-Za-z](?:[\dA-Za-z-]*[\dA-Za-z])?)$/; export const bottomTabs = { - home: 'home', - calendar: 'calendar', - chat: 'chat', - gratitude: 'gratitude', - addButton: 'addButton', + home: "home", + calendar: "calendar", + chat: "chat", + gratitude: "gratitude", + addButton: "addButton", }; export const animationDuration = { D2000: 2000, }; - diff --git a/src/assets/images/index.ts b/src/assets/images/index.ts index 82db928a9..c5f998201 100644 --- a/src/assets/images/index.ts +++ b/src/assets/images/index.ts @@ -1,78 +1,78 @@ -export {default as headerBg} from './headerBg.png'; -export {default as headerTitle} from './headerTitle.png'; -export {default as loginLogo} from './loginLogo.png'; -export {default as google} from './google.png'; -export {default as error} from './error.png'; -export {default as inactiveRadio} from './inactiveRadio.png'; -export {default as activeRadio} from './activeRadio.png'; -export {default as buttonArrow} from './buttonArrow.png'; -export {default as hamburger} from './hamburger.png'; -export {default as notification} from './notification.png'; -export {default as chat} from './chat.png'; -export {default as gratitude} from './gratitude.png'; -export {default as pin} from './pin.png'; -export {default as calendarWhite} from './calendarWhite.png'; -export {default as addGreen} from './addGreen.png'; -export {default as calendar} from './calendar.png'; -export {default as dummy} from './dummy.png'; -export {default as home} from './home.png'; -export {default as event} from './event.png'; -export {default as arrowDown} from './arrowDown.png'; -export {default as arrowLeft} from './arrowLeft.png'; -export {default as calendarTime} from './calendarTime.png'; -export {default as pinWhite} from './pinWhite.png'; -export {default as eventBlack} from './eventBlack.png'; -export {default as request} from './request.png'; -export {default as gratitudeBlack} from './gratitudeBlack.png'; -export {default as offer} from './offer.png'; -export {default as eventWhite} from './eventWhite.png'; -export {default as bucket} from './bucket.png'; -export {default as edit} from './edit.png'; -export {default as ticket} from './ticket.png'; -export {default as save} from './save.png'; -export {default as copy} from './copy.png'; -export {default as explorer} from './explorer.png'; -export {default as operator} from './operator.png'; -export {default as serviceProvider} from './serviceProvider.png'; -export {default as postImage} from './postImage.png'; -export {default as addCard} from './addCard.png'; -export {default as buttonArrowBlue} from './buttonArrowBlue.png'; -export {default as eventTwo} from './eventTwo.png'; -export {default as bell} from './bell.png'; -export {default as onelogo} from './onelogo.png'; -export {default as Search} from './Search.png'; -export {default as downImg} from './downImg.png'; -export {default as closeCard} from './closeCard.png'; -export {default as minus} from './minus.png'; -export {default as plus} from './plus.png'; -export {default as mapEvent} from './mapEvent.png'; -export {default as mapGifting} from './mapGifting.png'; -export {default as mapService} from './mapService.png'; -export {default as Vector} from './Vector.png'; -export {default as postCalender} from './postCalender.png'; -export {default as painting} from './painting.png'; -export {default as moving} from './moving.png'; -export {default as greenOffer} from './greenOffer.png'; -export {default as comment} from './comment.png'; -export {default as blackOffer} from './blackOffer.png'; -export {default as Gratis} from './Gratis.png'; -export {default as buttonArrowGreen} from './buttonArrowGreen.png'; -export {default as logoblack} from './logoblack.png'; -export {default as money} from './money.png'; -export {default as send} from './send.png'; -export {default as close} from './close.png'; -export {default as apple} from './apple.png'; -export {default as greenImage} from './greenImage.png'; -export {default as selectPic} from './selectPic.png'; -export {default as requestGreen} from './requestGreen.png'; -export {default as gratisGreen} from './gratisGreen.png'; -export {default as notificationTwo} from './notificationTwo.png'; -export {default as sendPayoutImg} from './sendPayoutImg.png'; -export {default as redDeleteIcon} from './redDeleteIcon.png'; -export {default as saveIcon} from './saveIcon.png'; -export {default as edit2} from './edit2.png'; -export {default as payoutClose} from './payoutClose.png'; -export {default as blackPin} from './blackPin.png'; -export {default as redPin} from './redPin.png'; -export {default as confirmedTicket} from './confirmedTicket.png'; -export {default as startImg} from './startImg.png'; +export { default as headerBg } from "./headerBg.png"; +export { default as headerTitle } from "./headerTitle.png"; +export { default as loginLogo } from "./loginLogo.png"; +export { default as google } from "./google.png"; +export { default as error } from "./error.png"; +export { default as inactiveRadio } from "./inactiveRadio.png"; +export { default as activeRadio } from "./activeRadio.png"; +export { default as buttonArrow } from "./buttonArrow.png"; +export { default as hamburger } from "./hamburger.png"; +export { default as notification } from "./notification.png"; +export { default as chat } from "./chat.png"; +export { default as gratitude } from "./gratitude.png"; +export { default as pin } from "./pin.png"; +export { default as calendarWhite } from "./calendarWhite.png"; +export { default as addGreen } from "./addGreen.png"; +export { default as calendar } from "./calendar.png"; +export { default as dummy } from "./dummy.png"; +export { default as home } from "./home.png"; +export { default as event } from "./event.png"; +export { default as arrowDown } from "./arrowDown.png"; +export { default as arrowLeft } from "./arrowLeft.png"; +export { default as calendarTime } from "./calendarTime.png"; +export { default as pinWhite } from "./pinWhite.png"; +export { default as eventBlack } from "./eventBlack.png"; +export { default as request } from "./request.png"; +export { default as gratitudeBlack } from "./gratitudeBlack.png"; +export { default as offer } from "./offer.png"; +export { default as eventWhite } from "./eventWhite.png"; +export { default as bucket } from "./bucket.png"; +export { default as edit } from "./edit.png"; +export { default as ticket } from "./ticket.png"; +export { default as save } from "./save.png"; +export { default as copy } from "./copy.png"; +export { default as explorer } from "./explorer.png"; +export { default as operator } from "./operator.png"; +export { default as serviceProvider } from "./serviceProvider.png"; +export { default as postImage } from "./postImage.png"; +export { default as addCard } from "./addCard.png"; +export { default as buttonArrowBlue } from "./buttonArrowBlue.png"; +export { default as eventTwo } from "./eventTwo.png"; +export { default as bell } from "./bell.png"; +export { default as onelogo } from "./onelogo.png"; +export { default as Search } from "./Search.png"; +export { default as downImg } from "./downImg.png"; +export { default as closeCard } from "./closeCard.png"; +export { default as minus } from "./minus.png"; +export { default as plus } from "./plus.png"; +export { default as mapEvent } from "./mapEvent.png"; +export { default as mapGifting } from "./mapGifting.png"; +export { default as mapService } from "./mapService.png"; +export { default as Vector } from "./Vector.png"; +export { default as postCalender } from "./postCalender.png"; +export { default as painting } from "./painting.png"; +export { default as moving } from "./moving.png"; +export { default as greenOffer } from "./greenOffer.png"; +export { default as comment } from "./comment.png"; +export { default as blackOffer } from "./blackOffer.png"; +export { default as Gratis } from "./Gratis.png"; +export { default as buttonArrowGreen } from "./buttonArrowGreen.png"; +export { default as logoblack } from "./logoblack.png"; +export { default as money } from "./money.png"; +export { default as send } from "./send.png"; +export { default as close } from "./close.png"; +export { default as apple } from "./apple.png"; +export { default as greenImage } from "./greenImage.png"; +export { default as selectPic } from "./selectPic.png"; +export { default as requestGreen } from "./requestGreen.png"; +export { default as gratisGreen } from "./gratisGreen.png"; +export { default as notificationTwo } from "./notificationTwo.png"; +export { default as sendPayoutImg } from "./sendPayoutImg.png"; +export { default as redDeleteIcon } from "./redDeleteIcon.png"; +export { default as saveIcon } from "./saveIcon.png"; +export { default as edit2 } from "./edit2.png"; +export { default as payoutClose } from "./payoutClose.png"; +export { default as blackPin } from "./blackPin.png"; +export { default as redPin } from "./redPin.png"; +export { default as confirmedTicket } from "./confirmedTicket.png"; +export { default as startImg } from "./startImg.png"; diff --git a/src/assets/strings/strings-and-labels.ts b/src/assets/strings/strings-and-labels.ts index aa2b41071..da96f60fa 100644 --- a/src/assets/strings/strings-and-labels.ts +++ b/src/assets/strings/strings-and-labels.ts @@ -1,136 +1,143 @@ export const stringsAndLabels = { - mobileOrEmail: 'Email', - password: 'Password', - iAgree: 'Your data is safe with ONE|Local. By clicking the “sign up” button above, you agree to the ', - tnc: 'terms, policy, & EULA', - login: 'Log in', - forgotPassword: 'Forgot password', - loginGoogle: 'Google Sign On', - loginApple: 'Apple Sign On', - aboutEvent: 'About Event', - buyTicket: 'Buy Ticket', - ticketCheckout: 'Ticket Checkout', - purchase: 'Purchase', - comingSoon: 'Coming Soon', - event: 'Event', - offer: 'Offer', - request: 'Request', - gratitude: 'Gratitude', - stripePayout: 'Add Stripe for Payout', - about: 'About', - myEvents: 'My Events', - activity: 'Activity', - membership: 'Membership', - player: 'Player', - eventProducer: 'Event Producer', - aboutMe: 'About Me', - skills: 'Skills', - addSkill: 'Add a skill', - membershipCheckout: 'Membership Checkout', - productMerchant: 'Product Merchant', - billedMonthly: 'Billed Monthly', - billedYearly: 'Billed Yearly', - adminTools: 'Admin Tools', - checkIns: 'Check Ins', - tickets: 'Tickets', - confirmationEmail: 'Confirmation Email', - attendees: 'Attendees', - enterTitle: 'Enter Title', - enterAddress: 'Enter Address', - enterVenue: 'Enter Venue', - enterEmail: 'Enter Email', - ticketEdit: 'Ticket Edit', - ticketAdd: 'Ticket Create', - ticketName: 'Ticket Name', - ticketTimeframe: 'Ticket Timeframe', - ticketPrice: 'Ticket Price', - save: 'Save', - selectStartDate: 'Select Start Date', - selectEndDate: 'Select End Date', - to: 'to', - ticketholderCheckin: 'Ticketholder Checkin', - checkIn: 'Check In', - checkedIn: 'Checked In', - logout: 'Log out', - areYouLogout: 'Are you sure you want to log out?', - yes: 'Yes', - no: 'No', - deletePost :'Are you sure you want to delete this post ?', - noDataText: 'No More Data Found', - noEventsFound: 'No Events Found', - noPostFound: 'No Post Found', - producer: 'Producer', - selectStartTime: 'Select Start Time', - selectEndTime: 'Select End Time', - pleaseEdit: 'Please edit something', + mobileOrEmail: "Email", + password: "Password", + iAgree: + "Your data is safe with ONE|Local. By clicking the “sign up” button above, you agree to the ", + tnc: "terms, policy, & EULA", + login: "Log in", + forgotPassword: "Forgot password", + loginGoogle: "Google Sign On", + loginApple: "Apple Sign On", + aboutEvent: "About Event", + buyTicket: "Buy Ticket", + ticketCheckout: "Ticket Checkout", + purchase: "Purchase", + comingSoon: "Coming Soon", + event: "Event", + offer: "Offer", + request: "Request", + gratitude: "Gratitude", + stripePayout: "Add Stripe for Payout", + about: "About", + myEvents: "My Events", + activity: "Activity", + membership: "Membership", + player: "Player", + eventProducer: "Event Producer", + aboutMe: "About Me", + skills: "Skills", + addSkill: "Add a skill", + membershipCheckout: "Membership Checkout", + productMerchant: "Product Merchant", + billedMonthly: "Billed Monthly", + billedYearly: "Billed Yearly", + adminTools: "Admin Tools", + checkIns: "Check Ins", + tickets: "Tickets", + confirmationEmail: "Confirmation Email", + attendees: "Attendees", + enterTitle: "Enter Title", + enterAddress: "Enter Address", + enterVenue: "Enter Venue", + enterEmail: "Enter Email", + ticketEdit: "Ticket Edit", + ticketAdd: "Ticket Create", + ticketName: "Ticket Name", + ticketTimeframe: "Ticket Timeframe", + ticketPrice: "Ticket Price", + save: "Save", + selectStartDate: "Select Start Date", + selectEndDate: "Select End Date", + to: "to", + ticketholderCheckin: "Ticketholder Checkin", + checkIn: "Check In", + checkedIn: "Checked In", + logout: "Log out", + areYouLogout: "Are you sure you want to log out?", + yes: "Yes", + no: "No", + deletePost: "Are you sure you want to delete this post ?", + noDataText: "No More Data Found", + noEventsFound: "No Events Found", + noPostFound: "No Post Found", + producer: "Producer", + selectStartTime: "Select Start Time", + selectEndTime: "Select End Time", + pleaseEdit: "Please edit something", updateAvailable: - 'App update is available. Please update the app from app store.', - updateApp: 'Update App', - noTicketsAvailable: 'No tickets available to purchase', - noCheckedInUserFound: 'No checked-in user found', - nocommentFound:'No Comment Data Found', - purchaseSubscription: 'Please purchase the subscription', - linkCopied: 'Link copied to clipboard', - noAttendees: 'No Attendees Found', - enterAboutEvent: 'Enter About Event', + "App update is available. Please update the app from app store.", + updateApp: "Update App", + noTicketsAvailable: "No tickets available to purchase", + noCheckedInUserFound: "No checked-in user found", + nocommentFound: "No Comment Data Found", + purchaseSubscription: "Please purchase the subscription", + linkCopied: "Link copied to clipboard", + noAttendees: "No Attendees Found", + enterAboutEvent: "Enter About Event", explorerLbl: "Explorer", orgOperator: "Org Operator", serviceProvider: "Service Provider", playerMembership: "Player Membership", - eventProvider:"Event Producer", - playerDesc: "By signing up as a Player, you get ONE|Pass, which grants you 10% discounts at participating local businesses. You also get to post offers and requests on the main feed.", - eventProDesc : "By signing up as an Event Producer you can create events, invite users, and sell tickets. You also get the perks of a Player membership to get discounts at local businesses, and post offers and requests on the main feed.", - serviceDesc : "By signing up as a Provider you can list and offer your skills as Services. You also get the perks of a Player membership to get discounts at local businesses, and post offers and requests on the main feed.", - orgOpDesc:"By signing up as an Operator you can create organizations, and engage with Players as a business. If you sign up as a ONE Pass business (offing players 10% off at your business), you can waive the monthly fee!. You also get the perks of a Player membership to post offers and requests on the main feed.", + eventProvider: "Event Producer", + playerDesc: + "By signing up as a Player, you get ONE|Pass, which grants you 10% discounts at participating local businesses. You also get to post offers and requests on the main feed.", + eventProDesc: + "By signing up as an Event Producer you can create events, invite users, and sell tickets. You also get the perks of a Player membership to get discounts at local businesses, and post offers and requests on the main feed.", + serviceDesc: + "By signing up as a Provider you can list and offer your skills as Services. You also get the perks of a Player membership to get discounts at local businesses, and post offers and requests on the main feed.", + orgOpDesc: + "By signing up as an Operator you can create organizations, and engage with Players as a business. If you sign up as a ONE Pass business (offing players 10% off at your business), you can waive the monthly fee!. You also get the perks of a Player membership to post offers and requests on the main feed.", signUp: "Sign Up!", - playerText:"You are currently signed up as a player!", - cancleSubscription:"cancel subscription", - membershipInfo : "By signing up as a Player, you get ONE|Pass, which grants you 10% discounts at participating local businesses. You also get to post offers and requests on the main feed.", - addCard : "+ Add Card", - addCardTwo : "ADD CARD", - cancle:"Cancel", - paymentinfo : "Payment Information", - exp:"Exp.", - addCardOne : "Add Card", - cardinfo:"Card Info", - dot:".", - slash:"/", - firstName:"First Name", - lastName:"Last Name", - email:"Email", - phoneNo:"Mobile Number", - confirmPass:"Confirm Password", - signUpTwo:"Sign Up", - updateQuestion : "Update Questions", - queAnsTitle:"Update your Profile Questions!", - quantity:"No of Quantity", - pricetax:"Price and Taxes", - totalAmount:"Total Amount to Pay ", - postOffer:"Post Offer", - deleteAccount:"Delete Account", - areYouDeleteAccount: 'Are you sure you want to Delete Account?', - blockUser:"Block User", - deletePostTitle:"Delete Post", - areYouBlockUser: 'If you Block this user you are not able to see any post from this user.', - hidePost:'Hide Content', - areyouHide:'Are you sure you want to hide this Post?', - reportUser:'Report User', - areyouReport:'Report this user Reason', - catchphrase:'Catchphrase', - nickname:'Nick Name', - birthday:'Birth Day', - state:'State', - city:'City', - profilepic:'Profile Picture', - bgImage:'Background Picture', - cancleEvent:'Cancle Event', - subTotal:'Subtotal', - serviceFee:'Service Fee', - salesTax:'Sales Tax', - total:'Total', - pay:'PAY', - billingAdd:'Billing address *', - platformFee: 'Platform Fee', - paymentFee: 'Payment Fee', - eventDes:'You need to sign up as an Event Producer to create Events.' + playerText: "You are currently signed up as a player!", + cancleSubscription: "cancel subscription", + membershipInfo: + "By signing up as a Player, you get ONE|Pass, which grants you 10% discounts at participating local businesses. You also get to post offers and requests on the main feed.", + addCard: "+ Add Card", + addCardTwo: "ADD CARD", + cancle: "Cancel", + paymentinfo: "Payment Information", + exp: "Exp.", + addCardOne: "Add Card", + cardinfo: "Card Info", + dot: ".", + slash: "/", + firstName: "First Name", + lastName: "Last Name", + email: "Email", + phoneNo: "Mobile Number", + confirmPass: "Confirm Password", + signUpTwo: "Sign Up", + updateQuestion: "Update Questions", + queAnsTitle: "Update your Profile Questions!", + quantity: "No of Quantity", + pricetax: "Price and Taxes", + totalAmount: "Total Amount to Pay ", + postOffer: "Post Offer", + deleteAccount: "Delete Account", + areYouDeleteAccount: "Are you sure you want to Delete Account?", + blockUser: "Block User", + deletePostTitle: "Delete Post", + areYouBlockUser: + "If you Block this user you are not able to see any post from this user.", + hidePost: "Hide Content", + areyouHide: "Are you sure you want to hide this Post?", + reportUser: "Report User", + areyouReport: "Report this user Reason", + catchphrase: "Catchphrase", + nickname: "Nick Name", + birthday: "Birth Day", + state: "State", + city: "City", + profilepic: "Profile Picture", + bgImage: "Background Picture", + cancleEvent: "Cancle Event", + subTotal: "Subtotal", + serviceFee: "Service Fee", + salesTax: "Sales Tax", + total: "Total", + pay: "PAY", + billingAdd: "Billing address *", + platformFee: "Platform Fee", + paymentFee: "Payment Fee", + eventDes: "You need to sign up as an Event Producer to create Events.", }; diff --git a/src/components/Calender/calenderComponent.tsx b/src/components/Calender/calenderComponent.tsx index d2ad7c5c8..8b27fca22 100644 --- a/src/components/Calender/calenderComponent.tsx +++ b/src/components/Calender/calenderComponent.tsx @@ -1,5 +1,5 @@ -import {forwardRef, useImperativeHandle, useState} from 'react'; -import {Calendar, LocaleConfig} from 'react-native-calendars'; +import { forwardRef, useImperativeHandle, useState } from "react"; +import { Calendar, LocaleConfig } from "react-native-calendars"; interface CalenderComponentProps {} @@ -10,18 +10,18 @@ export type CalenderRefProps = { export const CalenderComponent = ( props: CalenderComponentProps, - ref: React.Ref | undefined, + ref: React.Ref | undefined ) => { const {} = props || {}; - const [selected, setSelected] = useState(''); + const [selected, setSelected] = useState(""); const [startDate, setStartDate] = useState(new Date()); const [endDate, setEndDate] = useState(new Date()); const [showPicker, setShowPicker] = useState(false); - const [pickerType, setPickerType] = useState(''); + const [pickerType, setPickerType] = useState(""); useImperativeHandle(ref, () => ({ - onOpenModal(type: 'start' | 'end') { - if (type === 'start') { + onOpenModal(type: "start" | "end") { + if (type === "start") { showStartDatePicker(); return; } @@ -34,18 +34,18 @@ export const CalenderComponent = ( const showStartDatePicker = () => { setShowPicker(true); - setPickerType('start'); + setPickerType("start"); }; const showEndDatePicker = () => { setShowPicker(true); - setPickerType('end'); + setPickerType("end"); }; return ( { + onDayPress={(day) => { setSelected(day.dateString); }} markedDates={{ diff --git a/src/components/app-update/index.tsx b/src/components/app-update/index.tsx index ef27344ec..73b7280ef 100644 --- a/src/components/app-update/index.tsx +++ b/src/components/app-update/index.tsx @@ -1,28 +1,34 @@ -import React from 'react'; -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {Linking, Platform, Text, View} from 'react-native'; -import {createStyleSheet} from './style'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {ButtonComponent} from '@components/button-component'; +import React from "react"; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { Linking, Platform, Text, View } from "react-native"; +import { createStyleSheet } from "./style"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ButtonComponent } from "@components/button-component"; export const AppUpdate = () => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const onOpenAppStore = () => { - if(Platform.OS === 'ios'){ - const link = 'itms-apps://itunes.apple.com/app/id/1534246640'; - Linking.canOpenURL(link).then(supported => { - supported && Linking.openURL(link); - }, (err) => console.log(err)); - } - else{ - const link = 'https://play.google.com/store/apps/details?id=one.oneboulder.one'; - Linking.canOpenURL(link).then(supported => { - supported && Linking.openURL(link); - }, (err) => console.log(err)); - } + if (Platform.OS === "ios") { + const link = "itms-apps://itunes.apple.com/app/id/1534246640"; + Linking.canOpenURL(link).then( + (supported) => { + supported && Linking.openURL(link); + }, + (err) => console.log(err) + ); + } else { + const link = + "https://play.google.com/store/apps/details?id=one.oneboulder.one"; + Linking.canOpenURL(link).then( + (supported) => { + supported && Linking.openURL(link); + }, + (err) => console.log(err) + ); + } }; return ( diff --git a/src/components/app-update/style.ts b/src/components/app-update/style.ts index 4c6b3d140..5946bf179 100644 --- a/src/components/app-update/style.ts +++ b/src/components/app-update/style.ts @@ -1,26 +1,26 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ container: { backgroundColor: theme.colors.white, - position: 'absolute', + position: "absolute", left: 0, right: 0, top: 0, bottom: 0, flex: 1, - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, title: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font16, color: theme.colors.black, paddingHorizontal: normalScale(16), - textAlign: 'center', + textAlign: "center", marginBottom: verticalScale(40), }, }); diff --git a/src/components/button-component/index.tsx b/src/components/button-component/index.tsx index b0f8c204c..c29ed4c33 100644 --- a/src/components/button-component/index.tsx +++ b/src/components/button-component/index.tsx @@ -1,5 +1,5 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React from 'react'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React from "react"; import { StyleProp, Text, @@ -7,10 +7,10 @@ import { TouchableOpacityProps, View, ViewStyle, -} from 'react-native'; -import {createStyleSheet} from './style'; -import {ImageComponent} from '@components/image-component'; -import {buttonArrow} from '@assets/images'; +} from "react-native"; +import { createStyleSheet } from "./style"; +import { ImageComponent } from "@components/image-component"; +import { buttonArrow } from "@assets/images"; interface ButtonComponentProps extends TouchableOpacityProps { buttonStyle?: StyleProp; @@ -21,7 +21,7 @@ interface ButtonComponentProps extends TouchableOpacityProps { } export const ButtonComponent = (props: ButtonComponentProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { buttonStyle, @@ -37,7 +37,8 @@ export const ButtonComponent = (props: ButtonComponentProps) => { activeOpacity={0.8} style={[styles.container, buttonStyle, disabled && styles.disabled]} disabled={disabled} - {...remainingProps}> + {...remainingProps} + > {title} {hasIcon && } diff --git a/src/components/button-component/style.ts b/src/components/button-component/style.ts index 6b73d6e6b..ce421e172 100644 --- a/src/components/button-component/style.ts +++ b/src/components/button-component/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -16,9 +16,9 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), }, disabled: { diff --git a/src/components/date-range-picker/index.tsx b/src/components/date-range-picker/index.tsx index 4a4ceb75b..35bd27337 100644 --- a/src/components/date-range-picker/index.tsx +++ b/src/components/date-range-picker/index.tsx @@ -1,30 +1,30 @@ -import React, {forwardRef, useImperativeHandle, useState} from 'react'; -import {View} from 'react-native'; -import DateTimePicker from 'react-native-modal-datetime-picker'; +import React, { forwardRef, useImperativeHandle, useState } from "react"; +import { View } from "react-native"; +import DateTimePicker from "react-native-modal-datetime-picker"; export type DatePickerRefProps = { - onOpenModal: (type: 'start' | 'end') => void; + onOpenModal: (type: "start" | "end") => void; onCloseModal: () => void; }; interface DateRangePickerProps { selectStartDate?: (date: Date) => void; - selectEndDate?: (date: Date) => void; + selectEndDate?: (date: Date) => void; } const DateRangePickerComp = ( props: DateRangePickerProps, - ref: React.Ref | undefined, + ref: React.Ref | undefined ) => { - const {selectEndDate, selectStartDate} = props || {}; + const { selectEndDate, selectStartDate } = props || {}; const [startDate, setStartDate] = useState(new Date()); const [endDate, setEndDate] = useState(new Date()); const [showPicker, setShowPicker] = useState(false); - const [pickerType, setPickerType] = useState(''); + const [pickerType, setPickerType] = useState(""); useImperativeHandle(ref, () => ({ - onOpenModal(type: 'start' | 'end') { - if (type === 'start') { + onOpenModal(type: "start" | "end") { + if (type === "start") { showStartDatePicker(); return; } @@ -37,19 +37,18 @@ const DateRangePickerComp = ( const showStartDatePicker = () => { setShowPicker(true); - setPickerType('start'); + setPickerType("start"); }; const showEndDatePicker = () => { setShowPicker(true); - setPickerType('end'); + setPickerType("end"); }; const handlePickerChange = (selectedDate: Date) => { - const currentDate = selectedDate || new Date(); - - if (pickerType === 'start') { + + if (pickerType === "start") { setStartDate(currentDate); setEndDate(currentDate); selectStartDate?.(currentDate); @@ -67,11 +66,11 @@ const DateRangePickerComp = ( {showPicker && ( setShowPicker(false)} /> diff --git a/src/components/event-list/index.tsx b/src/components/event-list/index.tsx index 400d995d8..5d962ca4e 100644 --- a/src/components/event-list/index.tsx +++ b/src/components/event-list/index.tsx @@ -1,11 +1,11 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React from 'react'; -import {createStyleSheet} from './style'; -import {Text, TouchableOpacity, View} from 'react-native'; -import {ImageComponent} from '@components/image-component'; -import {activeRadio, dummy, event, pin} from '@assets/images'; -import {Result} from '@network/hooks/home-service-hooks/use-event-lists'; -import moment from 'moment'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React from "react"; +import { createStyleSheet } from "./style"; +import { Text, TouchableOpacity, View } from "react-native"; +import { ImageComponent } from "@components/image-component"; +import { activeRadio, dummy, event, pin } from "@assets/images"; +import { Result } from "@network/hooks/home-service-hooks/use-event-lists"; +import moment from "moment"; interface EventListProps { data: Result; @@ -14,17 +14,27 @@ interface EventListProps { } export const EventList = (props: EventListProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {data, onPress, disabled = false} = props || {}; - const {start_date, address, name, event_image,full_address,cancelled,start_date_label,start_time_label} = data || {}; + const { data, onPress, disabled = false } = props || {}; + const { + start_date, + address, + name, + event_image, + full_address, + cancelled, + start_date_label, + start_time_label, + } = data || {}; return ( + disabled={disabled} + > { isUrl={!!event_image} style={styles.dummy} /> - + - {start_date_label} - {' • '} - {start_time_label} - {name} + + {start_date_label} + {" • "} + {start_time_label} + + + {name} + - - + + - {address} + + {address} + {/* */} {/* {full_address} */} {cancelled ? CANCELED : <>} - ); diff --git a/src/components/event-list/style.ts b/src/components/event-list/style.ts index a17226402..bb7ae4385 100644 --- a/src/components/event-list/style.ts +++ b/src/components/event-list/style.ts @@ -1,6 +1,6 @@ -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { ThemeProps } from '@theme/theme'; -import { StyleSheet } from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -11,7 +11,7 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), backgroundColor: theme.colors.white, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), shadowColor: theme.colors.darkGrey, shadowOffset: { width: 1, height: 2 }, @@ -26,7 +26,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, flex: { flex: 1, - overflow:'hidden', + overflow: "hidden", }, dateText: { fontFamily: theme.fontType.light, @@ -40,7 +40,7 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, // marginBottom: verticalScale(7), maxWidth: normalScale(200), - flexShrink:1 + flexShrink: 1, }, event: { height: normalScale(32), @@ -48,21 +48,21 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: normalScale(12), }, row: { - flexDirection: 'row', + flexDirection: "row", flex: 1, }, pin: { height: normalScale(14), width: normalScale(14), marginRight: normalScale(8), - marginTop: normalScale(6) + marginTop: normalScale(6), }, location: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - flexShrink:1, - marginTop: normalScale(6) + flexShrink: 1, + marginTop: normalScale(6), }, fullAddress: { fontFamily: theme.fontType.light, @@ -71,16 +71,17 @@ export const createStyleSheet = (theme: ThemeProps) => { }, addressDot: { height: 6, - width: 6, marginVertical: 5, - marginHorizontal: 5 + width: 6, + marginVertical: 5, + marginHorizontal: 5, + }, + cancleText: { + position: "absolute", + right: 0, + top: 35, + fontFamily: theme.fontType.medium, + fontSize: theme.fontSize.font14, + color: theme.colors.redTwo, }, - cancleText:{ - position:'absolute', - right:0, - top:35, - fontFamily:theme.fontType.medium, - fontSize:theme.fontSize.font14, - color:theme.colors.redTwo - } }); }; diff --git a/src/components/flatlist-component/index.tsx b/src/components/flatlist-component/index.tsx index ecc3de376..55560228b 100644 --- a/src/components/flatlist-component/index.tsx +++ b/src/components/flatlist-component/index.tsx @@ -1,7 +1,7 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {Loader} from '@components/loader'; -import React, {useState} from 'react'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { Loader } from "@components/loader"; +import React, { useState } from "react"; import { FlatList, FlatListProps, @@ -9,11 +9,11 @@ import { Text, View, ViewStyle, -} from 'react-native'; +} from "react-native"; -import {createStyleSheet} from './style'; +import { createStyleSheet } from "./style"; -type ComponentType = 'flatList' | 'scrollView'; +type ComponentType = "flatList" | "scrollView"; export interface EmptyComponentData { title?: string; @@ -37,7 +37,7 @@ export interface ListProps extends FlatListProps { export function FlatListComponent(props: ListProps) { const { - componentType = 'flatList', + componentType = "flatList", keyExtractor = (item: ItemT, index: number) => index.toString(), dataLength = 10, onLoadMoreData, @@ -48,11 +48,11 @@ export function FlatListComponent(props: ListProps) { currentPage = 1, ...remainingProps } = props; - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings: stringsAndLabels} = useStringsAndLabels(); + const { strings: stringsAndLabels } = useStringsAndLabels(); const [paginationLoader, setPaginationLoader] = useState(false); - const {title} = emptyComponentData || {}; + const { title } = emptyComponentData || {}; const listFooterComponent = () => { const endReached = totalPages <= currentPage; @@ -78,7 +78,7 @@ export function FlatListComponent(props: ListProps) { ); - if (componentType === 'flatList') { + if (componentType === "flatList") { return ( StyleSheet.create({ @@ -8,15 +8,15 @@ export const createStyleSheet = (theme: ThemeProps) => fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, color: theme.colors.black, - alignSelf: 'center', + alignSelf: "center", paddingBottom: verticalScale(10), marginTop: verticalScale(10), }, emptyView: { flex: 1, - justifyContent: 'center', - alignItems: 'center', - alignSelf: 'center', + justifyContent: "center", + alignItems: "center", + alignSelf: "center", marginTop: verticalScale(160), }, title: { @@ -25,6 +25,6 @@ export const createStyleSheet = (theme: ThemeProps) => color: theme.colors.black, marginTop: verticalScale(24), marginBottom: verticalScale(12), - textAlign: 'center', + textAlign: "center", }, }); diff --git a/src/components/generic-webview/index.tsx b/src/components/generic-webview/index.tsx index aacec810a..aee53d7c7 100644 --- a/src/components/generic-webview/index.tsx +++ b/src/components/generic-webview/index.tsx @@ -1,14 +1,17 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {Header} from '@components/header'; -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; -import {getTheme} from '@theme/index'; -import React, {useState} from 'react'; -import {ActivityIndicator, View} from 'react-native'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { Header } from "@components/header"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import { getTheme } from "@theme/index"; +import React, { useState } from "react"; +import { ActivityIndicator, View } from "react-native"; import WebView, { WebViewMessageEvent, WebViewNavigation, -} from 'react-native-webview'; -import {createStyleSheet} from './style'; +} from "react-native-webview"; +import { createStyleSheet } from "./style"; interface Params { params: { @@ -30,20 +33,25 @@ export interface RefObj { } export const GenericWebView = (props: GenericWebViewProps) => { - const {themeType} = useAppTheme(); + const { themeType } = useAppTheme(); const theme = getTheme(themeType); const styles = createStyleSheet(theme); - const {navigation, route} = props; + const { navigation, route } = props; const [loading, setloading] = useState(false); - const {header = '', onUrlChange, onPressBack, uri = ''} = route?.params ?? {}; - const [pageTitle, setPageTitle] = useState(header || ''); + const { + header = "", + onUrlChange, + onPressBack, + uri = "", + } = route?.params ?? {}; + const [pageTitle, setPageTitle] = useState(header || ""); const handleMessage = (messageEvent: WebViewMessageEvent) => { - const {data} = messageEvent.nativeEvent; + const { data } = messageEvent.nativeEvent; if (data) { setPageTitle(data); } - if (data === 'closed') { + if (data === "closed") { navigation?.goBack(); } }; @@ -54,7 +62,7 @@ export const GenericWebView = (props: GenericWebViewProps) => { }; const urlChange = (newNavState: WebViewNavigation) => { - const {url} = newNavState; + const { url } = newNavState; onUrlChange?.(url); }; @@ -62,19 +70,19 @@ export const GenericWebView = (props: GenericWebViewProps) => {
{ - const {nativeEvent} = syntheticEvent; + onLoadStart={(syntheticEvent) => { + const { nativeEvent } = syntheticEvent; setloading(nativeEvent.loading); }} - onLoadEnd={syntheticEvent => { - const {nativeEvent} = syntheticEvent; + onLoadEnd={(syntheticEvent) => { + const { nativeEvent } = syntheticEvent; setloading(nativeEvent.loading); }} onMessage={handleMessage} startInLoadingState={loading} - renderLoading={() => } + renderLoading={() => } onNavigationStateChange={urlChange} /> diff --git a/src/components/generic-webview/style.ts b/src/components/generic-webview/style.ts index 3f1cf87b9..07cccb0db 100644 --- a/src/components/generic-webview/style.ts +++ b/src/components/generic-webview/style.ts @@ -1,11 +1,11 @@ -import {screenWidth} from '@assets/constants'; +import { screenWidth } from "@assets/constants"; import { lineHeightScale, normalScale, verticalScale, -} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +} from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => StyleSheet.create({ @@ -26,14 +26,14 @@ export const createStyleSheet = (theme: ThemeProps) => }, webView: { flex: 1, - height: '100%', - width: '100%', + height: "100%", + width: "100%", }, text: { // fontFamily: theme.fontType.albertSansSemiBold, fontSize: theme.fontSize.font20, lineHeight: lineHeightScale(20), // color: theme.colors.errorColor, - alignSelf: 'center', + alignSelf: "center", }, }); diff --git a/src/components/googlePlaceSearch.tsx b/src/components/googlePlaceSearch.tsx index 524234915..1c7373ba4 100644 --- a/src/components/googlePlaceSearch.tsx +++ b/src/components/googlePlaceSearch.tsx @@ -1,21 +1,21 @@ -import React from 'react'; -import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete'; -import ActiveEnv from '@config/env/env.dev.json'; +import React from "react"; +import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; +import ActiveEnv from "@config/env/env.dev.json"; const GooglePlacesInput = () => { return ( { // 'details' is provided when fetchDetails = true console.log(data, details); }} query={{ key: ActiveEnv.GOOGLE_KEY, - language: 'en', + language: "en", }} /> ); }; -export default GooglePlacesInput; \ No newline at end of file +export default GooglePlacesInput; diff --git a/src/components/header/index.tsx b/src/components/header/index.tsx index 6e52732d5..6d57be00c 100644 --- a/src/components/header/index.tsx +++ b/src/components/header/index.tsx @@ -1,19 +1,37 @@ -import { Search, activeRadio, arrowLeft, bell, hamburger, headerBg, headerTitle, loginLogo, onelogo, pin, postImage } from '@assets/images'; -import React, { useState } from 'react'; -import { ImageBackground, Text, TextInput, TouchableOpacity, View } from 'react-native'; -import { createStyleSheet } from './style'; -import { useAppTheme } from '@app-hooks/use-app-theme'; -import { ImageComponent } from '@components/image-component'; -import { launchCamera } from 'react-native-image-picker'; +import { + Search, + activeRadio, + arrowLeft, + bell, + hamburger, + headerBg, + headerTitle, + loginLogo, + onelogo, + pin, + postImage, +} from "@assets/images"; +import React, { useState } from "react"; +import { + ImageBackground, + Text, + TextInput, + TouchableOpacity, + View, +} from "react-native"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { ImageComponent } from "@components/image-component"; +import { launchCamera } from "react-native-image-picker"; import { UserProfileState, onSetCoverImage, -} from '@network/reducers/user-profile-reducer'; -import { useDispatch, useSelector } from 'react-redux'; -import { StoreType } from '@network/reducers/store'; -import { useStringsAndLabels } from '@app-hooks/use-strings-and-labels'; -import { Searchbar } from 'react-native-paper'; -import { height } from '@theme/device/device'; +} from "@network/reducers/user-profile-reducer"; +import { useDispatch, useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { Searchbar } from "react-native-paper"; +import { height } from "@theme/device/device"; interface HeaderProps { title?: string; @@ -23,9 +41,9 @@ interface HeaderProps { children?: React.ReactNode; onBackPress?: () => void; fromProfile?: boolean; - fromLogin?:boolean; - fromEvent?:boolean; - fromEventDetail?:boolean; + fromLogin?: boolean; + fromEvent?: boolean; + fromEventDetail?: boolean; } export const Header = (props: HeaderProps) => { @@ -39,18 +57,18 @@ export const Header = (props: HeaderProps) => { fromProfile = false, fromLogin = false, fromEvent = false, - fromEventDetail = false + fromEventDetail = false, } = props || {}; const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { user } = useSelector( - state => state.userProfileReducer, + (state) => state.userProfileReducer ) as { user: { coverImage: string } }; const dispatch = useDispatch(); const { strings } = useStringsAndLabels(); const state = { - search: '', + search: "", }; const renderBackButton = () => { @@ -61,11 +79,10 @@ export const Header = (props: HeaderProps) => { ); }; - const [searchQuery, setSearchQuery] = useState(''); + const [searchQuery, setSearchQuery] = useState(""); // const onChangeSearch = query => setSearchQuery(query); - // { // // + return !fromProfile && !fromLogin && !fromEvent && !fromEventDetail ? ( + + + {leftIcon || (hasBackButton && renderBackButton())} + + + + { + setSearchQuery(value); + }} + > + - return ( + + + NE + - !fromProfile && !fromLogin && !fromEvent && !fromEventDetail ? - - {leftIcon || (hasBackButton && renderBackButton())} - - - { - setSearchQuery(value) - }}> + {rightIcon ? ( + + + {rightIcon} + - - - - NE + ) : ( + + - - {rightIcon ? {rightIcon} : } - - {/* {children ? : } */} - - {children} - + )} + + {/* {children ? : } */} + + {children} + + + + ) : ( + + + + {leftIcon || (hasBackButton && renderBackButton())} + + {!!title && {title}} + {rightIcon} - : - - - - - {leftIcon || (hasBackButton && renderBackButton())} - - {!!title && {title}} - {rightIcon} - - {children} - - - + {children} + + ); }; diff --git a/src/components/header/style.ts b/src/components/header/style.ts index b6e3de6a5..908fff82b 100644 --- a/src/components/header/style.ts +++ b/src/components/header/style.ts @@ -1,8 +1,8 @@ -import { colors } from '@theme/colors'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { ThemeProps } from '@theme/theme'; -import { getTopPadding } from '@utils/platform-padding'; -import { StyleSheet } from 'react-native'; +import { colors } from "@theme/colors"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { getTopPadding } from "@utils/platform-padding"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => StyleSheet.create({ @@ -18,53 +18,53 @@ export const createStyleSheet = (theme: ThemeProps) => }, imageContainer: { height: 120, - overflow: 'hidden', + overflow: "hidden", borderBottomLeftRadius: theme.borderRadius.radius10, borderBottomRightRadius: theme.borderRadius.radius10, - alignItems: 'center', + alignItems: "center", paddingHorizontal: normalScale(14), - backgroundColor: theme.colors.headerColor + backgroundColor: theme.colors.headerColor, }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(getTopPadding(8)), - width: '100%', - justifyContent: 'space-between', + width: "100%", + justifyContent: "space-between", }, image: { height: verticalScale(33), width: normalScale(242), - alignSelf: 'center', + alignSelf: "center", }, cityClass: { // textAlign: 'center', paddingVertical: 22, - paddingHorizontal:198, - fontWeight:'400', - fontSize:16, - color: theme.colors.white + paddingHorizontal: 198, + fontWeight: "400", + fontSize: 16, + color: theme.colors.white, }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, - color: theme.colors.white + color: theme.colors.white, }, input: { flex: 1, height: 40, - justifyContent: "center" + justifyContent: "center", }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, searchInput: { flexShrink: 1, @@ -72,33 +72,32 @@ export const createStyleSheet = (theme: ThemeProps) => marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, // left: 75, - }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft:5 + marginLeft: 5, }, oneContainerText: { - textAlign:'center', + textAlign: "center", fontSize: 50, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, - marginLeft:2 + marginLeft: 2, }, arrowClass: { height: 25, width: 25, - position: 'absolute', + position: "absolute", top: 35, left: 16, }, @@ -108,24 +107,16 @@ export const createStyleSheet = (theme: ThemeProps) => // borderRadius: theme.borderRadius.radius35 }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 15 + bottom: 15, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius:100 + borderRadius: 100, }, }); - - - - - - - - diff --git a/src/components/image-component/index.tsx b/src/components/image-component/index.tsx index 165232122..3221e7018 100644 --- a/src/components/image-component/index.tsx +++ b/src/components/image-component/index.tsx @@ -1,8 +1,8 @@ -import {contain, cover, stretch} from '@assets/constants'; -import React, {FC} from 'react'; -import {StyleProp} from 'react-native'; -import FastImage, {FastImageProps, ImageStyle} from 'react-native-fast-image'; -import {SvgUri} from 'react-native-svg'; +import { contain, cover, stretch } from "@assets/constants"; +import React, { FC } from "react"; +import { StyleProp } from "react-native"; +import FastImage, { FastImageProps, ImageStyle } from "react-native-fast-image"; +import { SvgUri } from "react-native-svg"; export interface ImageProps extends FastImageProps { style?: StyleProp; @@ -11,7 +11,7 @@ export interface ImageProps extends FastImageProps { hide?: boolean; } -export const ImageComponent: FC = props => { +export const ImageComponent: FC = (props) => { const { style, resizeMode = contain, @@ -25,9 +25,9 @@ export const ImageComponent: FC = props => { let isSvg = false; if (isUrl) { - const uriArray = uri?.split('.') || []; + const uriArray = uri?.split(".") || []; - if (uriArray[uriArray.length - 1] === 'svg') { + if (uriArray[uriArray.length - 1] === "svg") { isSvg = true; } else { src = { diff --git a/src/components/input-error/index.tsx b/src/components/input-error/index.tsx index 960e31d5f..e9544bb1e 100644 --- a/src/components/input-error/index.tsx +++ b/src/components/input-error/index.tsx @@ -1,10 +1,10 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {getTheme} from '@theme/index'; -import React, {FC} from 'react'; -import {StyleProp, Text, View, ViewStyle} from 'react-native'; -import {ImageComponent} from '../image-component'; -import {createStyleSheet} from './style'; -import {error} from '@assets/images'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { getTheme } from "@theme/index"; +import React, { FC } from "react"; +import { StyleProp, Text, View, ViewStyle } from "react-native"; +import { ImageComponent } from "../image-component"; +import { createStyleSheet } from "./style"; +import { error } from "@assets/images"; export interface InputErrorProps { errorMsg?: string; @@ -13,9 +13,9 @@ export interface InputErrorProps { isError?: boolean; } -export const InputError: FC = props => { - const {errorMsg, image, viewStyle, isError} = props; - const {themeType} = useAppTheme(); +export const InputError: FC = (props) => { + const { errorMsg, image, viewStyle, isError } = props; + const { themeType } = useAppTheme(); const theme = getTheme(themeType); const styles = createStyleSheet(theme); diff --git a/src/components/input-error/style.ts b/src/components/input-error/style.ts index 193e6be38..1efedb802 100644 --- a/src/components/input-error/style.ts +++ b/src/components/input-error/style.ts @@ -1,12 +1,12 @@ -import {lineHeightScale, normalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { lineHeightScale, normalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => StyleSheet.create({ container: { - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", }, errorIcon: { width: normalScale(15), diff --git a/src/components/input/index.tsx b/src/components/input/index.tsx index e308f9c87..d38c1c4a4 100644 --- a/src/components/input/index.tsx +++ b/src/components/input/index.tsx @@ -1,15 +1,15 @@ -import React from 'react'; +import React from "react"; import { StyleProp, TextInput, TextInputProps, View, ViewStyle, -} from 'react-native'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {InputError} from '@components/input-error'; -import {verticalScale} from '@theme/device/normalize'; +} from "react-native"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { InputError } from "@components/input-error"; +import { verticalScale } from "@theme/device/normalize"; interface InputProps extends TextInputProps { inputStyle?: StyleProp; @@ -21,14 +21,14 @@ interface InputProps extends TextInputProps { } export const Input = (props: InputProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { inputStyle, isError = false, hasMobile = false, - errorMsg = '', + errorMsg = "", children, height = verticalScale(52), ...remainingProps @@ -39,15 +39,15 @@ export const Input = (props: InputProps) => { mobileProps = { ...mobileProps, maxLength: 10, - keyboardType: 'number-pad', - returnKeyType: 'done', + keyboardType: "number-pad", + returnKeyType: "done", }; } return ( { ); }; - \ No newline at end of file diff --git a/src/components/input/style.ts b/src/components/input/style.ts index 3657e42ac..dfbe23af6 100644 --- a/src/components/input/style.ts +++ b/src/components/input/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ diff --git a/src/components/loader/index.tsx b/src/components/loader/index.tsx index e7499853a..110e12790 100644 --- a/src/components/loader/index.tsx +++ b/src/components/loader/index.tsx @@ -1,7 +1,7 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React from 'react'; -import {ActivityIndicator, StyleProp, View, ViewStyle} from 'react-native'; -import {createStyleSheet} from './style'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React from "react"; +import { ActivityIndicator, StyleProp, View, ViewStyle } from "react-native"; +import { createStyleSheet } from "./style"; export interface LoaderProps { showOverlay?: boolean; @@ -11,11 +11,11 @@ export interface LoaderProps { paginationLoaderStyle?: StyleProp; loaderStyle?: StyleProp; containerStyle?: StyleProp; - size?: number | 'small' | 'large'; + size?: number | "small" | "large"; } export const Loader = (props: LoaderProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { showOverlay = false, @@ -24,7 +24,7 @@ export const Loader = (props: LoaderProps) => { paginationLoader = false, paginationLoaderStyle, containerStyle, - size = 'large', + size = "large", } = props || {}; if (!visible) { @@ -45,7 +45,8 @@ export const Loader = (props: LoaderProps) => { return ( + style={[styles.container, showOverlay && styles.overlay, containerStyle]} + > {renderLoader()} ); diff --git a/src/components/loader/style.ts b/src/components/loader/style.ts index 4bfcf3b4b..39648a0e9 100644 --- a/src/components/loader/style.ts +++ b/src/components/loader/style.ts @@ -1,23 +1,23 @@ -import {screenHeight} from '@assets/constants'; -import {verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { screenHeight } from "@assets/constants"; +import { verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => StyleSheet.create({ container: { - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", backgroundColor: theme.colors.white, flex: 1, - position: 'absolute', + position: "absolute", top: 0, bottom: 0, left: 0, right: 0, zIndex: 1000, // height: screenHeight, - height: '100%', + height: "100%", }, overlay: { zIndex: 10, @@ -25,8 +25,8 @@ export const createStyleSheet = (theme: ThemeProps) => }, spinner: { height: verticalScale(40), - justifyContent: 'center', - alignItems: 'center', - width: '100%', + justifyContent: "center", + alignItems: "center", + width: "100%", }, }); diff --git a/src/components/modal-component/index.tsx b/src/components/modal-component/index.tsx index 57b29df9f..874103fbc 100644 --- a/src/components/modal-component/index.tsx +++ b/src/components/modal-component/index.tsx @@ -1,4 +1,4 @@ -import React, {forwardRef, useImperativeHandle, useState} from 'react'; +import React, { forwardRef, useImperativeHandle, useState } from "react"; import { KeyboardAvoidingView, Modal, @@ -9,10 +9,10 @@ import { TouchableOpacity, View, ViewStyle, -} from 'react-native'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; -import GestureRecognizer from 'react-native-swipe-gestures'; +} from "react-native"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import GestureRecognizer from "react-native-swipe-gestures"; export interface ModalProps { children?: JSX.Element | JSX.Element[]; @@ -28,9 +28,9 @@ export type ModalRefProps = { }; const ModalView = (props: ModalProps, ref: React.Ref | undefined) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {children, title, viewStyle, titleStyle, callBack} = props; + const { children, title, viewStyle, titleStyle, callBack } = props; const [isVisible, setVisibility] = useState(false); const closeModal = () => { @@ -59,8 +59,9 @@ const ModalView = (props: ModalProps, ref: React.Ref | undefined) => { /> + behavior={Platform.OS === "ios" ? "padding" : "height"} + style={styles.keyboardView} + > {!!title && {title}} {children} diff --git a/src/components/modal-component/style.ts b/src/components/modal-component/style.ts index 3468975a2..ca59b8a63 100644 --- a/src/components/modal-component/style.ts +++ b/src/components/modal-component/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => StyleSheet.create({ @@ -8,7 +8,7 @@ export const createStyleSheet = (theme: ThemeProps) => flex: 1, }, container: { - position: 'absolute', + position: "absolute", top: 0, bottom: 0, left: 0, @@ -16,7 +16,7 @@ export const createStyleSheet = (theme: ThemeProps) => backgroundColor: theme.colors.modalOverlay, }, keyboardView: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, @@ -35,13 +35,13 @@ export const createStyleSheet = (theme: ThemeProps) => swipeIcon: { height: verticalScale(10), width: normalScale(30), - alignSelf: 'center', + alignSelf: "center", }, title: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font24, color: theme.colors.black, paddingHorizontal: normalScale(16), - alignSelf: 'center', + alignSelf: "center", }, }); diff --git a/src/components/pill/index.tsx b/src/components/pill/index.tsx index 64ed7461f..dbc904418 100644 --- a/src/components/pill/index.tsx +++ b/src/components/pill/index.tsx @@ -1,27 +1,26 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React from 'react'; -import {createStyleSheet} from './style'; -import {StyleProp, Text, TouchableOpacity, ViewStyle} from 'react-native'; -import {ImageComponent} from '@components/image-component'; -import {ImageStyle} from 'react-native-fast-image'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React from "react"; +import { createStyleSheet } from "./style"; +import { StyleProp, Text, TouchableOpacity, ViewStyle } from "react-native"; +import { ImageComponent } from "@components/image-component"; +import { ImageStyle } from "react-native-fast-image"; interface PillProps { label: string; icon?: number; onPressPill?: () => void; backgroundColor?: string; - borderColor?:string; - borderWidth?:number; + borderColor?: string; + borderWidth?: number; foreGroundColor?: string; pillStyle?: StyleProp; iconStyle?: StyleProp; disabled?: boolean; uri?: string; - } export const Pill = (props: PillProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { label, @@ -42,11 +41,18 @@ export const Pill = (props: PillProps) => { onPress={onPressPill} activeOpacity={0.8} disabled={disabled} - style={[styles.container, pillStyle, {backgroundColor},{borderColor},{borderWidth}]}> + style={[ + styles.container, + pillStyle, + { backgroundColor }, + { borderColor }, + { borderWidth }, + ]} + > {!!icon && ( )} - {label} + {label} ); }; diff --git a/src/components/pill/style.ts b/src/components/pill/style.ts index 7914731af..809a8f0f2 100644 --- a/src/components/pill/style.ts +++ b/src/components/pill/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -8,9 +8,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, @@ -39,9 +39,9 @@ export const subscriptionStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, diff --git a/src/components/safe-area-view/index.tsx b/src/components/safe-area-view/index.tsx index bfbd54ccf..c659d9995 100644 --- a/src/components/safe-area-view/index.tsx +++ b/src/components/safe-area-view/index.tsx @@ -1,15 +1,15 @@ -import React from 'react'; -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {SafeAreaView} from 'react-native'; -import {createStyleSheet} from './style'; +import React from "react"; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { SafeAreaView } from "react-native"; +import { createStyleSheet } from "./style"; interface SafeAreaComponentProps { children: React.ReactNode; } export const SafeAreaComponent = (props: SafeAreaComponentProps) => { - const {children} = props || {}; - const {theme} = useAppTheme(); + const { children } = props || {}; + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); return {children}; diff --git a/src/components/safe-area-view/style.ts b/src/components/safe-area-view/style.ts index a5f5d4ebe..8f06845a5 100644 --- a/src/components/safe-area-view/style.ts +++ b/src/components/safe-area-view/style.ts @@ -1,7 +1,7 @@ -import {screenHeight, screenWidth} from '@assets/constants'; -import {verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { screenHeight, screenWidth } from "@assets/constants"; +import { verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ diff --git a/src/components/sized-box/index.tsx b/src/components/sized-box/index.tsx index 974fbbf4f..daa811ffb 100644 --- a/src/components/sized-box/index.tsx +++ b/src/components/sized-box/index.tsx @@ -1,5 +1,5 @@ -import React from 'react'; -import {StyleProp, View, ViewStyle} from 'react-native'; +import React from "react"; +import { StyleProp, View, ViewStyle } from "react-native"; interface SizedBoxProps { height?: number; @@ -8,7 +8,7 @@ interface SizedBoxProps { } export const SizedBox = (props: SizedBoxProps) => { - const {height, width, style} = props || {}; + const { height, width, style } = props || {}; - return ; + return ; }; diff --git a/src/components/subcription/index.tsx b/src/components/subcription/index.tsx index 3a71d2408..c77585889 100644 --- a/src/components/subcription/index.tsx +++ b/src/components/subcription/index.tsx @@ -1,9 +1,9 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React from 'react'; -import {createStyleSheet} from './style'; -import {StyleProp, Text, TouchableOpacity, ViewStyle} from 'react-native'; -import {ImageComponent} from '@components/image-component'; -import {ImageStyle} from 'react-native-fast-image'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React from "react"; +import { createStyleSheet } from "./style"; +import { StyleProp, Text, TouchableOpacity, ViewStyle } from "react-native"; +import { ImageComponent } from "@components/image-component"; +import { ImageStyle } from "react-native-fast-image"; interface SubscriptionProps { label: string; @@ -17,7 +17,7 @@ interface SubscriptionProps { } export const Subscription = (props: SubscriptionProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { label, @@ -35,11 +35,12 @@ export const Subscription = (props: SubscriptionProps) => { onPress={onPressPill} activeOpacity={0.8} disabled={disabled} - style={[styles.container, pillStyle, {backgroundColor}]}> + style={[styles.container, pillStyle, { backgroundColor }]} + > {!!icon && ( )} - {label} + {label} ); }; diff --git a/src/components/subcription/style.ts b/src/components/subcription/style.ts index 35b9fba06..2ded83a2f 100644 --- a/src/components/subcription/style.ts +++ b/src/components/subcription/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -8,9 +8,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", // marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, @@ -30,10 +30,9 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font22, color: theme.colors.white, - marginLeft:10, + marginLeft: 10, // justifyContent: 'center', // alignItems: 'center', }, }); }; - diff --git a/src/components/tab-component/index.tsx b/src/components/tab-component/index.tsx index 6ef00b85a..adb59bc7b 100644 --- a/src/components/tab-component/index.tsx +++ b/src/components/tab-component/index.tsx @@ -1,7 +1,7 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React, {useState} from 'react'; -import {createStyleSheet} from './style'; -import {FlatList, Text, TouchableOpacity, View} from 'react-native'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React, { useState } from "react"; +import { createStyleSheet } from "./style"; +import { FlatList, Text, TouchableOpacity, View } from "react-native"; interface TabComponentProps { tabs: string[]; @@ -14,9 +14,9 @@ interface ItemProps { } export const TabComponent = (props: TabComponentProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {tabs, onPressTab} = props || {}; + const { tabs, onPressTab } = props || {}; const [selctedIndex, setSelectedIndex] = useState(0); const onSelectTab = (index: number) => { @@ -25,7 +25,7 @@ export const TabComponent = (props: TabComponentProps) => { }; const renderItem = (data: ItemProps) => { - const {item, index} = data || {}; + const { item, index } = data || {}; return ( { styles.container, selctedIndex === index && styles.selectedContainer, ]} - onPress={() => onSelectTab(index)}> + onPress={() => onSelectTab(index)} + > {item} ); @@ -45,7 +46,7 @@ export const TabComponent = (props: TabComponentProps) => { item.toString()} + keyExtractor={(item) => item.toString()} horizontal contentContainerStyle={styles.tabContainer} showsHorizontalScrollIndicator={false} diff --git a/src/components/tab-component/style.ts b/src/components/tab-component/style.ts index acdf34201..7333abe84 100644 --- a/src/components/tab-component/style.ts +++ b/src/components/tab-component/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -28,8 +28,8 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, }, tabContainer: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", paddingHorizontal: normalScale(25), }, }); diff --git a/src/config/app-navigation/bottom-navigator.tsx b/src/config/app-navigation/bottom-navigator.tsx index 29bb0c788..e81713ccd 100644 --- a/src/config/app-navigation/bottom-navigator.tsx +++ b/src/config/app-navigation/bottom-navigator.tsx @@ -1,45 +1,52 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; +import { useAppTheme } from "@app-hooks/use-app-theme"; -import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; +import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { NavigationContainerRef, ParamListBase, RouteProp, getFocusedRouteNameFromRoute, useNavigation, -} from '@react-navigation/native'; -import React, {useRef} from 'react'; -import {bottomNavigationVisibleScreens, navigations} from './constant'; -import {HomeRoute} from './home-route'; -import {NavigatorOptionComponent} from './navigator-option-component'; -import {createStyleSheet} from './style'; -import {ChatScreen} from '@screens/chat'; -import {addGreen, calendarTime, chat, eventTwo, gratitude, home, notificationTwo} from '@assets/images'; -import {ImageComponent} from '@components/image-component'; -import {bottomTabs} from '@assets/constants'; -import {TouchableOpacity} from 'react-native'; -import {ModalRefProps} from '@components/modal-component'; -import {AddComponentModal} from '@screens/event/add-component-modal'; -import { EventRoute } from './event-route'; -import { GratitudeScreen } from '@screens/gratitude'; -import { MapRoute } from './map-route'; +} from "@react-navigation/native"; +import React, { useRef } from "react"; +import { bottomNavigationVisibleScreens, navigations } from "./constant"; +import { HomeRoute } from "./home-route"; +import { NavigatorOptionComponent } from "./navigator-option-component"; +import { createStyleSheet } from "./style"; +import { ChatScreen } from "@screens/chat"; +import { + addGreen, + calendarTime, + chat, + eventTwo, + gratitude, + home, + notificationTwo, +} from "@assets/images"; +import { ImageComponent } from "@components/image-component"; +import { bottomTabs } from "@assets/constants"; +import { TouchableOpacity } from "react-native"; +import { ModalRefProps } from "@components/modal-component"; +import { AddComponentModal } from "@screens/event/add-component-modal"; +import { EventRoute } from "./event-route"; +import { GratitudeScreen } from "@screens/gratitude"; +import { MapRoute } from "./map-route"; const Tab = createBottomTabNavigator(); const header = () => null; const NullComponent = () => <>; export const BottomNavigator = () => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const modalRef: React.Ref = useRef(null); const navigation = useNavigation(); const bottomNav = [ bottomTabs.home, - 'event', + "event", bottomTabs.gratitude, bottomTabs.chat, - ]; const getTabData = (name: string) => { @@ -49,16 +56,16 @@ export const BottomNavigator = () => { screenName: navigations.HOME_ROUTE, component: HomeRoute, }; - case 'event': + case "event": return { screenName: navigations.EVENT_ROUTE, component: EventRoute, }; - case bottomTabs.gratitude: - return { - screenName: navigations.MAP_ROUTE, - component: MapRoute, - }; + case bottomTabs.gratitude: + return { + screenName: navigations.MAP_ROUTE, + component: MapRoute, + }; case bottomTabs.chat: return { screenName: navigations.CHAT, @@ -66,13 +73,13 @@ export const BottomNavigator = () => { }; default: return { - screenName: '', + screenName: "", component: HomeRoute, }; } }; - let tabs = bottomNav?.map(nav => getTabData(nav)) || []; + let tabs = bottomNav?.map((nav) => getTabData(nav)) || []; tabs.splice(2, 0, { screenName: bottomTabs.addButton, @@ -83,7 +90,8 @@ export const BottomNavigator = () => { return ( modalRef.current?.onOpenModal()}> + onPress={() => modalRef.current?.onOpenModal()} + > ); @@ -91,7 +99,7 @@ export const BottomNavigator = () => { const renderTabs = ( route: RouteProp, - focused: boolean, + focused: boolean ) => { if (route.name === navigations.HOME_ROUTE) { return ( @@ -133,7 +141,7 @@ export const BottomNavigator = () => { }; const getTabbarStyle = (route: RouteProp) => { - const routeName = getFocusedRouteNameFromRoute(route) ?? ''; + const routeName = getFocusedRouteNameFromRoute(route) ?? ""; if ( routeName.length === 0 || (bottomNavigationVisibleScreens.includes(routeName) && @@ -141,25 +149,26 @@ export const BottomNavigator = () => { ) { return [styles.container]; } - return [{display: 'none'}]; + return [{ display: "none" }]; }; return ( <> ({ - tabBarIcon: ({focused}) => renderTabs(route, focused), + screenOptions={({ route }) => ({ + tabBarIcon: ({ focused }) => renderTabs(route, focused), tabBarShowLabel: false, })} - initialRouteName={navigations.HOME_ROUTE}> - {tabs.map(tab => { + initialRouteName={navigations.HOME_ROUTE} + > + {tabs.map((tab) => { if (tab?.screenName === bottomTabs.addButton) { return ( <> ({ + options={({ route }): any => ({ tabBarButton: renderAddButton, tabBarStyle: getTabbarStyle(route), header, @@ -173,7 +182,7 @@ export const BottomNavigator = () => { ({ + options={({ route }): any => ({ header, tabBarStyle: getTabbarStyle(route), })} @@ -190,6 +199,4 @@ export const BottomNavigator = () => { /> ); - - }; diff --git a/src/config/app-navigation/constant.tsx b/src/config/app-navigation/constant.tsx index 7daf74995..9c25cf1b8 100644 --- a/src/config/app-navigation/constant.tsx +++ b/src/config/app-navigation/constant.tsx @@ -1,32 +1,32 @@ export const navigations = { - LOGIN: 'login', - BOTTOM_NAVIGATION: 'bottomNavigation', - HOME_ROUTE: 'homeRoute', - MAP_ROUTE: 'mapRoute', - HOMESCREEN: 'home', - EVENT_ROUTE: 'eventRoute', - EVENTSCREEN: 'event', - CALENDAR: 'calendar', - CHAT: 'chat', - GRATITUDE: 'gratitude', - EVENT_DETAIL: 'eventDetail', - PROFILE: 'profile', - ADMIN_TOOLS: 'adminTools', - CHECK_IN: 'checkIn', - PAYMENT: 'payment', - GENERIC_WEB_VIEW: 'webView', - SIGNUP:'signUp', - CREATEPOST: 'createPost', - CREATEPOSTOFFER: 'createPostOffer', - CREATEPOSTREQUEST: 'createPostRequest', - CREATEPOSTGRATIS: 'createPostGratis', - RECENTUSERPROFILE:'recentUserProfile', - COMMENTLIST:'commentList', - ADDPAYOUTEXPENSE: 'addPayoutExpense', - EDITPAYOUTEXPENSE: 'editPayoutExpense', - EDITPOSTOFFER:'editPostOffer', - EDITPOSTGRATIS:'editPostGratis', - EDITPOSTREQUEST:'editPostRequest' + LOGIN: "login", + BOTTOM_NAVIGATION: "bottomNavigation", + HOME_ROUTE: "homeRoute", + MAP_ROUTE: "mapRoute", + HOMESCREEN: "home", + EVENT_ROUTE: "eventRoute", + EVENTSCREEN: "event", + CALENDAR: "calendar", + CHAT: "chat", + GRATITUDE: "gratitude", + EVENT_DETAIL: "eventDetail", + PROFILE: "profile", + ADMIN_TOOLS: "adminTools", + CHECK_IN: "checkIn", + PAYMENT: "payment", + GENERIC_WEB_VIEW: "webView", + SIGNUP: "signUp", + CREATEPOST: "createPost", + CREATEPOSTOFFER: "createPostOffer", + CREATEPOSTREQUEST: "createPostRequest", + CREATEPOSTGRATIS: "createPostGratis", + RECENTUSERPROFILE: "recentUserProfile", + COMMENTLIST: "commentList", + ADDPAYOUTEXPENSE: "addPayoutExpense", + EDITPAYOUTEXPENSE: "editPayoutExpense", + EDITPOSTOFFER: "editPostOffer", + EDITPOSTGRATIS: "editPostGratis", + EDITPOSTREQUEST: "editPostRequest", }; export const bottomNavigationVisibleScreens = [ diff --git a/src/config/app-navigation/event-route.tsx b/src/config/app-navigation/event-route.tsx index 22a0ccb66..18be973a9 100644 --- a/src/config/app-navigation/event-route.tsx +++ b/src/config/app-navigation/event-route.tsx @@ -1,21 +1,21 @@ -import React from 'react'; -import {createStackNavigator} from '@react-navigation/stack'; -import {HomeScreen} from '@screens/home'; -import {navigations} from './constant'; -import {EventDetailScreen} from '@screens/event-detail'; -import {ProfileScreen} from '@screens/profile'; -import {AdminToolsScreen} from '@screens/admin-tools'; -import {CheckInScreen} from '@screens/check-in'; -import {PaymentScreen} from '@screens/payment-screen'; -import { CreatePostScreen } from '@screens/createPost'; -import { RecentProfileScreen } from '@screens/recentProfile'; -import { CreatePostGratisScreen } from '@screens/createPost/gratis'; -import { CreatePostRequestScreen } from '@screens/createPost/request'; -import { CreatePostOfferScreen } from '@screens/createPost/offer'; -import { EventList } from '@components/event-list'; -import { EventListScreen } from '@screens/event'; -import { AddPayoutExpenseScreen } from '@screens/admin-tools/addPayoutExpense-modal'; -import { EditPayoutModalScreen } from '@screens/admin-tools/editPayoutExpense-modal'; +import React from "react"; +import { createStackNavigator } from "@react-navigation/stack"; +import { HomeScreen } from "@screens/home"; +import { navigations } from "./constant"; +import { EventDetailScreen } from "@screens/event-detail"; +import { ProfileScreen } from "@screens/profile"; +import { AdminToolsScreen } from "@screens/admin-tools"; +import { CheckInScreen } from "@screens/check-in"; +import { PaymentScreen } from "@screens/payment-screen"; +import { CreatePostScreen } from "@screens/createPost"; +import { RecentProfileScreen } from "@screens/recentProfile"; +import { CreatePostGratisScreen } from "@screens/createPost/gratis"; +import { CreatePostRequestScreen } from "@screens/createPost/request"; +import { CreatePostOfferScreen } from "@screens/createPost/offer"; +import { EventList } from "@components/event-list"; +import { EventListScreen } from "@screens/event"; +import { AddPayoutExpenseScreen } from "@screens/admin-tools/addPayoutExpense-modal"; +import { EditPayoutModalScreen } from "@screens/admin-tools/editPayoutExpense-modal"; const EventStack = createStackNavigator(); @@ -27,67 +27,67 @@ export const EventRoute = () => { - - - ); diff --git a/src/config/app-navigation/home-route.tsx b/src/config/app-navigation/home-route.tsx index d416d7d2c..fed983072 100644 --- a/src/config/app-navigation/home-route.tsx +++ b/src/config/app-navigation/home-route.tsx @@ -1,22 +1,22 @@ -import React from 'react'; -import {createStackNavigator} from '@react-navigation/stack'; -import {HomeScreen} from '@screens/home'; -import {navigations} from './constant'; -import {EventDetailScreen} from '@screens/event-detail'; -import {ProfileScreen} from '@screens/profile'; -import {AdminToolsScreen} from '@screens/admin-tools'; -import {CheckInScreen} from '@screens/check-in'; -import {PaymentScreen} from '@screens/payment-screen'; -import { CreatePostScreen } from '@screens/createPost'; -import { RecentProfileScreen } from '@screens/recentProfile'; -import { CreatePostGratisScreen } from '@screens/createPost/gratis'; -import { CreatePostRequestScreen } from '@screens/createPost/request'; -import { CreatePostOfferScreen } from '@screens/createPost/offer'; -import { CommentList } from '@screens/home/commetList'; -import { ProfileRoute } from './profile-route'; -import { EditPostOfferScreen } from '@screens/createEditPost/offerEdit'; -import { EditPostRequestScreen } from '@screens/createEditPost/requestEdit'; -import { EditPostGratisScreen } from '@screens/createEditPost/gratisEdit'; +import React from "react"; +import { createStackNavigator } from "@react-navigation/stack"; +import { HomeScreen } from "@screens/home"; +import { navigations } from "./constant"; +import { EventDetailScreen } from "@screens/event-detail"; +import { ProfileScreen } from "@screens/profile"; +import { AdminToolsScreen } from "@screens/admin-tools"; +import { CheckInScreen } from "@screens/check-in"; +import { PaymentScreen } from "@screens/payment-screen"; +import { CreatePostScreen } from "@screens/createPost"; +import { RecentProfileScreen } from "@screens/recentProfile"; +import { CreatePostGratisScreen } from "@screens/createPost/gratis"; +import { CreatePostRequestScreen } from "@screens/createPost/request"; +import { CreatePostOfferScreen } from "@screens/createPost/offer"; +import { CommentList } from "@screens/home/commetList"; +import { ProfileRoute } from "./profile-route"; +import { EditPostOfferScreen } from "@screens/createEditPost/offerEdit"; +import { EditPostRequestScreen } from "@screens/createEditPost/requestEdit"; +import { EditPostGratisScreen } from "@screens/createEditPost/gratisEdit"; const HomeStack = createStackNavigator(); @@ -28,7 +28,7 @@ export const HomeRoute = () => { {/* { options={{header}} /> */} - - - ); diff --git a/src/config/app-navigation/index.tsx b/src/config/app-navigation/index.tsx index 1e98a4e7a..c5243e57f 100644 --- a/src/config/app-navigation/index.tsx +++ b/src/config/app-navigation/index.tsx @@ -28,13 +28,13 @@ export const AppNavigation = () => { console.log("-----------App Version--------------", dataItem); if (dataItem.success) { if (Platform.OS === "ios") { - isReleaseHideShow(dataItem.data) + isReleaseHideShow(dataItem.data); iosVersionCheck(dataItem.data); - setData('mapCircleRadius', dataItem.data.mapCircleRadius) + setData("mapCircleRadius", dataItem.data.mapCircleRadius); } else { isReleaseHideShow(dataItem.data); androidVersionCheck(dataItem.data); - setData('mapCircleRadius', dataItem.data.mapCircleRadius) + setData("mapCircleRadius", dataItem.data.mapCircleRadius); } } } catch (error) { @@ -43,35 +43,33 @@ export const AppNavigation = () => { }; const isReleaseHideShow = (dataItem: any) => { - if(Platform.OS === 'ios'){ + if (Platform.OS === "ios") { checkPaymentFlowHideShow(dataItem); - } else{ + } else { checkPaymentFlowHideShowAndroid(dataItem); } - } - + }; + function checkPaymentFlowHideShow(dataItem: any) { - if ("isPaymentFlowShowFour" in dataItem) { console.log("isPaymentFlowShowFour"); var datatemp = dataItem?.isPaymentFlowShowFour; setData("isShowPaymentFlow", datatemp); } - setisVersionApiCalled(true) + setisVersionApiCalled(true); } function checkPaymentFlowHideShowAndroid(dataItem: any) { - if ("isPaymentFlowShowFiveAndroid" in dataItem) { console.log("isPaymentFlowShowFiveAndroid"); var datatemp = dataItem?.isPaymentFlowShowFiveAndroid; setData("isShowPaymentFlowAndroid", datatemp); } - setisVersionApiCalled(true) + setisVersionApiCalled(true); } - + function iosVersionCheck(dataIOS: any) { - if (IOS_VERSION < dataIOS.ios_version) { + if (IOS_VERSION < dataIOS.ios_version) { if (dataIOS.isForceforIOS) { setShowUpdateIOS(true); } else if (dataIOS.inMaintananceIOS) { @@ -100,8 +98,7 @@ export const AppNavigation = () => { return ( <> - {isVersionApiCalled ? : <>} - + {isVersionApiCalled ? : <>} {Platform.OS === "ios" ? ( <>{showUpdateIOS && } diff --git a/src/config/app-navigation/map-route.tsx b/src/config/app-navigation/map-route.tsx index 217ba073c..99c2bd551 100644 --- a/src/config/app-navigation/map-route.tsx +++ b/src/config/app-navigation/map-route.tsx @@ -1,20 +1,20 @@ -import React from 'react'; -import {createStackNavigator} from '@react-navigation/stack'; -import {HomeScreen} from '@screens/home'; -import {navigations} from './constant'; -import {EventDetailScreen} from '@screens/event-detail'; -import {ProfileScreen} from '@screens/profile'; -import {AdminToolsScreen} from '@screens/admin-tools'; -import {CheckInScreen} from '@screens/check-in'; -import {PaymentScreen} from '@screens/payment-screen'; -import { CreatePostScreen } from '@screens/createPost'; -import { RecentProfileScreen } from '@screens/recentProfile'; -import { CreatePostGratisScreen } from '@screens/createPost/gratis'; -import { CreatePostRequestScreen } from '@screens/createPost/request'; -import { CreatePostOfferScreen } from '@screens/createPost/offer'; -import { EventList } from '@components/event-list'; -import { EventListScreen } from '@screens/event'; -import { GratitudeScreen } from '@screens/gratitude'; +import React from "react"; +import { createStackNavigator } from "@react-navigation/stack"; +import { HomeScreen } from "@screens/home"; +import { navigations } from "./constant"; +import { EventDetailScreen } from "@screens/event-detail"; +import { ProfileScreen } from "@screens/profile"; +import { AdminToolsScreen } from "@screens/admin-tools"; +import { CheckInScreen } from "@screens/check-in"; +import { PaymentScreen } from "@screens/payment-screen"; +import { CreatePostScreen } from "@screens/createPost"; +import { RecentProfileScreen } from "@screens/recentProfile"; +import { CreatePostGratisScreen } from "@screens/createPost/gratis"; +import { CreatePostRequestScreen } from "@screens/createPost/request"; +import { CreatePostOfferScreen } from "@screens/createPost/offer"; +import { EventList } from "@components/event-list"; +import { EventListScreen } from "@screens/event"; +import { GratitudeScreen } from "@screens/gratitude"; const MapStack = createStackNavigator(); @@ -26,42 +26,42 @@ export const MapRoute = () => { - ); diff --git a/src/config/app-navigation/navigator-option-component.tsx b/src/config/app-navigation/navigator-option-component.tsx index 29084c26f..96d167583 100644 --- a/src/config/app-navigation/navigator-option-component.tsx +++ b/src/config/app-navigation/navigator-option-component.tsx @@ -1,9 +1,9 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {ImageComponent} from '@components/image-component'; -import React from 'react'; -import {StyleProp, View} from 'react-native'; -import {ImageStyle} from 'react-native-fast-image'; -import {createStyleSheet} from './style'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { ImageComponent } from "@components/image-component"; +import React from "react"; +import { StyleProp, View } from "react-native"; +import { ImageStyle } from "react-native-fast-image"; +import { createStyleSheet } from "./style"; export interface NavigatorOptionProps { focused: boolean; @@ -13,7 +13,7 @@ export interface NavigatorOptionProps { } export const NavigatorOptionComponent = (props: NavigatorOptionProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); const { focused = false, diff --git a/src/config/app-navigation/profile-route.tsx b/src/config/app-navigation/profile-route.tsx index 0cc18ef52..89e4a844d 100644 --- a/src/config/app-navigation/profile-route.tsx +++ b/src/config/app-navigation/profile-route.tsx @@ -1,20 +1,20 @@ -import React from 'react'; -import {createStackNavigator} from '@react-navigation/stack'; -import {HomeScreen} from '@screens/home'; -import {navigations} from './constant'; -import {EventDetailScreen} from '@screens/event-detail'; -import {ProfileScreen} from '@screens/profile'; -import {AdminToolsScreen} from '@screens/admin-tools'; -import {CheckInScreen} from '@screens/check-in'; -import {PaymentScreen} from '@screens/payment-screen'; -import { CreatePostScreen } from '@screens/createPost'; -import { RecentProfileScreen } from '@screens/recentProfile'; -import { CreatePostGratisScreen } from '@screens/createPost/gratis'; -import { CreatePostRequestScreen } from '@screens/createPost/request'; -import { CreatePostOfferScreen } from '@screens/createPost/offer'; -import { CommentList } from '@screens/home/commetList'; -import { AddPayoutExpenseScreen } from '@screens/admin-tools/addPayoutExpense-modal'; -import { EditPayoutModalScreen } from '@screens/admin-tools/editPayoutExpense-modal'; +import React from "react"; +import { createStackNavigator } from "@react-navigation/stack"; +import { HomeScreen } from "@screens/home"; +import { navigations } from "./constant"; +import { EventDetailScreen } from "@screens/event-detail"; +import { ProfileScreen } from "@screens/profile"; +import { AdminToolsScreen } from "@screens/admin-tools"; +import { CheckInScreen } from "@screens/check-in"; +import { PaymentScreen } from "@screens/payment-screen"; +import { CreatePostScreen } from "@screens/createPost"; +import { RecentProfileScreen } from "@screens/recentProfile"; +import { CreatePostGratisScreen } from "@screens/createPost/gratis"; +import { CreatePostRequestScreen } from "@screens/createPost/request"; +import { CreatePostOfferScreen } from "@screens/createPost/offer"; +import { CommentList } from "@screens/home/commetList"; +import { AddPayoutExpenseScreen } from "@screens/admin-tools/addPayoutExpense-modal"; +import { EditPayoutModalScreen } from "@screens/admin-tools/editPayoutExpense-modal"; const ProfileStack = createStackNavigator(); @@ -26,39 +26,38 @@ export const ProfileRoute = () => { - - ); }; diff --git a/src/config/app-navigation/root-navigation.tsx b/src/config/app-navigation/root-navigation.tsx index af1c4e176..8514899ca 100644 --- a/src/config/app-navigation/root-navigation.tsx +++ b/src/config/app-navigation/root-navigation.tsx @@ -1,9 +1,12 @@ -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; export let navigatorRef: NavigationContainerRef | null; export const setNavigator = ( - nav: NavigationContainerRef | null, + nav: NavigationContainerRef | null ) => { navigatorRef = nav; }; diff --git a/src/config/app-navigation/route.tsx b/src/config/app-navigation/route.tsx index daac8b6cb..370ba4b77 100644 --- a/src/config/app-navigation/route.tsx +++ b/src/config/app-navigation/route.tsx @@ -1,20 +1,20 @@ import { NavigationContainer, NavigationContainerRef, -} from '@react-navigation/native'; -import {createStackNavigator} from '@react-navigation/stack'; -import React from 'react'; -import {navigations} from './constant'; -import {setNavigator} from './root-navigation'; -import {LoginScreen} from '@screens/login'; -import {BottomNavigator} from './bottom-navigator'; -import {useToken} from '@app-hooks/use-token'; -import {Loader} from '@components/loader'; -import {GenericWebView} from '@components/generic-webview'; -import { SignUp } from '@screens/signUp'; +} from "@react-navigation/native"; +import { createStackNavigator } from "@react-navigation/stack"; +import React from "react"; +import { navigations } from "./constant"; +import { setNavigator } from "./root-navigation"; +import { LoginScreen } from "@screens/login"; +import { BottomNavigator } from "./bottom-navigator"; +import { useToken } from "@app-hooks/use-token"; +import { Loader } from "@components/loader"; +import { GenericWebView } from "@components/generic-webview"; +import { SignUp } from "@screens/signUp"; export interface RefObj { - onShowToast: (msg?: string, type?: 'success' | 'error' | 'pending') => void; + onShowToast: (msg?: string, type?: "success" | "error" | "pending") => void; } export interface RouteProps { @@ -28,7 +28,7 @@ const RouteStack = createStackNavigator(); const header = () => null; export const Route = (props: RouteProps) => { - const {token, loading} = useToken(); + const { token, loading } = useToken(); let initialScreen = navigations.LOGIN; if (loading) { @@ -44,29 +44,30 @@ export const Route = (props: RouteProps) => { ) => { setNavigator(_); - }}> + }} + > diff --git a/src/config/app-navigation/style.ts b/src/config/app-navigation/style.ts index ba19bd774..bcc250293 100644 --- a/src/config/app-navigation/style.ts +++ b/src/config/app-navigation/style.ts @@ -1,6 +1,6 @@ -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { ThemeProps } from '@theme/theme'; -import { StyleSheet } from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => StyleSheet.create({ @@ -9,23 +9,23 @@ export const createStyleSheet = (theme: ThemeProps) => width: normalScale(50), marginTop: -verticalScale(25), }, - container: { - paddingBottom : 20, + container: { + paddingBottom: 20, backgroundColor: theme.colors.footerColor, height: verticalScale(65), - justifyContent: 'center', - alignItems: 'center', + justifyContent: "center", + alignItems: "center", // borderTopLeftRadius: theme.borderRadius.radius10, // borderTopRightRadius: theme.borderRadius.radius10, }, innerContainer: { - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, icon: { marginTop: 20, width: normalScale(35), height: normalScale(35), - resizeMode: 'contain', + resizeMode: "contain", }, }); diff --git a/src/config/env/env.dev.json b/src/config/env/env.dev.json index 171a5b7f4..ff3fb53b6 100644 --- a/src/config/env/env.dev.json +++ b/src/config/env/env.dev.json @@ -1,9 +1,9 @@ { - "ENV": "Dev", - "BASE_URL":"https://eventmvp.developmentlabs.co/api", - "STIPE_BASE_URL" : "https://api.stripe.com", - "STRIPE_PUBLISHABLE_KEY": "pk_test_51NTPzPSCcfc0L1OiBvL3U9KIZLwGyOj7wGOtJziSZYSmXD53NVZEk0iBmxSBgYplpxwVhH32W0UPqBPQl5M4g3DM008skGLkTX", - "STRIPE_SECRET_KEY": "sk_test_51NTPzPSCcfc0L1OiOKs2ilD9LuNkhkH8GtQvVrpAJoXCpHQ9HniZcy9OowdB8ZIgJmxVZ4DE6K3c8pJ4CKNpenlA00kR2ruSA6", - "MAP_ACCESS_TOKEN":"sk.eyJ1IjoidmlwdWxzYW5hbmRpeWEiLCJhIjoiY2x0OGE2cnloMG4xNjJpbTcybHdzZXBnbiJ9.B0TOTCz-111W22jejswUpA", - "GOOGLE_KEY":"AIzaSyCobkVCxli93gBohNPhJhuHBoWThs1pZlo" -} \ No newline at end of file + "ENV": "Dev", + "BASE_URL": "https://eventmvp.developmentlabs.co/api", + "STIPE_BASE_URL": "https://api.stripe.com", + "STRIPE_PUBLISHABLE_KEY": "pk_test_51NTPzPSCcfc0L1OiBvL3U9KIZLwGyOj7wGOtJziSZYSmXD53NVZEk0iBmxSBgYplpxwVhH32W0UPqBPQl5M4g3DM008skGLkTX", + "STRIPE_SECRET_KEY": "sk_test_51NTPzPSCcfc0L1OiOKs2ilD9LuNkhkH8GtQvVrpAJoXCpHQ9HniZcy9OowdB8ZIgJmxVZ4DE6K3c8pJ4CKNpenlA00kR2ruSA6", + "MAP_ACCESS_TOKEN": "sk.eyJ1IjoidmlwdWxzYW5hbmRpeWEiLCJhIjoiY2x0OGE2cnloMG4xNjJpbTcybHdzZXBnbiJ9.B0TOTCz-111W22jejswUpA", + "GOOGLE_KEY": "AIzaSyCobkVCxli93gBohNPhJhuHBoWThs1pZlo" +} diff --git a/src/config/env/env.json b/src/config/env/env.json index f7b784e29..157f81d03 100644 --- a/src/config/env/env.json +++ b/src/config/env/env.json @@ -1,12 +1,9 @@ { - "ENV": "Prod", - "BASE_URL":"https://app.onelocal.one/api", - "STIPE_BASE_URL" : "https://api.stripe.com", - "STRIPE_PUBLISHABLE_KEY": "pk_live_51ILwo9GFoMwnONQ0MYwhjHkh8K60e6AhM0FERKOTP2wIpPyKEp2d9DW80Llr5KnHnJNtemfuZTuiU4ECKrmC31le00UQlomVlx", - "STRIPE_SECRET_KEY": "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", - "MAP_ACCESS_TOKEN":"sk.eyJ1IjoidmlwdWxzYW5hbmRpeWEiLCJhIjoiY2x0OGE2cnloMG4xNjJpbTcybHdzZXBnbiJ9.B0TOTCz-111W22jejswUpA", - "GOOGLE_KEY":"AIzaSyCobkVCxli93gBohNPhJhuHBoWThs1pZlo" + "ENV": "Prod", + "BASE_URL": "https://app.onelocal.one/api", + "STIPE_BASE_URL": "https://api.stripe.com", + "STRIPE_PUBLISHABLE_KEY": "pk_live_51ILwo9GFoMwnONQ0MYwhjHkh8K60e6AhM0FERKOTP2wIpPyKEp2d9DW80Llr5KnHnJNtemfuZTuiU4ECKrmC31le00UQlomVlx", + "STRIPE_SECRET_KEY": "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", + "MAP_ACCESS_TOKEN": "sk.eyJ1IjoidmlwdWxzYW5hbmRpeWEiLCJhIjoiY2x0OGE2cnloMG4xNjJpbTcybHdzZXBnbiJ9.B0TOTCz-111W22jejswUpA", + "GOOGLE_KEY": "AIzaSyCobkVCxli93gBohNPhJhuHBoWThs1pZlo" } - - - diff --git a/src/config/env/env.prod.json b/src/config/env/env.prod.json index f7b784e29..157f81d03 100644 --- a/src/config/env/env.prod.json +++ b/src/config/env/env.prod.json @@ -1,12 +1,9 @@ { - "ENV": "Prod", - "BASE_URL":"https://app.onelocal.one/api", - "STIPE_BASE_URL" : "https://api.stripe.com", - "STRIPE_PUBLISHABLE_KEY": "pk_live_51ILwo9GFoMwnONQ0MYwhjHkh8K60e6AhM0FERKOTP2wIpPyKEp2d9DW80Llr5KnHnJNtemfuZTuiU4ECKrmC31le00UQlomVlx", - "STRIPE_SECRET_KEY": "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", - "MAP_ACCESS_TOKEN":"sk.eyJ1IjoidmlwdWxzYW5hbmRpeWEiLCJhIjoiY2x0OGE2cnloMG4xNjJpbTcybHdzZXBnbiJ9.B0TOTCz-111W22jejswUpA", - "GOOGLE_KEY":"AIzaSyCobkVCxli93gBohNPhJhuHBoWThs1pZlo" + "ENV": "Prod", + "BASE_URL": "https://app.onelocal.one/api", + "STIPE_BASE_URL": "https://api.stripe.com", + "STRIPE_PUBLISHABLE_KEY": "pk_live_51ILwo9GFoMwnONQ0MYwhjHkh8K60e6AhM0FERKOTP2wIpPyKEp2d9DW80Llr5KnHnJNtemfuZTuiU4ECKrmC31le00UQlomVlx", + "STRIPE_SECRET_KEY": "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", + "MAP_ACCESS_TOKEN": "sk.eyJ1IjoidmlwdWxzYW5hbmRpeWEiLCJhIjoiY2x0OGE2cnloMG4xNjJpbTcybHdzZXBnbiJ9.B0TOTCz-111W22jejswUpA", + "GOOGLE_KEY": "AIzaSyCobkVCxli93gBohNPhJhuHBoWThs1pZlo" } - - - diff --git a/src/index.ts b/src/index.ts index a0993ed6b..81ed67b79 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -declare module '*.png' { +declare module "*.png" { const value: any; export = value; } diff --git a/src/network/api/index.tsx b/src/network/api/index.tsx index e00ccf106..0f7079663 100644 --- a/src/network/api/index.tsx +++ b/src/network/api/index.tsx @@ -1,10 +1,9 @@ -import axios, {AxiosInstance} from 'axios'; -import {Alert} from 'react-native'; -import {API_URL, STIPE_BASE_URL, apiConstants} from '@network/constant'; -import {store} from '@network/reducers/store'; -import {onSetToken} from '@app-hooks/use-token'; -import Toast from 'react-native-simple-toast'; - +import axios, { AxiosInstance } from "axios"; +import { Alert } from "react-native"; +import { API_URL, STIPE_BASE_URL, apiConstants } from "@network/constant"; +import { store } from "@network/reducers/store"; +import { onSetToken } from "@app-hooks/use-token"; +import Toast from "react-native-simple-toast"; export interface ErrorResponse { [key: string]: { @@ -18,7 +17,7 @@ export interface ErrorResponse { } export const axiosRequestConfig = { - method: 'get', // default + method: "get", // default timeout: 1000 * 10, // default is `0` (no timeout) // `withCredentials` indicates whether or not cross-site Access-Control requests @@ -40,18 +39,18 @@ export const axiosRequestConfig = { // Add a request interceptor axios.interceptors.request.use( // Do something before request is sent - config => config, + (config) => config, // Do something with request error - error => Promise.reject(error), + (error) => Promise.reject(error) ); const interceptor = (ref: AxiosInstance) => { ref.interceptors.response.use( // Any status code that lie within the range of 2xx cause this function to trigger // Do something with response data - response => response, + (response) => response, async (error: ErrorResponse) => { - const {status} = error?.response || {}; + const { status } = error?.response || {}; // Any status codes that falls outside the range of 2xx cause this function to trigger // Do something with response error @@ -71,7 +70,7 @@ const interceptor = (ref: AxiosInstance) => { headers: { Authorization: `Bearer ${user?.access_token}`, }, - }, + } ); onSetToken(res?.data?.data?.access?.token); return; @@ -79,12 +78,12 @@ const interceptor = (ref: AxiosInstance) => { if (status !== 200) { Toast.show(error?.response?.data?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); } return Promise.reject(error?.response); - }, + } ); }; @@ -120,7 +119,7 @@ class APIService { baseURL: paymentServiceUrl, }); interceptor(this.paymentService); - } + } } export const API = new APIService(); diff --git a/src/network/api/services/home-service.tsx b/src/network/api/services/home-service.tsx index 86675b6a4..005465d0f 100644 --- a/src/network/api/services/home-service.tsx +++ b/src/network/api/services/home-service.tsx @@ -182,7 +182,10 @@ export const onUpdateEvent = async (props: UpdateEventProps) => { event_image: eventImage, }; - console.log(attachments,'-------------------update event request--------------------'); + console.log( + attachments, + "-------------------update event request--------------------" + ); try { const endPoint = `${apiConstants.createEvent}/${eventId}`; const data = await API.homeService.patch(endPoint, attachments); @@ -230,9 +233,9 @@ export const onCreateEvent = async (props: CreateEventProps) => { } = bodyParams || {}; let response; - var attachments = {} - if(tickets?.length){ - attachments = { + var attachments = {}; + if (tickets?.length) { + attachments = { name: name, start_date: new Date(start_date).toISOString(), end_date: new Date(end_date).toISOString(), @@ -246,8 +249,8 @@ export const onCreateEvent = async (props: CreateEventProps) => { event_type: type, event_image: eventImage, }; - }else{ - attachments = { + } else { + attachments = { name: name, start_date: new Date(start_date).toISOString(), end_date: new Date(end_date).toISOString(), @@ -261,7 +264,10 @@ export const onCreateEvent = async (props: CreateEventProps) => { event_image: eventImage, }; } - console.log(attachments,'-------------------create event request start date--------------------'); + console.log( + attachments, + "-------------------create event request start date--------------------" + ); try { console.log(attachments); const endPoint = `${apiConstants.createEvent}`; diff --git a/src/network/api/services/payment-service.tsx b/src/network/api/services/payment-service.tsx index da954dd5a..c40a27237 100644 --- a/src/network/api/services/payment-service.tsx +++ b/src/network/api/services/payment-service.tsx @@ -1,6 +1,6 @@ -import {STRIPE_SECRET_KEY, apiConstants} from '@network/constant'; -import {API} from '..'; -import ActiveEnv from '@config/env/env.json'; +import { STRIPE_SECRET_KEY, apiConstants } from "@network/constant"; +import { API } from ".."; +import ActiveEnv from "@config/env/env.json"; interface CreateStripeCustomerProps { bodyParams: { @@ -11,9 +11,9 @@ interface CreateStripeCustomerProps { } export const onCreateStripeCustomer = async ( - props: CreateStripeCustomerProps, + props: CreateStripeCustomerProps ) => { - const {bodyParams} = props || {}; + const { bodyParams } = props || {}; let response; try { @@ -21,11 +21,11 @@ export const onCreateStripeCustomer = async ( const data = await API.paymentService.post(endPoint, bodyParams, { headers: { Authorization: `Bearer ${STRIPE_SECRET_KEY}`, - 'Content-Type': 'application/x-www-form-urlencoded', + "Content-Type": "application/x-www-form-urlencoded", }, }); - response = {data: data?.data, statusCode: data?.status}; + response = { data: data?.data, statusCode: data?.status }; } catch (error: any) { response = error; } @@ -37,14 +37,14 @@ interface CreatePayoutIntentProps { bodyParams: { amount: number; currency: string; - 'automatic_payment_methods[enabled]': boolean; + "automatic_payment_methods[enabled]": boolean; customer: string; description: string; }; } export const onCreatePayoutIntent = async (props: CreatePayoutIntentProps) => { - const {bodyParams} = props || {}; + const { bodyParams } = props || {}; let response; try { @@ -52,10 +52,10 @@ export const onCreatePayoutIntent = async (props: CreatePayoutIntentProps) => { const data = await API.paymentService.post(endPoint, bodyParams, { headers: { Authorization: `Bearer ${STRIPE_SECRET_KEY}`, - 'Content-Type': 'application/x-www-form-urlencoded', + "Content-Type": "application/x-www-form-urlencoded", }, }); - response = {data: data?.data, statusCode: data?.status}; + response = { data: data?.data, statusCode: data?.status }; } catch (error: any) { response = error; } @@ -68,13 +68,13 @@ interface CreateSubscriptionProps { mode: string; success_url: string; customer: string; - 'line_items[0][price]': string; - 'line_items[0][quantity]': number; + "line_items[0][price]": string; + "line_items[0][quantity]": number; }; } export const onCreateSubscription = async (props: CreateSubscriptionProps) => { - const {bodyParams} = props || {}; + const { bodyParams } = props || {}; let response; try { @@ -82,10 +82,10 @@ export const onCreateSubscription = async (props: CreateSubscriptionProps) => { const data = await API.paymentService.post(endPoint, bodyParams, { headers: { Authorization: `Bearer ${STRIPE_SECRET_KEY}`, - 'Content-Type': 'application/x-www-form-urlencoded', + "Content-Type": "application/x-www-form-urlencoded", }, }); - response = {data: data?.data, statusCode: data?.status}; + response = { data: data?.data, statusCode: data?.status }; } catch (error: any) { response = error; } diff --git a/src/network/api/services/user-service.tsx b/src/network/api/services/user-service.tsx index a028b5791..5f7e67b5f 100644 --- a/src/network/api/services/user-service.tsx +++ b/src/network/api/services/user-service.tsx @@ -1,6 +1,6 @@ -import { apiConstants } from '@network/constant'; -import { API } from '..'; -import { getApiResponse } from '@network/utils/get-api-response'; +import { apiConstants } from "@network/constant"; +import { API } from ".."; +import { getApiResponse } from "@network/utils/get-api-response"; interface LoginProps { emailOrMobile: string; @@ -51,50 +51,58 @@ interface EditProfileProps { coverImage?: string; first_name?: string; last_name?: string; - nick_name?:string; + nick_name?: string; }; userId: string; } export const onEditUserProfile = async (props: EditProfileProps) => { const { bodyParams, userId } = props || {}; - const { skills, about, bio, profile, coverImage,first_name,last_name,nick_name } = bodyParams || {}; + const { + skills, + about, + bio, + profile, + coverImage, + first_name, + last_name, + nick_name, + } = bodyParams || {}; let response; try { - - const picData = {  + const picData = { uri: profile, - type: 'jpg', - name: 'profile.jpg', - } + type: "jpg", + name: "profile.jpg", + }; const coverImgData = { uri: coverImage, - type: 'jpg', - name: 'coverImage.jpg', - } + type: "jpg", + name: "coverImage.jpg", + }; const attachments = { - 'pic': JSON.stringify(picData), + pic: JSON.stringify(picData), // 'cover_image' : JSON.stringify(coverImgData), - 'about': about, - 'skills': skills?.toString(), - 'bio': bio, - 'first_name':first_name, - 'last_name':last_name, - 'nick_name':nick_name - } - + about: about, + skills: skills?.toString(), + bio: bio, + first_name: first_name, + last_name: last_name, + nick_name: nick_name, + }; + const endPoint = `${apiConstants.editProfile}${userId}`; const data = await API.userService.patch(endPoint, attachments, { headers: { - 'content-type': 'application/json; charset=UTF-8', + "content-type": "application/json; charset=UTF-8", }, }); response = getApiResponse(data); } catch (error: any) { response = getApiResponse(error); - console.log('response=== profile page', response, error); + console.log("response=== profile page", response, error); } return response; diff --git a/src/network/constant.ts b/src/network/constant.ts index acbee7da7..5c8e3581b 100644 --- a/src/network/constant.ts +++ b/src/network/constant.ts @@ -1,69 +1,62 @@ +import ActiveEnv from "@config/env/env.dev.json"; +export const dataObject: any = []; - -import ActiveEnv from '@config/env/env.dev.json'; -export const dataObject:any = []; - -export const getData = (key:any) => { +export const getData = (key: any) => { if (key == undefined) { return 1; - }else{ + } else { return dataObject[key]; } }; -export const setData = (key:any, value:any) => { +export const setData = (key: any, value: any) => { dataObject[key] = value; -}; - +}; + export const apiConstants = { - login: '/v1/auth/login', - userProfile: '/v1/users', - eventLists: '/v1/events/list', - createTicket: '/v1/tickets', - editProfile: '/v1/users/', - refereshToken: '/v1/auth/refresh-tokens', - ticketHolderCheckins: '/v1/events/getTicketHolders', - checkedInUser: '/v1/tickets/checkedInEvent', - createEvent: '/v2/events', - createEventDetail: '/v1/events', - createStripeCustomer: '/v1/customers', - createPayoutIntent: '/v1/payment_intents', - saveCustomerId: '/v1/users/save-customer-id', - appConfig: '/v1/auth/appConfig', - purchaseTicket: '/v1/tickets/store-purchase-response', - createSubscription: '/v1/checkout/sessions', - subscriptionPlans: '/v1/subscriptions/plans', - package:'v1/subscriptions/packages', - packageDetails:'v1/subscriptions/packages/' + login: "/v1/auth/login", + userProfile: "/v1/users", + eventLists: "/v1/events/list", + createTicket: "/v1/tickets", + editProfile: "/v1/users/", + refereshToken: "/v1/auth/refresh-tokens", + ticketHolderCheckins: "/v1/events/getTicketHolders", + checkedInUser: "/v1/tickets/checkedInEvent", + createEvent: "/v2/events", + createEventDetail: "/v1/events", + createStripeCustomer: "/v1/customers", + createPayoutIntent: "/v1/payment_intents", + saveCustomerId: "/v1/users/save-customer-id", + appConfig: "/v1/auth/appConfig", + purchaseTicket: "/v1/tickets/store-purchase-response", + createSubscription: "/v1/checkout/sessions", + subscriptionPlans: "/v1/subscriptions/plans", + package: "v1/subscriptions/packages", + packageDetails: "v1/subscriptions/packages/", }; export const methods = { - post: 'POST', - get: 'GET', + post: "POST", + get: "GET", }; export const persistKeys = { - token: 'token', - fcmToken: '@fcmToken', + token: "token", + fcmToken: "@fcmToken", }; export const apiKeys = { - userProfile: 'userProfile', - ticketHolderCheckins: 'ticketHolderCheckins', - fetchEventDetails: 'fetchEventDetails', - appConfig: 'appConfig', - subscriptionPlans: 'subscriptionPlans', - packageDetail:'packageDetails' + userProfile: "userProfile", + ticketHolderCheckins: "ticketHolderCheckins", + fetchEventDetails: "fetchEventDetails", + appConfig: "appConfig", + subscriptionPlans: "subscriptionPlans", + packageDetail: "packageDetails", }; -export const API_URL = ActiveEnv.BASE_URL -export const IOS_VERSION = '7.9.1' -export const ANDROID_VERSION = '1.0.3' -export const STIPE_BASE_URL = ActiveEnv.STIPE_BASE_URL -export const STRIPE_PUBLIC_KEY = ActiveEnv.STRIPE_PUBLISHABLE_KEY -export const STRIPE_SECRET_KEY = ActiveEnv.STRIPE_SECRET_KEY - - - - - +export const API_URL = ActiveEnv.BASE_URL; +export const IOS_VERSION = "7.9.1"; +export const ANDROID_VERSION = "1.0.3"; +export const STIPE_BASE_URL = ActiveEnv.STIPE_BASE_URL; +export const STRIPE_PUBLIC_KEY = ActiveEnv.STRIPE_PUBLISHABLE_KEY; +export const STRIPE_SECRET_KEY = ActiveEnv.STRIPE_SECRET_KEY; diff --git a/src/network/hooks/home-service-hooks/use-checked-in-user.ts b/src/network/hooks/home-service-hooks/use-checked-in-user.ts index 64f97887b..097d56915 100644 --- a/src/network/hooks/home-service-hooks/use-checked-in-user.ts +++ b/src/network/hooks/home-service-hooks/use-checked-in-user.ts @@ -1,5 +1,5 @@ -import {onCheckedInUser} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onCheckedInUser } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; export const useCheckedInUser = () => { const mutate = useMutation(onCheckedInUser); diff --git a/src/network/hooks/home-service-hooks/use-create-event.ts b/src/network/hooks/home-service-hooks/use-create-event.ts index 559d4c9f7..6409b5567 100644 --- a/src/network/hooks/home-service-hooks/use-create-event.ts +++ b/src/network/hooks/home-service-hooks/use-create-event.ts @@ -1,5 +1,5 @@ -import {onCreateEvent} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onCreateEvent } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; export const useCreateEvent = () => { const mutate = useMutation(onCreateEvent); diff --git a/src/network/hooks/home-service-hooks/use-create-ticket.ts b/src/network/hooks/home-service-hooks/use-create-ticket.ts index ec9e72874..cc86ed197 100644 --- a/src/network/hooks/home-service-hooks/use-create-ticket.ts +++ b/src/network/hooks/home-service-hooks/use-create-ticket.ts @@ -1,5 +1,5 @@ -import {onCreateTicket} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onCreateTicket } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; export const useCreateTicket = () => { const mutate = useMutation(onCreateTicket); diff --git a/src/network/hooks/home-service-hooks/use-edit-ticket.ts b/src/network/hooks/home-service-hooks/use-edit-ticket.ts index 503dfa1e2..ff44e8d0b 100644 --- a/src/network/hooks/home-service-hooks/use-edit-ticket.ts +++ b/src/network/hooks/home-service-hooks/use-edit-ticket.ts @@ -1,5 +1,5 @@ -import {onEditTicket} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onEditTicket } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; export const useEditTicket = () => { const mutate = useMutation(onEditTicket); diff --git a/src/network/hooks/home-service-hooks/use-event-details.ts b/src/network/hooks/home-service-hooks/use-event-details.ts index d5535ef8a..b7d3b00fb 100644 --- a/src/network/hooks/home-service-hooks/use-event-details.ts +++ b/src/network/hooks/home-service-hooks/use-event-details.ts @@ -1,9 +1,9 @@ import { EventDetailsProps, onFetchEventDetails, -} from '@network/api/services/home-service'; -import { apiKeys } from '@network/constant'; -import { useQuery } from '@tanstack/react-query'; +} from "@network/api/services/home-service"; +import { apiKeys } from "@network/constant"; +import { useQuery } from "@tanstack/react-query"; export interface EventDetails { name: string; @@ -19,20 +19,20 @@ export interface EventDetails { tickets: Ticket[]; id: string; is_event_owner: boolean; - quantity: string - max_quantity_to_show: string, - available_quantity: string, - cancelled:boolean, - date_title:string; - day_title:string; + quantity: string; + max_quantity_to_show: string; + available_quantity: string; + cancelled: boolean; + date_title: string; + day_title: string; isPayout: boolean; - viewCount:number; - start_date_label:string; - start_time_label:string; - events:[]; - lat:number | undefined; - long:number | undefined; - event_image_id:string; + viewCount: number; + start_date_label: string; + start_time_label: string; + events: []; + lat: number | undefined; + long: number | undefined; + event_image_id: string; } interface EventProducer { @@ -62,9 +62,9 @@ export interface Ticket { id: string; is_ticket_purchased?: string; ticket_purchase_link?: string; - quantity:string; - max_quantity_to_show:string - available_quantity:any + quantity: string; + max_quantity_to_show: string; + available_quantity: any; } const parsedEventDetails = (data: EventDetails) => { @@ -79,7 +79,7 @@ export const useEventDetails = (props: EventDetailsProps) => { staleTime: 0, refetchOnWindowFocus: false, enabled: false, - }, + } ); return { ...query, data: parsedEventDetails(query?.data?.data) }; diff --git a/src/network/hooks/home-service-hooks/use-event-lists.ts b/src/network/hooks/home-service-hooks/use-event-lists.ts index 53499507b..d82ac080f 100644 --- a/src/network/hooks/home-service-hooks/use-event-lists.ts +++ b/src/network/hooks/home-service-hooks/use-event-lists.ts @@ -1,5 +1,5 @@ -import {onFetchEvents} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onFetchEvents } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; interface Root { results: Result[]; @@ -23,20 +23,20 @@ export interface Result { tickets: Ticket[]; id: string; is_event_owner: boolean; - quantity:string - max_quantity_to_show:string - available_quantity:string - cancelled:boolean; - date_title:string; - day_title:string; + quantity: string; + max_quantity_to_show: string; + available_quantity: string; + cancelled: boolean; + date_title: string; + day_title: string; isPayout: boolean; - viewCount:number; - start_time_label:string; - start_date_label:string; - events:[]; - lat:number | undefined; - long:number | undefined; - event_image_id:string; + viewCount: number; + start_time_label: string; + start_date_label: string; + events: []; + lat: number | undefined; + long: number | undefined; + event_image_id: string; } interface EventProducer { @@ -63,9 +63,9 @@ export interface Ticket { price: string; id?: string; is_ticket_purchased?: string; - quantity:string; - max_quantity_to_show:string - available_quantity:any + quantity: string; + max_quantity_to_show: string; + available_quantity: any; } const parsedEventLists = (data: Root) => { @@ -75,5 +75,5 @@ const parsedEventLists = (data: Root) => { export const useEventLists = () => { const query = useMutation(onFetchEvents); - return {...query, data: parsedEventLists(query?.data?.data)}; + return { ...query, data: parsedEventLists(query?.data?.data) }; }; diff --git a/src/network/hooks/home-service-hooks/use-package-plans.ts b/src/network/hooks/home-service-hooks/use-package-plans.ts index 0fe8ad63d..c6e40ceb1 100644 --- a/src/network/hooks/home-service-hooks/use-package-plans.ts +++ b/src/network/hooks/home-service-hooks/use-package-plans.ts @@ -1,6 +1,6 @@ -import {onGetPackage} from '@network/api/services/home-service'; -import {apiConstants, apiKeys} from '@network/constant'; -import {useQuery} from '@tanstack/react-query'; +import { onGetPackage } from "@network/api/services/home-service"; +import { apiConstants, apiKeys } from "@network/constant"; +import { useQuery } from "@tanstack/react-query"; export type Root = PlanData[]; @@ -12,9 +12,9 @@ export interface PlanData { id: string; status: string; key: string; - color:string; - role_image:any; - membership_image:string; + color: string; + role_image: any; + membership_image: string; } export interface Price { @@ -26,10 +26,10 @@ const subscriptionPackageParsedData = (data: Root) => { }; export const usePackagePlans = () => { - const query = useQuery([apiConstants.package], onGetPackage, { + const query = useQuery([apiConstants.package], onGetPackage, { staleTime: 0, refetchOnWindowFocus: false, }); - return {...query, data: subscriptionPackageParsedData(query?.data?.data)}; + return { ...query, data: subscriptionPackageParsedData(query?.data?.data) }; }; diff --git a/src/network/hooks/home-service-hooks/use-packageDetail-plans.ts b/src/network/hooks/home-service-hooks/use-packageDetail-plans.ts index c80bcec5a..cec62be4b 100644 --- a/src/network/hooks/home-service-hooks/use-packageDetail-plans.ts +++ b/src/network/hooks/home-service-hooks/use-packageDetail-plans.ts @@ -1,11 +1,14 @@ -import { onGetPackage, onGetPackageDetail} from '@network/api/services/home-service'; -import {apiConstants, apiKeys} from '@network/constant'; -import { About } from '@screens/profile/about'; -import {useMutation, useQuery} from '@tanstack/react-query'; +import { + onGetPackage, + onGetPackageDetail, +} from "@network/api/services/home-service"; +import { apiConstants, apiKeys } from "@network/constant"; +import { About } from "@screens/profile/about"; +import { useMutation, useQuery } from "@tanstack/react-query"; export type Root = PlanData[]; - interface PlanData { +interface PlanData { title: string; image: string; price: string; @@ -13,10 +16,10 @@ export type Root = PlanData[]; id: string; status: string; key: string; - color:string; - defaultSignupText:string; - role_image:number; - membership_image:string; + color: string; + defaultSignupText: string; + role_image: number; + membership_image: string; } export interface Price { @@ -27,7 +30,6 @@ const subscriptionPackageDetailParsedData = (data: PlanData) => { return data; }; - export const usePackageDetailPlans = () => { const mutate = useMutation(onGetPackageDetail); diff --git a/src/network/hooks/home-service-hooks/use-purchase-ticket.ts b/src/network/hooks/home-service-hooks/use-purchase-ticket.ts index f755c3a21..20f6a32e0 100644 --- a/src/network/hooks/home-service-hooks/use-purchase-ticket.ts +++ b/src/network/hooks/home-service-hooks/use-purchase-ticket.ts @@ -1,5 +1,5 @@ -import {onPurchaseTicket} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onPurchaseTicket } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; export const usePurchaseTicket = () => { const mutate = useMutation(onPurchaseTicket); diff --git a/src/network/hooks/home-service-hooks/use-subscription-plans.ts b/src/network/hooks/home-service-hooks/use-subscription-plans.ts index 20d1d3ec0..4cf26faea 100644 --- a/src/network/hooks/home-service-hooks/use-subscription-plans.ts +++ b/src/network/hooks/home-service-hooks/use-subscription-plans.ts @@ -1,6 +1,6 @@ -import {onGetSubscriptionPlans} from '@network/api/services/home-service'; -import {apiKeys} from '@network/constant'; -import {useQuery} from '@tanstack/react-query'; +import { onGetSubscriptionPlans } from "@network/api/services/home-service"; +import { apiKeys } from "@network/constant"; +import { useQuery } from "@tanstack/react-query"; export type Root = PlanData[]; @@ -28,5 +28,5 @@ export const useSubscriptionPlans = () => { refetchOnWindowFocus: false, }); - return {...query, data: subscriptionPlansParsedData(query?.data?.data)}; + return { ...query, data: subscriptionPlansParsedData(query?.data?.data) }; }; diff --git a/src/network/hooks/home-service-hooks/use-ticket-holder-checkin-list.ts b/src/network/hooks/home-service-hooks/use-ticket-holder-checkin-list.ts index 0b3c20f3d..4e67d4b32 100644 --- a/src/network/hooks/home-service-hooks/use-ticket-holder-checkin-list.ts +++ b/src/network/hooks/home-service-hooks/use-ticket-holder-checkin-list.ts @@ -1,9 +1,9 @@ import { TickeHolderProps, onFetchTicketHolderList, -} from '@network/api/services/home-service'; -import {apiKeys} from '@network/constant'; -import {useQuery} from '@tanstack/react-query'; +} from "@network/api/services/home-service"; +import { apiKeys } from "@network/constant"; +import { useQuery } from "@tanstack/react-query"; export interface Root { results: Result[]; @@ -21,7 +21,7 @@ export interface Result { ticket_name: string; stripe_response: StripeResponse; ticket_price: string; - ticket_total_price:string; + ticket_total_price: string; _id: string; is_app_user: number; } @@ -86,8 +86,8 @@ export const useTicketHolderCheckinsList = (props: TickeHolderProps) => { const query = useQuery( [apiKeys.ticketHolderCheckins], () => onFetchTicketHolderList(props), - {enabled: false, refetchOnWindowFocus: false, staleTime: 0}, + { enabled: false, refetchOnWindowFocus: false, staleTime: 0 } ); - return {...query, data: parsedCheckinsList(query?.data?.data)}; + return { ...query, data: parsedCheckinsList(query?.data?.data) }; }; diff --git a/src/network/hooks/home-service-hooks/use-update-event.ts b/src/network/hooks/home-service-hooks/use-update-event.ts index 5808fe053..87bcbb7b0 100644 --- a/src/network/hooks/home-service-hooks/use-update-event.ts +++ b/src/network/hooks/home-service-hooks/use-update-event.ts @@ -1,5 +1,5 @@ -import {onUpdateEvent} from '@network/api/services/home-service'; -import {useMutation} from '@tanstack/react-query'; +import { onUpdateEvent } from "@network/api/services/home-service"; +import { useMutation } from "@tanstack/react-query"; export const useUpdateEvent = () => { const mutate = useMutation(onUpdateEvent); diff --git a/src/network/hooks/payment-service-hooks/use-create-payout-intent.ts b/src/network/hooks/payment-service-hooks/use-create-payout-intent.ts index 2a5cadfa5..0910c93d3 100644 --- a/src/network/hooks/payment-service-hooks/use-create-payout-intent.ts +++ b/src/network/hooks/payment-service-hooks/use-create-payout-intent.ts @@ -1,5 +1,5 @@ -import {onCreatePayoutIntent} from '@network/api/services/payment-service'; -import {useMutation} from '@tanstack/react-query'; +import { onCreatePayoutIntent } from "@network/api/services/payment-service"; +import { useMutation } from "@tanstack/react-query"; export const useCreatePayoutIntent = () => { const mutate = useMutation(onCreatePayoutIntent); diff --git a/src/network/hooks/payment-service-hooks/use-create-stripe-customer.ts b/src/network/hooks/payment-service-hooks/use-create-stripe-customer.ts index 4aa19ff7e..497a190ab 100644 --- a/src/network/hooks/payment-service-hooks/use-create-stripe-customer.ts +++ b/src/network/hooks/payment-service-hooks/use-create-stripe-customer.ts @@ -1,5 +1,5 @@ -import {onCreateStripeCustomer} from '@network/api/services/payment-service'; -import {useMutation} from '@tanstack/react-query'; +import { onCreateStripeCustomer } from "@network/api/services/payment-service"; +import { useMutation } from "@tanstack/react-query"; export const useCreateStripeCustomer = () => { const mutate = useMutation(onCreateStripeCustomer); diff --git a/src/network/hooks/payment-service-hooks/use-create-subscription.ts b/src/network/hooks/payment-service-hooks/use-create-subscription.ts index c6c3f5269..95808e329 100644 --- a/src/network/hooks/payment-service-hooks/use-create-subscription.ts +++ b/src/network/hooks/payment-service-hooks/use-create-subscription.ts @@ -1,5 +1,5 @@ -import {onCreateSubscription} from '@network/api/services/payment-service'; -import {useMutation} from '@tanstack/react-query'; +import { onCreateSubscription } from "@network/api/services/payment-service"; +import { useMutation } from "@tanstack/react-query"; export const useCreateSubscription = () => { const mutate = useMutation(onCreateSubscription); diff --git a/src/network/hooks/user-service-hooks/use-app-config.ts b/src/network/hooks/user-service-hooks/use-app-config.ts index 1ef0755b5..68f322460 100644 --- a/src/network/hooks/user-service-hooks/use-app-config.ts +++ b/src/network/hooks/user-service-hooks/use-app-config.ts @@ -1,6 +1,6 @@ -import {onGetAppConfig} from '@network/api/services/user-service'; -import {apiKeys} from '@network/constant'; -import {useQuery} from '@tanstack/react-query'; +import { onGetAppConfig } from "@network/api/services/user-service"; +import { apiKeys } from "@network/constant"; +import { useQuery } from "@tanstack/react-query"; export interface Root { ios: Ios; @@ -29,5 +29,5 @@ export const useAppConfig = () => { refetchOnWindowFocus: false, }); - return {...query, data: appConfigParsedData(query?.data?.data)}; + return { ...query, data: appConfigParsedData(query?.data?.data) }; }; diff --git a/src/network/hooks/user-service-hooks/use-edit-profile.ts b/src/network/hooks/user-service-hooks/use-edit-profile.ts index 79611c9a6..a95a6dce0 100644 --- a/src/network/hooks/user-service-hooks/use-edit-profile.ts +++ b/src/network/hooks/user-service-hooks/use-edit-profile.ts @@ -1,5 +1,5 @@ -import {onEditUserProfile} from '@network/api/services/user-service'; -import {useMutation} from '@tanstack/react-query'; +import { onEditUserProfile } from "@network/api/services/user-service"; +import { useMutation } from "@tanstack/react-query"; export const useEditProfile = () => { const mutate = useMutation(onEditUserProfile); diff --git a/src/network/hooks/user-service-hooks/use-login.ts b/src/network/hooks/user-service-hooks/use-login.ts index 5d5d964bf..a74bc23c3 100644 --- a/src/network/hooks/user-service-hooks/use-login.ts +++ b/src/network/hooks/user-service-hooks/use-login.ts @@ -1,5 +1,5 @@ -import {onLogin} from '@network/api/services/user-service'; -import {useMutation} from '@tanstack/react-query'; +import { onLogin } from "@network/api/services/user-service"; +import { useMutation } from "@tanstack/react-query"; export const useLogin = () => { const mutate = useMutation(onLogin); diff --git a/src/network/hooks/user-service-hooks/use-save-customer-id.tsx b/src/network/hooks/user-service-hooks/use-save-customer-id.tsx index 9dcfebbe6..e3dab1576 100644 --- a/src/network/hooks/user-service-hooks/use-save-customer-id.tsx +++ b/src/network/hooks/user-service-hooks/use-save-customer-id.tsx @@ -1,5 +1,5 @@ -import {onSaveCustomerId} from '@network/api/services/user-service'; -import {useMutation} from '@tanstack/react-query'; +import { onSaveCustomerId } from "@network/api/services/user-service"; +import { useMutation } from "@tanstack/react-query"; export const useSaveCustomerId = () => { const mutate = useMutation(onSaveCustomerId); diff --git a/src/network/hooks/user-service-hooks/use-user-profile.ts b/src/network/hooks/user-service-hooks/use-user-profile.ts index 6819ea8e0..50689c6b2 100644 --- a/src/network/hooks/user-service-hooks/use-user-profile.ts +++ b/src/network/hooks/user-service-hooks/use-user-profile.ts @@ -1,9 +1,9 @@ import { UserProfileProps, onGetUserProfile, -} from '@network/api/services/user-service'; -import {apiKeys} from '@network/constant'; -import {useQuery} from '@tanstack/react-query'; +} from "@network/api/services/user-service"; +import { apiKeys } from "@network/constant"; +import { useQuery } from "@tanstack/react-query"; interface Root { bio: string; @@ -15,9 +15,9 @@ interface Root { about: string; skills: string[]; is_active_subscription: boolean; - isEventActiveSubscription:boolean; + isEventActiveSubscription: boolean; cover_image: string; - eventProducerPackageId:string + eventProducerPackageId: string; } interface ParsedData { @@ -29,7 +29,7 @@ interface ParsedData { skills: string[]; userType: string; isActiveSubscription: boolean; - eventProducerID:string + eventProducerID: string; coverImage: string; } @@ -39,7 +39,7 @@ export const userProfileParsedData = (data: Root) => { name: `${data?.first_name} ${data?.last_name}`, userType: data?.user_type, isActiveSubscription: data?.isEventActiveSubscription, - eventProducerID:data?.eventProducerPackageId, + eventProducerID: data?.eventProducerPackageId, coverImage: data?.cover_image, } as ParsedData; }; @@ -51,5 +51,5 @@ export const useUserProfile = (props: UserProfileProps) => { enabled: false, }); - return {...query, data: userProfileParsedData(query?.data?.data)}; + return { ...query, data: userProfileParsedData(query?.data?.data) }; }; diff --git a/src/network/reducers/internet-connection-handle-reducer.tsx b/src/network/reducers/internet-connection-handle-reducer.tsx index 1fbc1ec10..fc86498d5 100644 --- a/src/network/reducers/internet-connection-handle-reducer.tsx +++ b/src/network/reducers/internet-connection-handle-reducer.tsx @@ -1,4 +1,4 @@ -import {createSlice} from '@reduxjs/toolkit'; +import { createSlice } from "@reduxjs/toolkit"; export interface InternetConnectionState { isConnected: boolean; @@ -16,19 +16,19 @@ const initialState = { }; const internetConnectionHandleSlice = createSlice({ - name: 'internetConnectionHandle', + name: "internetConnectionHandle", initialState, reducers: { checkConnectivity: (prevState: InternetConnectionState, action: Action) => { - const state = {...prevState}; + const state = { ...prevState }; state.isConnected = action?.payload || true; return state; }, handleInternetComponentVisibility: ( prevState: InternetConnectionState, - action: Action, + action: Action ) => { - const state = {...prevState}; + const state = { ...prevState }; state.isShowInternetComponent = action?.payload || false; return state; }, @@ -37,7 +37,7 @@ const internetConnectionHandleSlice = createSlice({ const internetConnectionHandleReducer = internetConnectionHandleSlice.reducer; -const {checkConnectivity, handleInternetComponentVisibility} = +const { checkConnectivity, handleInternetComponentVisibility } = internetConnectionHandleSlice.actions; export { diff --git a/src/network/reducers/logout-reducer.tsx b/src/network/reducers/logout-reducer.tsx index cbb9b04cc..3efb5c85f 100644 --- a/src/network/reducers/logout-reducer.tsx +++ b/src/network/reducers/logout-reducer.tsx @@ -1,7 +1,7 @@ -import {createSlice} from '@reduxjs/toolkit'; +import { createSlice } from "@reduxjs/toolkit"; const logoutSlice = createSlice({ - name: 'logout', + name: "logout", initialState: {}, reducers: { clearReducer() {}, @@ -10,4 +10,4 @@ const logoutSlice = createSlice({ export const logoutReducer = logoutSlice.reducer; -export const {clearReducer} = logoutSlice.actions; +export const { clearReducer } = logoutSlice.actions; diff --git a/src/network/reducers/root-reducer.tsx b/src/network/reducers/root-reducer.tsx index 153f48aa2..23a4a90e7 100644 --- a/src/network/reducers/root-reducer.tsx +++ b/src/network/reducers/root-reducer.tsx @@ -1,9 +1,9 @@ -import AsyncStorage from '@react-native-async-storage/async-storage'; -import {AnyAction, combineReducers} from 'redux'; -import {persistReducer} from 'redux-persist'; -import {internetConnectionHandleReducer} from './internet-connection-handle-reducer'; -import {userProfileReducer} from './user-profile-reducer'; -import {logoutReducer} from './logout-reducer'; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { AnyAction, combineReducers } from "redux"; +import { persistReducer } from "redux-persist"; +import { internetConnectionHandleReducer } from "./internet-connection-handle-reducer"; +import { userProfileReducer } from "./user-profile-reducer"; +import { logoutReducer } from "./logout-reducer"; const combinedReducer = combineReducers({ internetConnectionHandleReducer, @@ -15,7 +15,7 @@ export type RootState = ReturnType; const rootReducer = (state: RootState, action: AnyAction) => { let stateData = state; - if (action.type === 'logout/clearReducer') { + if (action.type === "logout/clearReducer") { stateData = {} as RootState; } @@ -23,9 +23,9 @@ const rootReducer = (state: RootState, action: AnyAction) => { }; const persistConfig = { - key: 'root', + key: "root", storage: AsyncStorage, - whitelist: ['userProfileReducer'], + whitelist: ["userProfileReducer"], }; export const persistedReducer = persistReducer(persistConfig, rootReducer); diff --git a/src/network/reducers/store.ts b/src/network/reducers/store.ts index c2e9a8a0a..e74c6b31b 100644 --- a/src/network/reducers/store.ts +++ b/src/network/reducers/store.ts @@ -1,10 +1,10 @@ -import {configureStore} from '@reduxjs/toolkit'; -import {persistStore} from 'redux-persist'; -import {persistedReducer} from './root-reducer'; +import { configureStore } from "@reduxjs/toolkit"; +import { persistStore } from "redux-persist"; +import { persistedReducer } from "./root-reducer"; export const store = configureStore({ reducer: persistedReducer, - middleware: getDefaultMiddleware => + middleware: (getDefaultMiddleware) => getDefaultMiddleware({ immutableCheck: !__DEV__, serializableCheck: !__DEV__, diff --git a/src/network/reducers/user-profile-reducer.tsx b/src/network/reducers/user-profile-reducer.tsx index 023a3b870..ad52aeb07 100644 --- a/src/network/reducers/user-profile-reducer.tsx +++ b/src/network/reducers/user-profile-reducer.tsx @@ -1,4 +1,4 @@ -import {createSlice} from '@reduxjs/toolkit'; +import { createSlice } from "@reduxjs/toolkit"; export interface UserProfileState { user: object; @@ -14,18 +14,17 @@ const initialState = { }; const userProfileSlice = createSlice({ - name: 'userProfile', + name: "userProfile", initialState, reducers: { onSetUser: (prevState: UserProfileState, action: Action) => { - const state = {...prevState}; + const state = { ...prevState }; state.user = action?.payload; return state; }, onSetCoverImage: (prevState: UserProfileState, action: Action) => { - - const state = {...prevState}; - state.user = {...state.user, coverImage: action?.payload}; + const state = { ...prevState }; + state.user = { ...state.user, coverImage: action?.payload }; return state; }, }, @@ -33,6 +32,6 @@ const userProfileSlice = createSlice({ const userProfileReducer = userProfileSlice.reducer; -const {onSetUser, onSetCoverImage} = userProfileSlice.actions; +const { onSetUser, onSetCoverImage } = userProfileSlice.actions; -export {onSetUser, onSetCoverImage, userProfileReducer}; +export { onSetUser, onSetCoverImage, userProfileReducer }; diff --git a/src/network/utils/get-api-response.tsx b/src/network/utils/get-api-response.tsx index ea98bbf9e..38f2c6f42 100644 --- a/src/network/utils/get-api-response.tsx +++ b/src/network/utils/get-api-response.tsx @@ -1,7 +1,7 @@ -import {AxiosResponse} from 'axios'; +import { AxiosResponse } from "axios"; export const getApiResponse = (data: AxiosResponse) => { - const {success, data: resData, message, code} = data?.data || {}; + const { success, data: resData, message, code } = data?.data || {}; const res = { success, diff --git a/src/network/utils/get-method.tsx b/src/network/utils/get-method.tsx index a48385cec..a5ac6e101 100644 --- a/src/network/utils/get-method.tsx +++ b/src/network/utils/get-method.tsx @@ -1,12 +1,12 @@ -import {methods} from '@network/constant'; +import { methods } from "@network/constant"; -export const getMethod = (request: {method: string}) => { +export const getMethod = (request: { method: string }) => { switch (request.method) { case methods.get: - return 'onGet'; + return "onGet"; case methods.post: - return 'onPost'; + return "onPost"; default: - return 'onGet'; + return "onGet"; } }; diff --git a/src/screens/admin-tools/add-ticket-modal.tsx b/src/screens/admin-tools/add-ticket-modal.tsx index 0ba32984f..eaf7f1a72 100644 --- a/src/screens/admin-tools/add-ticket-modal.tsx +++ b/src/screens/admin-tools/add-ticket-modal.tsx @@ -7,7 +7,15 @@ import { Keyboard, Text, TouchableOpacity, View } from "react-native"; import { EventList } from "@components/event-list"; import { Input } from "@components/input"; import { ImageComponent } from "@components/image-component"; -import { activeRadio, arrowDown, calendar, dummy, event, pin, save } from "@assets/images"; +import { + activeRadio, + arrowDown, + calendar, + dummy, + event, + pin, + save, +} from "@assets/images"; import { DatePickerRefProps, DateRangePicker, diff --git a/src/screens/admin-tools/addPayoutExpense-modal.tsx b/src/screens/admin-tools/addPayoutExpense-modal.tsx index 47200ae03..687b9ba52 100644 --- a/src/screens/admin-tools/addPayoutExpense-modal.tsx +++ b/src/screens/admin-tools/addPayoutExpense-modal.tsx @@ -12,19 +12,17 @@ import { API_URL } from "@network/constant"; import { ScrollView } from "react-native"; import { FlatList } from "react-native"; import { ImageComponent } from "@components/image-component"; -import { - arrowLeft, - buttonArrowGreen, - onelogo, - saveIcon, -} from "@assets/images"; +import { arrowLeft, buttonArrowGreen, onelogo, saveIcon } from "@assets/images"; import Toast from "react-native-simple-toast"; import { Loader } from "@components/loader"; import { launchImageLibrary } from "react-native-image-picker"; import { ButtonComponent } from "@components/button-component"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { color } from "react-native-elements/dist/helpers"; -import { NavigationContainerRef, ParamListBase } from "@react-navigation/native"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; interface AddPayoutExpenseScreenProps { navigation?: NavigationContainerRef; @@ -72,7 +70,6 @@ export const AddPayoutExpenseScreen = ( setPriceData(item); }; - const resetState = () => { onUserSearch(""); setDescriptions(""); @@ -105,7 +102,7 @@ export const AddPayoutExpenseScreen = ( backgroundColor: "black", }); } - onUserSearch(''); + onUserSearch(""); } else { Toast.show("You can not select more than one users", Toast.LONG, { backgroundColor: "black", @@ -334,10 +331,13 @@ export const AddPayoutExpenseScreen = ( return ( <> - + - + @@ -345,10 +345,11 @@ export const AddPayoutExpenseScreen = ( + source={onelogo} + > NE - L o c a l + L o c a l @@ -356,9 +357,16 @@ export const AddPayoutExpenseScreen = ( - - + > + Add Breakdown @@ -443,7 +451,7 @@ export const AddPayoutExpenseScreen = ( alignSelf: "center", flexShrink: 1, width: 150, - color: theme.colors.black + color: theme.colors.black, }} > {item?.first_name} {item?.last_name} @@ -546,25 +554,23 @@ export const AddPayoutExpenseScreen = ( value={amount} keyboardType="number-pad" onChangeText={(text) => { - setAmount(text) - } - } + setAmount(text); + }} > Description - - setDescriptions(text)} - style={styles.payoutDescLbl} - > - + setDescriptions(text)} + style={styles.payoutDescLbl} + > + { (person: any) => person !== imageItem.key ); setImageSelectArrayKey(newImageKey); - }; const onBackPress = () => { diff --git a/src/screens/admin-tools/getAdmintoolsDropdown.tsx b/src/screens/admin-tools/getAdmintoolsDropdown.tsx index f2b7710bc..21cef1f48 100644 --- a/src/screens/admin-tools/getAdmintoolsDropdown.tsx +++ b/src/screens/admin-tools/getAdmintoolsDropdown.tsx @@ -2,7 +2,13 @@ import { useAppTheme } from "@app-hooks/use-app-theme"; import React, { useCallback, useEffect, useRef, useState } from "react"; import { View, Text } from "react-native"; import { createStyleSheet } from "./style"; -import { buttonArrowGreen, dummy, edit2, payoutClose, sendPayoutImg } from "@assets/images"; +import { + buttonArrowGreen, + dummy, + edit2, + payoutClose, + sendPayoutImg, +} from "@assets/images"; import { ImageComponent } from "@components/image-component"; import { ModalRefProps } from "@components/modal-component"; import { TouchableOpacity } from "react-native"; @@ -10,7 +16,11 @@ import { API_URL, setData } from "@network/constant"; import AsyncStorage from "@react-native-async-storage/async-storage"; import { FlatList } from "react-native"; import { Loader } from "@components/loader"; -import { NavigationContainerRef, ParamListBase, useFocusEffect } from "@react-navigation/native"; +import { + NavigationContainerRef, + ParamListBase, + useFocusEffect, +} from "@react-navigation/native"; import { EditPayoutModal } from "./editPayoutExpense-modal"; import Toast from "react-native-simple-toast"; import { AddPayoutExpenseModel } from "./addPayoutExpense-modal"; @@ -28,7 +38,7 @@ export const GetAdmintoolsDropDownScreen = ( ) => { const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const { eventId,navigation } = props || {}; + const { eventId, navigation } = props || {}; const [isLoading, LodingData] = useState(false); const [payoutData, setPayoutData]: any = useState({}); const [userId, setUserId]: any = useState(""); @@ -39,13 +49,16 @@ export const GetAdmintoolsDropDownScreen = ( const [expensesAmt, setExpenseAmt]: any = useState(); const [totalProfile, setTotalProfile]: any = useState(); const [payoutAmt, setpayoutAmt]: any = useState(); - const [isAddEditPayout , setISAddEditPayout] = useState(Boolean); + const [isAddEditPayout, setISAddEditPayout] = useState(Boolean); const [remainingAmt, setRemainingAmt]: any = useState(); const [modalVisible, setModalVisible] = useState(false); const openAddBreakDownModal = (id: any) => { setUserId(userId); - navigation?.navigate(navigations.ADDPAYOUTEXPENSE, {id: eventId,addPayOutExpense : payoutData?.total_profit}); + navigation?.navigate(navigations.ADDPAYOUTEXPENSE, { + id: eventId, + addPayOutExpense: payoutData?.total_profit, + }); }; useFocusEffect( @@ -86,7 +99,7 @@ export const GetAdmintoolsDropDownScreen = ( setRevenueAmt(dataItem?.data?.revenue_amount); setExpenseAmt(dataItem?.data?.total_expenses); setIsPayout(dataItem?.data?.isPayout); - setISAddEditPayout(dataItem?.data?.isPayoutAddEdit) + setISAddEditPayout(dataItem?.data?.isPayoutAddEdit); setTotalProfile( dataItem?.data?.revenue_amount - dataItem?.data?.total_expenses ); @@ -124,7 +137,6 @@ export const GetAdmintoolsDropDownScreen = ( Toast.show(dataItem?.message, Toast.LONG, { backgroundColor: "black", }); - } catch (error) { console.error(error); LodingData(false); @@ -143,7 +155,10 @@ export const GetAdmintoolsDropDownScreen = ( amount: item.amount, expensePayoutID: item.key, }; - navigation?.navigate(navigations.EDITPAYOUTEXPENSE, {payoutExpenseObject: tempData, id: eventId}) + navigation?.navigate(navigations.EDITPAYOUTEXPENSE, { + payoutExpenseObject: tempData, + id: eventId, + }); }; const sendPayoutModal = () => { @@ -159,8 +174,6 @@ export const GetAdmintoolsDropDownScreen = ( createPayoutAPI(); }; - - return ( <> @@ -243,15 +256,19 @@ export const GetAdmintoolsDropDownScreen = ( }} > - {isAddEditPayout ? editClick(item, "Expense")} - > - - : <>} - + {isAddEditPayout ? ( + editClick(item, "Expense")} + > + + + ) : ( + <> + )} + )} > - {isAddEditPayout ? openAddBreakDownModal(userId)} - style={styles.addItemCont} - > - - + - add item - - - : <>} + {isAddEditPayout ? ( + openAddBreakDownModal(userId)} + style={styles.addItemCont} + > + + + + add item + + + ) : ( + <> + )} ${expensesAmt} @@ -310,15 +330,18 @@ export const GetAdmintoolsDropDownScreen = ( }} > - {isAddEditPayout ? editClick(item, "Payout")} - > - - : <>} - + {isAddEditPayout ? ( + editClick(item, "Payout")} + > + + + ) : ( + <> + )} )} > - {isAddEditPayout ? openAddBreakDownModal(userId)} - style={styles.addItemCont} - > - - - + - add item - - : <>} - + {isAddEditPayout ? ( + openAddBreakDownModal(userId)} + style={styles.addItemCont} + > + + + + add item + + + ) : ( + <> + )} + {payoutAmt !== undefined ? ( @@ -382,16 +408,13 @@ export const GetAdmintoolsDropDownScreen = ( setModalVisible(!modalVisible); }} > - - - + + + @@ -400,19 +423,22 @@ export const GetAdmintoolsDropDownScreen = ( (you won't be able to make changes after sending) - + Send Payout - + Cancel - + diff --git a/src/screens/admin-tools/index.tsx b/src/screens/admin-tools/index.tsx index 4bd27eb7c..6ca10f24b 100644 --- a/src/screens/admin-tools/index.tsx +++ b/src/screens/admin-tools/index.tsx @@ -139,8 +139,14 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { const { mutateAsync: createEvent, isLoading: createEventLoading } = useCreateEvent(); - console.log(start_date,'-----------------event detail start date------------------') - console.log(end_date,'-----------------event detail end date------------------') + console.log( + start_date, + "-----------------event detail start date------------------" + ); + console.log( + end_date, + "-----------------event detail end date------------------" + ); useEffect(() => { LogBox.ignoreAllLogs(); // requestLocationPermission(); @@ -153,7 +159,7 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { if (eventData) { setEventDetails(eventData); setEventImageDisplay(eventData?.event_image); - setEventImage(eventData?.event_image_id) + setEventImage(eventData?.event_image_id); } } else { setEventDetails({ @@ -222,7 +228,6 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { } } - const onBackPress = () => { navigation?.goBack(); }; @@ -259,20 +264,19 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { }; const onCreateEvent = async () => { - var getTicket:any = []; - if(tickets?.length){ - console.log('is ticket',tickets?.length) - getTicket = tickets?.map((ele) => ele?.id ?? ""); - var ticketArray = getTicket.join(",") + var getTicket: any = []; + if (tickets?.length) { + console.log("is ticket", tickets?.length); + getTicket = tickets?.map((ele) => ele?.id ?? ""); + var ticketArray = getTicket.join(","); } else { - console.log('not is ticket') - var ticketArray:any = '' + console.log("not is ticket"); + var ticketArray: any = ""; } LodingData(true); Keyboard.dismiss(); - const res = await createEvent( - { + const res = await createEvent({ bodyParams: { ...eventDetails, tickets: ticketArray, @@ -282,7 +286,7 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { type: setFilter, }, }); - console.log(res) + console.log(res); if (res?.success) { LodingData(false); navigation?.goBack(); @@ -292,30 +296,30 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { }; const onUpdateEvent = async () => { - var getTicket:any = tickets?.map((ele) => ele?.id ?? ""); + var getTicket: any = tickets?.map((ele) => ele?.id ?? ""); LodingData(true); Keyboard.dismiss(); let request = {}; // if (name !== eventData?.name) { - request = { ...request, name }; + request = { ...request, name }; // } // if (address !== eventData?.address) { - request = { ...request, address }; + request = { ...request, address }; // } // if (full_address !== eventData?.full_address) { - request = { ...request, full_address }; + request = { ...request, full_address }; // } // if (start_date !== eventData?.start_date) { - request = { ...request, startDate: start_date.toString() }; + request = { ...request, startDate: start_date.toString() }; // } // if (end_date !== eventData?.end_date) { - request = { ...request, endDate: end_date.toString() }; + request = { ...request, endDate: end_date.toString() }; // } // if (email_confirmation_body !== eventData?.email_confirmation_body) { - request = { ...request, emailConfirmationBody: email_confirmation_body }; + request = { ...request, emailConfirmationBody: email_confirmation_body }; // } // if (about !== eventData?.about) { - request = { ...request, about: about }; + request = { ...request, about: about }; // } request = { ...request, latitude: lat?.toString() }; request = { ...request, longitude: long?.toString() }; @@ -393,7 +397,7 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { maxHeight: 800, }); if (assets) { - const img = assets?.[0]; + const img = assets?.[0]; var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = @@ -422,7 +426,7 @@ export const AdminToolsScreen = (props: AdminToolsScreenProps) => { const dataItem = await response.json(); LodingData(false); setEventImage(dataItem?.data?.key); - setEventImageDisplay(dataItem?.data?.imageUrl) + setEventImageDisplay(dataItem?.data?.imageUrl); console.log(dataItem); } catch (error) { LodingData(false); diff --git a/src/screens/admin-tools/style.ts b/src/screens/admin-tools/style.ts index c7540dd65..b29e9e753 100644 --- a/src/screens/admin-tools/style.ts +++ b/src/screens/admin-tools/style.ts @@ -1,7 +1,7 @@ -import { width } from '@theme/device/device'; -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -16,24 +16,24 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, marginBottom: verticalScale(5), }, - + noAttendee: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, color: theme.colors.black, marginBottom: verticalScale(5), - alignSelf: 'center', + alignSelf: "center", marginTop: verticalScale(30), }, pillContainer: { - alignSelf: 'center', + alignSelf: "center", marginTop: -verticalScale(22), - paddingBottom:15, + paddingBottom: 15, }, checkIn: { - justifyContent: 'center', + justifyContent: "center", width: normalScale(300), - alignSelf: 'center', + alignSelf: "center", marginBottom: verticalScale(10), }, innerContainer: { @@ -44,7 +44,7 @@ export const createStyleSheet = (theme: ThemeProps) => { // flex:1 }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(10), }, center: { @@ -65,8 +65,8 @@ export const createStyleSheet = (theme: ThemeProps) => { elevation: 5, height: normalScale(58), width: normalScale(58), - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, calendarTime: { height: normalScale(40), @@ -96,7 +96,7 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.yellow, height: normalScale(58), width: normalScale(58), - marginTop:10 + marginTop: 10, }, pinWhite: { height: normalScale(30), @@ -107,11 +107,11 @@ export const createStyleSheet = (theme: ThemeProps) => { }, profile: { height: normalScale(144), - width: '100%', + width: "100%", // marginTop: verticalScale(11), }, add: { - position: 'absolute', + position: "absolute", top: verticalScale(20), left: normalScale(10), }, @@ -123,7 +123,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, marginTop: { marginTop: verticalScale(10), - alignItems: 'center', + alignItems: "center", marginBottom: verticalScale(16), }, tickets: { @@ -140,10 +140,10 @@ export const createStyleSheet = (theme: ThemeProps) => { // fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font24,color: theme.colors.black,paddingHorizontal: normalScale(16),alignSelf: 'center' // }, rowOnly: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginBottom: verticalScale(8), - alignItems: 'center', + alignItems: "center", }, ticket: { fontFamily: theme.fontType.regular, @@ -167,8 +167,8 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, }, dateView: { - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", borderColor: theme.colors.lightGrey, borderWidth: theme.borderWidth.borderWidth1, paddingVertical: verticalScale(10), @@ -181,8 +181,8 @@ export const createStyleSheet = (theme: ThemeProps) => { marginRight: normalScale(3), }, rowData: { - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", }, startLabel: { fontFamily: theme.fontType.regular, @@ -196,7 +196,7 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: normalScale(3), }, bottomButton: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, @@ -205,19 +205,19 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingBottom: verticalScale(20), paddingTop: verticalScale(5), }, - profilePic:{ + profilePic: { height: 50, width: 50, borderRadius: normalScale(50), }, profileView: { // marginTop: verticalScale(10), - alignSelf: 'flex-end', - position:'absolute', - right:5, - bottom:10 + alignSelf: "flex-end", + position: "absolute", + right: 5, + bottom: 10, }, - cancleEventBtn:{ + cancleEventBtn: { marginHorizontal: 20, backgroundColor: theme.colors.white, borderRadius: theme.borderRadius.radius14, @@ -225,23 +225,22 @@ export const createStyleSheet = (theme: ThemeProps) => { shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, shadowRadius: theme.borderRadius.radius8, - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth2, - color:theme.colors.black, + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth2, + color: theme.colors.black, shadowOffset: { - width: 0, height: verticalScale(0), }, elevation: 5, paddingHorizontal: normalScale(10), - marginTop:12 + marginTop: 12, }, - cancleEventText:{ - fontSize:14, - textAlign:'center', - color:theme.colors.black + cancleEventText: { + fontSize: 14, + textAlign: "center", + color: theme.colors.black, }, payoutDescLbl: { fontFamily: theme.fontType.light, @@ -256,7 +255,7 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.lightgrayTwo, borderRadius: theme.borderRadius.radius6, marginBottom: 10, - height: 60 + height: 60, }, HeaderContainerTwo: { @@ -267,30 +266,30 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 52, left: 10, height: normalScale(35), width: normalScale(35), - zIndex:11111222222, - paddingLeft:4, - paddingTop:4 + zIndex: 11111222222, + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, color: theme.colors.white, - zIndex:11111222 + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -298,46 +297,46 @@ export const createStyleSheet = (theme: ThemeProps) => { marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 10, - bottom: 25 + bottom: 25, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, - bottom:50, + bottom: 50, zIndex: 11111122, - borderRadius:100 + borderRadius: 100, }, profileImage: { height: normalScale(55), @@ -345,15 +344,14 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, - payInput: { backgroundColor: theme.colors.lightgrayTwo, borderRadius: 10, @@ -361,8 +359,8 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: 10, paddingHorizontal: 10, height: 35, - justifyContent: 'center', - color: theme.colors.black + justifyContent: "center", + color: theme.colors.black, }, whoCont: { fontFamily: theme.fontType.light, @@ -371,15 +369,15 @@ export const createStyleSheet = (theme: ThemeProps) => { marginTop: 8, }, payModalContainer: { - flexDirection: 'row', + flexDirection: "row", marginVertical: 8, }, TypeModalContainer: { - flexDirection: 'row', - marginTop: 8 + flexDirection: "row", + marginTop: 8, }, typeDisplayCont: { - flexDirection: 'row', + flexDirection: "row", }, typeLbl: { fontFamily: theme.fontType.light, @@ -390,9 +388,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingHorizontal: 10, paddingVertical: 1, borderWidth: 1, - borderColor: 'lightGrey', + borderColor: "lightGrey", marginHorizontal: 8, - fontWeight: '500', + fontWeight: "500", }, typeLblTwo: { fontFamily: theme.fontType.light, @@ -400,7 +398,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font14, paddingVertical: 1, paddingHorizontal: 10, - fontWeight: '500', + fontWeight: "500", }, typeCont: { fontFamily: theme.fontType.light, @@ -419,12 +417,10 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 35, // height: 20, // backgroundColor: theme.colors.lightgrayTwo, - textAlign: 'left', + textAlign: "left", fontWeight: "400", - justifyContent: 'flex-start', + justifyContent: "flex-start", paddingVertical: 0, - - }, dollarIcon: { fontFamily: theme.fontType.light, @@ -433,8 +429,8 @@ export const createStyleSheet = (theme: ThemeProps) => { // textAlign: 'center' }, descriptionCont: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginVertical: 5, paddingVertical: 3, marginRight: 5, @@ -446,13 +442,13 @@ export const createStyleSheet = (theme: ThemeProps) => { }, breakDownCont: { // height: 200 - flex: 1 + flex: 1, }, dateCont: { fontFamily: theme.fontType.light, color: theme.colors.black, fontSize: theme.fontSize.font14, - textAlign: 'right', + textAlign: "right", }, // mediaCont: { // flexDirection: 'row', @@ -485,23 +481,23 @@ export const createStyleSheet = (theme: ThemeProps) => { uniqueViewCont: { marginHorizontal: 20, width: 100, - marginBottom: 20 + marginBottom: 20, }, uniqueViewLbl: { - alignSelf: 'center', + alignSelf: "center", fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, }, uniqueCount: { - alignSelf: 'center', + alignSelf: "center", fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, }, cancelEventCont: { - flexDirection: 'row', - justifyContent: 'flex-end', + flexDirection: "row", + justifyContent: "flex-end", marginHorizontal: 14, marginVertical: 12, }, @@ -526,13 +522,13 @@ export const createStyleSheet = (theme: ThemeProps) => { marginBottom: 6, }, revenueCont: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", borderBottomWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.lightGrey, paddingVertical: 4, marginHorizontal: 20, - marginBottom:15 + marginBottom: 15, }, revenueLbl: { fontFamily: theme.fontType.regular, @@ -546,8 +542,8 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingRight: 4, }, payoutCont: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", borderBottomWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.lightGrey, paddingVertical: 4, @@ -555,8 +551,8 @@ export const createStyleSheet = (theme: ThemeProps) => { marginTop: 20, }, payoutContainer: { - flexDirection: 'row', - justifyContent: 'flex-end', + flexDirection: "row", + justifyContent: "flex-end", marginTop: 8, marginHorizontal: 8, }, @@ -572,17 +568,17 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 26, }, payoutsubContainer: { - flexDirection: 'row', - backgroundColor: '#8058AE', - justifyContent: 'center', + flexDirection: "row", + backgroundColor: "#8058AE", + justifyContent: "center", borderRadius: theme.borderRadius.radius8, height: 30, - alignItems: 'center', + alignItems: "center", paddingHorizontal: 4, }, payOutDetailsCont: { - flexDirection: 'row', - justifyContent: 'flex-end', + flexDirection: "row", + justifyContent: "flex-end", marginTop: 5, }, payoutDetailsLbl: { @@ -614,7 +610,7 @@ export const createStyleSheet = (theme: ThemeProps) => { // backgroundColor: 'red' }, detailsSubCont: { - flexDirection: 'row', + flexDirection: "row", // backgroundColor: 'green' }, userImage: { @@ -623,11 +619,11 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: 100, marginTop: 8, }, - editIcon:{ + editIcon: { height: 16, width: 16, marginTop: 12, - marginRight:5 + marginRight: 5, }, userNameCont: { width: width - 200, @@ -653,12 +649,12 @@ export const createStyleSheet = (theme: ThemeProps) => { marginHorizontal: 20, }, subAddItemCont: { - flexDirection: 'row', - backgroundColor: '#DCB16C', - justifyContent: 'center', + flexDirection: "row", + backgroundColor: "#DCB16C", + justifyContent: "center", borderRadius: theme.borderRadius.radius6, height: 28, - alignItems: 'center', + alignItems: "center", paddingHorizontal: 4, }, plusIcon: { @@ -679,8 +675,8 @@ export const createStyleSheet = (theme: ThemeProps) => { marginVertical: 8, }, rupeesCont: { - flexDirection: 'row', - justifyContent: 'flex-end', + flexDirection: "row", + justifyContent: "flex-end", marginHorizontal: 40, }, rupeesLbl: { @@ -688,7 +684,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, marginTop: -4, - fontWeight: '500', + fontWeight: "500", }, totalRupeesLbl: { color: theme.colors.black, @@ -697,9 +693,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingTop: 5, }, toggleContainer: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", marginVertical: 10, }, @@ -711,7 +707,7 @@ export const createStyleSheet = (theme: ThemeProps) => { switchToggle: {}, avatarContainer: { marginLeft: 20, - marginRight: 20, + marginRight: 20, }, avatarImage: { height: 60, @@ -725,9 +721,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingBottom: 10, borderColor: theme.colors.gray, flex: 1, - borderRadius:16, - borderWidth:2, - margin:16 + borderRadius: 16, + borderWidth: 2, + margin: 16, }, keyboardViewTwo: { // position: 'absolute', @@ -746,51 +742,50 @@ export const createStyleSheet = (theme: ThemeProps) => { // backgroundColor: theme.colors.purple, // borderRadius: 6 // }, - submitLbl:{ + submitLbl: { fontFamily: theme.fontType.medium, color: theme.colors.white, fontSize: theme.fontSize.font16, - textAlign: 'center', - + textAlign: "center", }, - multipleImagecont:{ + multipleImagecont: { flex: 1, - flexDirection:'row', + flexDirection: "row", // width : '100%', - flexWrap: 'wrap', - }, - // selectImage:{ - // height:90, - // width:'30%', - // borderRadius:18, - // marginRight:10, - // }, - ticketTitle: { - fontFamily: theme.fontType.regular, - fontSize: theme.fontSize.font24, - color: theme.colors.black, - paddingHorizontal: normalScale(16), - alignSelf: "center", - }, - amountCont: { - flexDirection: "row", - justifyContent: "space-between", - marginRight: 25, - marginTop: 5, - borderBottomWidth: 1, - borderColor: "#A9A9A9", - paddingVertical: 3, - }, - dollarSign: { - fontFamily: theme.fontType.light, - color: theme.colors.black, - fontSize: theme.fontSize.font14, - borderWidth: 1, - borderColor: "lightGrey", - borderRadius: 50, - // padding: 5, - }, - priceContainerTwo: {}, + flexWrap: "wrap", + }, + // selectImage:{ + // height:90, + // width:'30%', + // borderRadius:18, + // marginRight:10, + // }, + ticketTitle: { + fontFamily: theme.fontType.regular, + fontSize: theme.fontSize.font24, + color: theme.colors.black, + paddingHorizontal: normalScale(16), + alignSelf: "center", + }, + amountCont: { + flexDirection: "row", + justifyContent: "space-between", + marginRight: 25, + marginTop: 5, + borderBottomWidth: 1, + borderColor: "#A9A9A9", + paddingVertical: 3, + }, + dollarSign: { + fontFamily: theme.fontType.light, + color: theme.colors.black, + fontSize: theme.fontSize.font14, + borderWidth: 1, + borderColor: "lightGrey", + borderRadius: 50, + // padding: 5, + }, + priceContainerTwo: {}, priceContainer: { borderRadius: 100, @@ -833,8 +828,8 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, fontSize: theme.fontSize.font14, textAlign: "center", - width:'100%', - paddingRight:70, + width: "100%", + paddingRight: 70, }, selectImage: { height: 90, @@ -842,13 +837,13 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 90, borderRadius: 18, marginRight: 10, - marginTop: 12 + marginTop: 12, }, submitButton: { flexDirection: "row", justifyContent: "flex-end", marginHorizontal: 20, - marginTop: 10 + marginTop: 10, }, saveIcon: { marginTop: 3, @@ -858,27 +853,26 @@ export const createStyleSheet = (theme: ThemeProps) => { deleteIcon: { height: 25, width: 20, - marginLeft: 8 + marginLeft: 8, }, - modalContainerTwo: { flex: 1, - alignItems: 'center', - position: 'absolute', + alignItems: "center", + position: "absolute", bottom: 0, margin: 0, padding: 0, - backgroundColor: 'white', - width: '100%' + backgroundColor: "white", + width: "100%", }, - modalView: { + modalView: { marginVertical: 40, - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 18, padding: 20, - alignItems: 'center', - shadowColor: '#000', + alignItems: "center", + shadowColor: "#000", shadowOpacity: 0.25, shadowRadius: 4, elevation: 5, @@ -886,29 +880,29 @@ export const createStyleSheet = (theme: ThemeProps) => { sendPayoutLblTwo: { marginTop: 16, fontSize: 18, - color: 'black', - fontWeight: '500', + color: "black", + fontWeight: "500", }, sendingTextLbl: { fontSize: 12, - color: 'black', - fontWeight: '500', - marginVertical: 2 + color: "black", + fontWeight: "500", + marginVertical: 2, }, payoutButtonCont: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", height: 40, - backgroundColor: '#007112', + backgroundColor: "#007112", borderRadius: 14, - marginTop: 24, - width:160 + marginTop: 24, + width: 160, }, - + sendPayoutButton: { - color: 'white', - textAlign: 'center', - alignSelf: 'center', + color: "white", + textAlign: "center", + alignSelf: "center", fontSize: 14, width: 130, }, @@ -916,24 +910,24 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 26, width: 26, borderRadius: 100, - textAlign: 'center', - alignSelf: 'center', + textAlign: "center", + alignSelf: "center", marginRight: 6, }, cancelButtonCont: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", height: 40, - backgroundColor: '#710000', + backgroundColor: "#710000", borderRadius: 14, - marginTop: 12, - width:160 + marginTop: 12, + width: 160, }, gesture: { flex: 1, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, @@ -948,7 +942,7 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), backgroundColor: theme.colors.white, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), shadowColor: theme.colors.darkGrey, shadowOffset: { width: 1, height: 2 }, @@ -963,7 +957,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, flex: { flex: 1, - overflow:'hidden', + overflow: "hidden", }, dateText: { fontFamily: theme.fontType.light, @@ -977,7 +971,7 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, marginBottom: verticalScale(7), maxWidth: normalScale(200), - flexShrink:1 + flexShrink: 1, }, eventTwo: { height: normalScale(32), @@ -985,7 +979,7 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: normalScale(12), }, rowTwo: { - flexDirection: 'row', + flexDirection: "row", flex: 1, }, pin: { @@ -997,7 +991,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - flexShrink:1 + flexShrink: 1, }, fullAddress: { fontFamily: theme.fontType.light, @@ -1006,16 +1000,17 @@ export const createStyleSheet = (theme: ThemeProps) => { }, addressDot: { height: 6, - width: 6, marginVertical: 5, - marginHorizontal: 5 - }, - cancleText:{ - position:'absolute', - right:0, - top:35, - fontFamily:theme.fontType.medium, - fontSize:theme.fontSize.font14, - color:theme.colors.redTwo - } + width: 6, + marginVertical: 5, + marginHorizontal: 5, + }, + cancleText: { + position: "absolute", + right: 0, + top: 35, + fontFamily: theme.fontType.medium, + fontSize: theme.fontSize.font14, + color: theme.colors.redTwo, + }, }); }; diff --git a/src/screens/chat/index.tsx b/src/screens/chat/index.tsx index 3700cc1e7..845ead6f7 100644 --- a/src/screens/chat/index.tsx +++ b/src/screens/chat/index.tsx @@ -1,6 +1,6 @@ -import React, {useCallback, useEffect, useRef, useState} from 'react'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; +import React, { useCallback, useEffect, useRef, useState } from "react"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; import { ActivityIndicator, FlatList, @@ -14,9 +14,9 @@ import { TextInput, TouchableOpacity, View, -} from 'react-native'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {ImageComponent} from '@components/image-component'; +} from "react-native"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ImageComponent } from "@components/image-component"; import { Gratis, Search, @@ -48,42 +48,42 @@ import { postCalender, request, send, -} from '@assets/images'; -import {useDispatch, useSelector} from 'react-redux'; -import {StoreType} from '@network/reducers/store'; +} from "@assets/images"; +import { useDispatch, useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; import { UserProfileState, onSetUser, -} from '@network/reducers/user-profile-reducer'; +} from "@network/reducers/user-profile-reducer"; import { useUserProfile, userProfileParsedData, -} from '@network/hooks/user-service-hooks/use-user-profile'; +} from "@network/hooks/user-service-hooks/use-user-profile"; import { NavigationContainerRef, ParamListBase, useFocusEffect, -} from '@react-navigation/native'; -import {navigations} from '@config/app-navigation/constant'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import {ScrollView} from 'react-native-gesture-handler'; -import {DatePickerModal, TimePickerModal} from 'react-native-paper-dates'; -import moment from 'moment'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; -import GetLocation from 'react-native-get-location'; -import {Loader} from '@components/loader'; -import Popover, {PopoverPlacement, Rect} from 'react-native-popover-view'; -import {SizedBox} from '@components/sized-box'; -import {verticalScale} from '@theme/device/normalize'; +} from "@react-navigation/native"; +import { navigations } from "@config/app-navigation/constant"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { ScrollView } from "react-native-gesture-handler"; +import { DatePickerModal, TimePickerModal } from "react-native-paper-dates"; +import moment from "moment"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import GetLocation from "react-native-get-location"; +import { Loader } from "@components/loader"; +import Popover, { PopoverPlacement, Rect } from "react-native-popover-view"; +import { SizedBox } from "@components/sized-box"; +import { verticalScale } from "@theme/device/normalize"; import { DatePickerRefProps, DateRangePicker, -} from '@components/date-range-picker'; -import {launchImageLibrary} from 'react-native-image-picker'; -import {GooglePlacesAutocomplete} from 'react-native-google-places-autocomplete'; -import Toast from 'react-native-simple-toast'; -import GestureRecognizer from 'react-native-swipe-gestures'; -import {Result} from '@network/hooks/home-service-hooks/use-event-lists'; +} from "@components/date-range-picker"; +import { launchImageLibrary } from "react-native-image-picker"; +import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; +import Toast from "react-native-simple-toast"; +import GestureRecognizer from "react-native-swipe-gestures"; +import { Result } from "@network/hooks/home-service-hooks/use-event-lists"; interface ChatScreenProps { navigation: NavigationContainerRef; @@ -95,13 +95,13 @@ interface Range { } export const ChatScreen = (props: ChatScreenProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); -return( - - - -) + return ( + + + + ); }; diff --git a/src/screens/chat/style.ts b/src/screens/chat/style.ts index 9263f8025..e3068f79b 100644 --- a/src/screens/chat/style.ts +++ b/src/screens/chat/style.ts @@ -1,15 +1,15 @@ -import { height, width } from '@theme/device/device'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { borderRadius } from '@theme/fonts'; -import { ThemeProps } from '@theme/theme'; -import { StyleSheet } from 'react-native'; +import { height, width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { borderRadius } from "@theme/fonts"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ container: { - justifyContent: 'center', + justifyContent: "center", backgroundColor: theme.colors.white, - alignItems: 'center', + alignItems: "center", flex: 1, }, text: { @@ -25,29 +25,28 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 45, left: 10, height: normalScale(30), width: normalScale(30), - zIndex: 11111222222 + zIndex: 11111222222, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 40, color: theme.colors.white, - zIndex: 11111222 - + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -61,44 +60,44 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, fontFamily: theme.fontType.regular, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 25 + bottom: 25, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -106,16 +105,16 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, container2: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), paddingLeft: 11, - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), shadowColor: theme.colors.black, @@ -131,7 +130,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, elevation: 5, // position:'absolute', - top: -20 + top: -20, }, icon1: { height: normalScale(30), @@ -141,33 +140,33 @@ export const createStyleSheet = (theme: ThemeProps) => { label1: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#197127' + color: "#197127", // justifyContent: 'center', // alignItems: 'center', }, label1Service: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#0081D2' + color: "#0081D2", }, label1Event: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#B10E00' + color: "#B10E00", }, filterTags: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, avatarImage: { height: 60, width: 60, borderRadius: 100, - marginLeft: 10 + marginLeft: 10, }, avatarContainer: { marginLeft: 20, - marginRight: 20 + marginRight: 20, }, avatar: { height: 40, @@ -176,30 +175,29 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: 10, }, postInput: { - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 22, width: width - 90, marginLeft: 10, paddingHorizontal: 10, - justifyContent:'center', + justifyContent: "center", fontFamily: theme.fontType.regular, - }, postContainer: { marginVertical: 10, - flexDirection: 'row', + flexDirection: "row", }, postFilter: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, container3: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), width: 110, @@ -209,7 +207,6 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - }, label2: { fontFamily: theme.fontType.regular, @@ -221,7 +218,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font14, color: theme.colors.green, }, - label4:{ + label4: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, @@ -230,7 +227,7 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.white, margin: 10, borderRadius: 12, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -242,9 +239,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), backgroundColor: theme.colors.lightRed, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), - marginHorizontal: 10 + marginHorizontal: 10, }, dummy: { width: normalScale(80), @@ -275,56 +272,56 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginLeft: normalScale(10), }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: 10, }, pin: { height: normalScale(14), width: normalScale(14), marginRight: normalScale(8), - marginTop:6 + marginTop: 6, }, location: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, fullAddress: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, addressDot: { height: 6, - width: 6, - marginTop:10, - marginHorizontal: 5 + width: 6, + marginTop: 10, + marginHorizontal: 5, }, sposerLabel: { - position: 'absolute', + position: "absolute", right: -32, top: 30, - zIndex: 11112222 + zIndex: 11112222, }, gretitude: { height: 20, width: 20, - position: 'absolute', + position: "absolute", right: 12, - bottom: 5 + bottom: 5, }, dateContainer: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", marginTop: verticalScale(10), marginHorizontal: 10, padding: 10, borderRadius: 12, backgroundColor: theme.colors.white, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -344,11 +341,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(8), }, posttitle: { - textAlign: 'center', - color: '#007112', + textAlign: "center", + color: "#007112", fontSize: 16, fontFamily: theme.fontType.regular, - marginTop:3 + marginTop: 3, }, feedContainer: { marginHorizontal: 10, @@ -357,7 +354,7 @@ export const createStyleSheet = (theme: ThemeProps) => { borderWidth: 3, borderRadius: 8, paddingBottom: 14, - overflow:'hidden' + overflow: "hidden", }, postfilterImage: { height: 22, @@ -368,12 +365,12 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 35, borderRadius: 100, marginRight: 10, - alignItems: 'center', - marginTop: 1 + alignItems: "center", + marginTop: 1, }, userDetailcont: { marginHorizontal: 10, - flexDirection: 'row', + flexDirection: "row", }, userName: { color: theme.colors.black, @@ -386,26 +383,26 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, postDes: { - textAlign: 'left', + textAlign: "left", color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, marginHorizontal: 15, marginVertical: 10, - lineHeight:20 + lineHeight: 20, }, userPost: { height: 500, - width: 'auto', + width: "auto", marginHorizontal: 10, marginBottom: 20, - borderRadius: 10 + borderRadius: 10, }, scrollViewStyle: { paddingBottom: verticalScale(100), }, - scrollView: { - // flex:1 + scrollView: { + // flex:1 paddingBottom: verticalScale(100), // paddingHorizontal: normalScale(22), }, @@ -413,17 +410,17 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, - marginRight: 5 + marginRight: 5, }, postDetailCont: { - flexDirection: 'row', + flexDirection: "row", marginHorizontal: 20, - marginBottom: 5 + marginBottom: 5, }, detailImage: { height: 14, width: 14, - marginRight: 8 + marginRight: 8, }, likeCount: { color: theme.colors.black, @@ -433,7 +430,7 @@ export const createStyleSheet = (theme: ThemeProps) => { commentImage: { height: 14, width: 14, - marginLeft:5 + marginLeft: 5, }, msgCount: { color: theme.colors.black, @@ -441,52 +438,52 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, commentTitle: { - flexDirection: 'row', - justifyContent: 'space-between', - marginHorizontal: 13 + flexDirection: "row", + justifyContent: "space-between", + marginHorizontal: 13, }, commentCont: { - flexDirection: 'row' + flexDirection: "row", }, commentContTwo: { - flexDirection: 'row', - justifyContent: 'space-evenly', - alignItems: 'center', - paddingTop:2, - paddingBottom:2 + flexDirection: "row", + justifyContent: "space-evenly", + alignItems: "center", + paddingTop: 2, + paddingBottom: 2, }, commentImgTwo: { height: 23, - width: 23 + width: 23, }, commentContShow: { fontSize: 12, - color: '#000000', + color: "#000000", marginHorizontal: 13, - marginTop: 2 + marginTop: 2, }, commentImgProfile: { marginLeft: 16, marginRight: 30, - flexDirection: 'row', - justifyContent: 'flex-start', - marginVertical:6, - overflow:'hidden' + flexDirection: "row", + justifyContent: "flex-start", + marginVertical: 6, + overflow: "hidden", }, commentDisplayCont: { - backgroundColor: '#E6E6E6', + backgroundColor: "#E6E6E6", borderWidth: 2, - borderColor: '#C2DBC6', - height: 'auto', + borderColor: "#C2DBC6", + height: "auto", borderRadius: 20, width: 230, paddingHorizontal: 10, paddingTop: 6, - paddingBottom: 6 + paddingBottom: 6, }, replyMsgCont: { fontSize: 12, - color: '#110101', + color: "#110101", paddingTop: 2, paddingLeft: 14, }, @@ -495,158 +492,158 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 24, }, replyContainer: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 80, marginTop: 2, }, replyLbl: { fontSize: 12, marginLeft: 10, - marginTop: 4 + marginTop: 4, }, minuteCont: { fontSize: 12, marginLeft: 16, - marginTop: 4 + marginTop: 4, }, commentImgProfileTwo: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 20, - justifyContent:'center', + justifyContent: "center", marginTop: 2, - overflow:'hidden' + overflow: "hidden", }, replyContainerTwo: { - flexDirection: 'row', - justifyContent:'center', + flexDirection: "row", + justifyContent: "center", marginLeft: 30, // marginLeft: 145, - marginVertical:10, + marginVertical: 10, // marginTop: 2, }, replyIcon: { height: 9, width: 10, marginTop: 6, - marginRight: 4 + marginRight: 4, }, replyMoreLbl: { fontSize: 12, - marginTop: 4, - marginRight: 50 + marginTop: 4, + marginRight: 50, }, - textOne:{ + textOne: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - createPostModal:{ + createPostModal: { borderTopRightRadius: 24, borderTopLeftRadius: 24, paddingVertical: verticalScale(20), - paddingHorizontal:8, + paddingHorizontal: 8, borderColor: theme.colors.lightGreen, - backgroundColor: 'rgba(255, 255, 255, 0.4)', + backgroundColor: "rgba(255, 255, 255, 0.4)", borderTopWidth: 4, borderLeftWidth: 4, borderRightWidth: 4, marginHorizontal: 7, // flex: 1 }, - createPostCont:{ - flexDirection:'row', - alignItems:'center' + createPostCont: { + flexDirection: "row", + alignItems: "center", }, postInputTwo: { - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 10, width: width - 200, marginLeft: 10, paddingHorizontal: 10, - height:35, - justifyContent:'center' - }, - createImgOne:{ - height:20, - width:20, - marginRight:5 - }, - quntitiyInput:{ - width:90, - height:30, - backgroundColor:'lightgray', - borderRadius:12, - paddingHorizontal:5 - }, - quntitiyCont:{ - flexDirection:'row', - marginTop:10, - marginBottom:10, - alignItems:'center', - marginLeft:50 - }, - postCont:{ - marginTop:10 - }, - postinput:{ - height:160, - marginTop:5, - backgroundColor:'lightgray', - borderRadius:12, - paddingHorizontal:5 - }, - tagCont:{ - marginTop:10, - flexDirection:'row', - alignItems:'center' - }, - tagInput:{ - height:30, - backgroundColor:'lightgray', - width:200, - borderRadius:12, - paddingHorizontal:5, - marginLeft:10 - }, - imagesCont:{ - flexDirection:'row', - marginTop:10 - }, - textTwo:{ + height: 35, + justifyContent: "center", + }, + createImgOne: { + height: 20, + width: 20, + marginRight: 5, + }, + quntitiyInput: { + width: 90, + height: 30, + backgroundColor: "lightgray", + borderRadius: 12, + paddingHorizontal: 5, + }, + quntitiyCont: { + flexDirection: "row", + marginTop: 10, + marginBottom: 10, + alignItems: "center", + marginLeft: 50, + }, + postCont: { + marginTop: 10, + }, + postinput: { + height: 160, + marginTop: 5, + backgroundColor: "lightgray", + borderRadius: 12, + paddingHorizontal: 5, + }, + tagCont: { + marginTop: 10, + flexDirection: "row", + alignItems: "center", + }, + tagInput: { + height: 30, + backgroundColor: "lightgray", + width: 200, + borderRadius: 12, + paddingHorizontal: 5, + marginLeft: 10, + }, + imagesCont: { + flexDirection: "row", + marginTop: 10, + }, + textTwo: { color: theme.colors.black, fontSize: 15, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - textThree:{ - color: 'lightgray', + textThree: { + color: "lightgray", fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' - }, - multipleImagecont:{ - flexDirection:'row' - }, - selectImage:{ - height:80, - width:100, - borderRadius:12, - marginRight:10, - marginTop:15 - }, - postClass:{ - borderColor:'green', - borderWidth:2, - borderRadius:10, - padding:10, - margin:10 + marginRight: 5, + fontWeight: "600", + }, + multipleImagecont: { + flexDirection: "row", + }, + selectImage: { + height: 80, + width: 100, + borderRadius: 12, + marginRight: 10, + marginTop: 15, + }, + postClass: { + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + padding: 10, + margin: 10, }, purchaseContainer: { - backgroundColor: '#007112', + backgroundColor: "#007112", borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(14), shadowColor: theme.colors.black, @@ -657,11 +654,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), - marginHorizontal: 45 + marginHorizontal: 45, }, titleTwo: { fontFamily: theme.fontType.medium, @@ -673,87 +670,87 @@ export const createStyleSheet = (theme: ThemeProps) => { width: normalScale(30), marginLeft: normalScale(10), }, - gratiescontainer:{ - height:180, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - bottom:15, - margin:16, - padding:10 - }, - gratiesTitle:{ + gratiescontainer: { + height: 180, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + bottom: 15, + margin: 16, + padding: 10, + }, + gratiesTitle: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font16, color: theme.colors.black, - marginBottom:10, - textAlign:'center' + marginBottom: 10, + textAlign: "center", }, - gratisimg:{ - height:45, - width:45 + gratisimg: { + height: 45, + width: 45, }, - gratistext:{ + gratistext: { fontFamily: theme.fontType.bold, fontSize: theme.fontSize.font36, color: theme.colors.black, - fontWeight:'600', - marginLeft:10 - }, - gratisCont:{ - flexDirection:'row', - justifyContent:'center', - alignItems:'center', - marginVertical:10 - }, - commentInput:{ - height:40, - width:width-90, - backgroundColor:'lightgray', - borderRadius:12, - paddingVertical:5, - marginVertical:10, - marginHorizontal:10, - padding:10 - }, - commentContainer:{ - height:200, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - margin:20, - padding:10, + fontWeight: "600", + marginLeft: 10, + }, + gratisCont: { + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + marginVertical: 10, + }, + commentInput: { + height: 40, + width: width - 90, + backgroundColor: "lightgray", + borderRadius: 12, + paddingVertical: 5, + marginVertical: 10, + marginHorizontal: 10, + padding: 10, + }, + commentContainer: { + height: 200, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + margin: 20, + padding: 10, // justifyContent:'center' }, - createPostContTwo:{ - flexDirection:'row', - alignItems : 'flex-start' + createPostContTwo: { + flexDirection: "row", + alignItems: "flex-start", }, - textTwoWhere:{ + textTwoWhere: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600', - paddingTop : 9 + marginRight: 5, + fontWeight: "600", + paddingTop: 9, }, - createImgTwo:{ - height:20, - width:20, - marginTop : 8, - marginRight:5 + createImgTwo: { + height: 20, + width: 20, + marginTop: 8, + marginRight: 5, }, keyboardView: { - position: 'absolute', + position: "absolute", // top:650, bottom: 0, left: 0, right: 0, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, diff --git a/src/screens/check-in/check-in-list.tsx b/src/screens/check-in/check-in-list.tsx index d4d505d13..984424b44 100644 --- a/src/screens/check-in/check-in-list.tsx +++ b/src/screens/check-in/check-in-list.tsx @@ -43,8 +43,10 @@ export const CheckInList = (props: CheckInListProps) => { /> - - + + {is_app_user ? `${user?.first_name} ${user?.last_name}` : user?.name} @@ -52,10 +54,11 @@ export const CheckInList = (props: CheckInListProps) => { {`$${ticket_total_price}`} - {event?.name} + + {event?.name} + {ticket_name} - diff --git a/src/screens/check-in/index.tsx b/src/screens/check-in/index.tsx index ab2f0dae9..7f8c19d9a 100644 --- a/src/screens/check-in/index.tsx +++ b/src/screens/check-in/index.tsx @@ -1,28 +1,31 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import React, { useEffect, useState } from 'react'; -import { useAppTheme } from '@app-hooks/use-app-theme'; -import { createStyleSheet } from './style'; -import { useStringsAndLabels } from '@app-hooks/use-strings-and-labels'; -import { ListRenderItem, Text, View } from 'react-native'; -import { Header } from '@components/header'; -import { NavigationContainerRef, ParamListBase } from '@react-navigation/native'; -import { Pill } from '@components/pill'; -import { CheckInList } from './check-in-list'; +import React, { useEffect, useState } from "react"; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { createStyleSheet } from "./style"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ListRenderItem, Text, View } from "react-native"; +import { Header } from "@components/header"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import { Pill } from "@components/pill"; +import { CheckInList } from "./check-in-list"; import { Result, useTicketHolderCheckinsList, -} from '@network/hooks/home-service-hooks/use-ticket-holder-checkin-list'; -import { Loader } from '@components/loader'; -import { FlatListComponent } from '@components/flatlist-component'; -import { useCheckedInUser } from '@network/hooks/home-service-hooks/use-checked-in-user'; -import { TouchableOpacity } from 'react-native'; -import { ImageComponent } from '@components/image-component'; -import { TextInput } from 'react-native'; -import { Search, arrowLeft, dummy, onelogo } from '@assets/images'; -import { navigations } from '@config/app-navigation/constant'; -import { useSelector } from 'react-redux'; -import { StoreType } from '@network/reducers/store'; -import { UserProfileState } from '@network/reducers/user-profile-reducer'; +} from "@network/hooks/home-service-hooks/use-ticket-holder-checkin-list"; +import { Loader } from "@components/loader"; +import { FlatListComponent } from "@components/flatlist-component"; +import { useCheckedInUser } from "@network/hooks/home-service-hooks/use-checked-in-user"; +import { TouchableOpacity } from "react-native"; +import { ImageComponent } from "@components/image-component"; +import { TextInput } from "react-native"; +import { Search, arrowLeft, dummy, onelogo } from "@assets/images"; +import { navigations } from "@config/app-navigation/constant"; +import { useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; +import { UserProfileState } from "@network/reducers/user-profile-reducer"; interface CheckInScreenProps { navigation?: NavigationContainerRef; @@ -42,15 +45,15 @@ export const CheckInScreen = (props: CheckInScreenProps) => { const [totalPages, setTotalPages] = useState(0); const [checkInList, setCheckInList] = useState([]); const [page, setPage] = useState(1); - const {user} = useSelector( - state => state.userProfileReducer, - ) as {user: {id: string; pic: string; city: string}}; + const { user } = useSelector( + (state) => state.userProfileReducer + ) as { user: { id: string; pic: string; city: string } }; const { isLoading, isRefetching, refetch } = useTicketHolderCheckinsList({ queryParams: { limit: 10, page }, eventId, }); const { mutateAsync, isLoading: checkedInLoading } = useCheckedInUser(); - const [searchQuery, setSearchQuery] = useState(''); + const [searchQuery, setSearchQuery] = useState(""); const onCheckInUser = async (id: string, index: number, data: Result) => { const request = { @@ -63,13 +66,12 @@ export const CheckInScreen = (props: CheckInScreenProps) => { const tickeHolderCopy = [...checkInList]; const selectedTickeHolder = tickeHolderCopy.filter( - ele => ele?._id === id, + (ele) => ele?._id === id )?.[0]; selectedTickeHolder.isCheckedIn = true; tickeHolderCopy.splice(index, 1, selectedTickeHolder); setCheckInList(tickeHolderCopy); - }; useEffect(() => { @@ -79,7 +81,7 @@ export const CheckInScreen = (props: CheckInScreenProps) => { const getTicketHolderCheckInList = async () => { const res = await refetch(); - setCheckInList(prevData => [ + setCheckInList((prevData) => [ ...prevData, ...(res?.data?.data?.results || []), ]); @@ -113,9 +115,9 @@ export const CheckInScreen = (props: CheckInScreenProps) => { } showOverlay={true} /> - + - + @@ -123,10 +125,11 @@ export const CheckInScreen = (props: CheckInScreenProps) => { + source={onelogo} + > NE - L o c a l + L o c a l {/* [Local] */} @@ -137,7 +140,8 @@ export const CheckInScreen = (props: CheckInScreenProps) => { + style={styles.profileView} + > { return StyleSheet.create({ pillContainer: { - alignSelf: 'center', + alignSelf: "center", marginTop: -verticalScale(15), - paddingBottom:15 + paddingBottom: 15, }, container: { paddingHorizontal: normalScale(20), @@ -31,7 +31,7 @@ export const createStyleSheet = (theme: ThemeProps) => { marginBottom: verticalScale(10), }, rowOnly: { - flexDirection: 'row', + flexDirection: "row", }, imageView: { borderRadius: normalScale(60), @@ -62,25 +62,25 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, marginBottom: verticalScale(2), marginTop: verticalScale(4), - flexShrink:1 + flexShrink: 1, }, pillStyle: { - justifyContent: 'center', + justifyContent: "center", }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, profileView: { // marginTop: verticalScale(10), - alignSelf: 'flex-end', - position:'absolute', - right:5, - bottom:30 + alignSelf: "flex-end", + position: "absolute", + right: 5, + bottom: 30, }, HeaderContainerTwo: { @@ -91,30 +91,30 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 52, left: 10, height: normalScale(30), width: normalScale(30), - zIndex:11111222222, - paddingLeft:4, - paddingTop:4 + zIndex: 11111222222, + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, color: theme.colors.white, - zIndex:11111222 + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -122,46 +122,46 @@ export const createStyleSheet = (theme: ThemeProps) => { marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 10, - bottom: 0 + bottom: 0, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, - bottom:50, + bottom: 50, zIndex: 11111122, - borderRadius:100 + borderRadius: 100, }, profileImage: { height: normalScale(55), diff --git a/src/screens/createEditPost/gratisEdit.tsx b/src/screens/createEditPost/gratisEdit.tsx index ad86f609d..3df6ef1b2 100644 --- a/src/screens/createEditPost/gratisEdit.tsx +++ b/src/screens/createEditPost/gratisEdit.tsx @@ -1,6 +1,6 @@ -import React, {useEffect, useRef, useState} from 'react'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; +import React, { useEffect, useRef, useState } from "react"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; import { Alert, FlatList, @@ -12,9 +12,9 @@ import { TextInput, TouchableOpacity, View, -} from 'react-native'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {ImageComponent} from '@components/image-component'; +} from "react-native"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ImageComponent } from "@components/image-component"; import { Gratis, addGreen, @@ -34,33 +34,36 @@ import { plus, postCalender, request, -} from '@assets/images'; -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import moment from 'moment'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; -import GetLocation from 'react-native-get-location'; -import Popover, {PopoverPlacement, Rect} from 'react-native-popover-view'; -import {SizedBox} from '@components/sized-box'; -import {verticalScale} from '@theme/device/normalize'; +} from "@assets/images"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import moment from "moment"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import GetLocation from "react-native-get-location"; +import Popover, { PopoverPlacement, Rect } from "react-native-popover-view"; +import { SizedBox } from "@components/sized-box"; +import { verticalScale } from "@theme/device/normalize"; import { DatePickerRefProps, DateRangePicker, -} from '@components/date-range-picker'; -import {launchImageLibrary} from 'react-native-image-picker'; -import {GooglePlacesAutocomplete} from 'react-native-google-places-autocomplete'; -import Toast from 'react-native-simple-toast'; -import {Loader} from '@components/loader'; -import {navigations} from '@config/app-navigation/constant'; -import {ScrollView} from 'react-native'; -import {Pill} from '@components/pill'; -import {FlatListComponent} from '@components/flatlist-component'; -import {width} from '@theme/device/device'; -import { API_URL } from '@network/constant'; -import { useSelector } from 'react-redux'; -import { StoreType } from '@network/reducers/store'; -import { UserProfileState } from '@network/reducers/user-profile-reducer'; -import { useUserProfile } from '@network/hooks/user-service-hooks/use-user-profile'; +} from "@components/date-range-picker"; +import { launchImageLibrary } from "react-native-image-picker"; +import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; +import Toast from "react-native-simple-toast"; +import { Loader } from "@components/loader"; +import { navigations } from "@config/app-navigation/constant"; +import { ScrollView } from "react-native"; +import { Pill } from "@components/pill"; +import { FlatListComponent } from "@components/flatlist-component"; +import { width } from "@theme/device/device"; +import { API_URL } from "@network/constant"; +import { useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; +import { UserProfileState } from "@network/reducers/user-profile-reducer"; +import { useUserProfile } from "@network/hooks/user-service-hooks/use-user-profile"; interface EditPostGratisScreenProps { navigation?: NavigationContainerRef; @@ -72,13 +75,13 @@ interface EditPostGratisScreenProps { } export const EditPostGratisScreen = (props: EditPostGratisScreenProps) => { - const {navigation,route} = props || {}; + const { navigation, route } = props || {}; const { postData } = route?.params ?? {}; - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const [selecttype, createPostSelectType] = useState(1); - const [type, createPostType] = useState('offer'); + const [type, createPostType] = useState("offer"); const [typeIconWhat, getTypeIconWhat]: any = useState(); const [showWhatPopover, setWhatShowPopover] = useState(false); const [getResourcewhatList, getResourseDatawhat]: any = useState([]); @@ -87,17 +90,17 @@ export const EditPostGratisScreen = (props: EditPostGratisScreenProps) => { const [getResourceForLis, getResourseDataFor]: any = useState([]); const [whatSelectType, getWhatTypeValue]: any = useState(); const [postImage, setCreatePostUri]: any = useState([]); - const [forName, createPostforName] = useState(''); - const [forQuantity, createPostforQuantity] = useState(''); - const [whereAddress, createPostwhereAddress] = useState(''); + const [forName, createPostforName] = useState(""); + const [forQuantity, createPostforQuantity] = useState(""); + const [whereAddress, createPostwhereAddress] = useState(""); const [imageKey, selectedImageKey] = useState(); const [when, createPostwhen] = useState(new Date()); - const [content, createPostcontent] = useState(''); - const [tags, createPosttags]: any = useState(''); + const [content, createPostcontent] = useState(""); + const [tags, createPosttags]: any = useState(""); const [tagArray, tagselectArray]: any = useState([]); - const [whatName, createPostwhatName] = useState(''); - const [addnewCmt, onAddComment] = useState(''); - const [addnewCmtReply, onAddCommentReply] = useState(''); + const [whatName, createPostwhatName] = useState(""); + const [addnewCmt, onAddComment] = useState(""); + const [addnewCmtReply, onAddCommentReply] = useState(""); var [whatQuantity, createPostwhatQuantity] = useState(1); const [typeIconTo, getTypeIconTo]: any = useState(); const [typrTovalue, getToTypeValue]: any = useState(); @@ -109,9 +112,9 @@ export const EditPostGratisScreen = (props: EditPostGratisScreenProps) => { const [userList, recentlyJoinUser]: any = useState([]); const [userListArray, setuserListArray]: any = useState([]); const [imageArray, setImageArray]: any = useState([]); - const [imageArrayKey, setImageArrayKey]:any = useState([]); + const [imageArrayKey, setImageArrayKey]: any = useState([]); var [gratisNo, totalGratisData]: any = useState(1); - const [usertext, onUserSearch] = useState(''); + const [usertext, onUserSearch] = useState(""); const datePickerRef: React.Ref = useRef(null); const { user } = useSelector( (state) => state.userProfileReducer @@ -148,7 +151,7 @@ export const EditPostGratisScreen = (props: EditPostGratisScreenProps) => { }; const onConfirmStartDateTime = (startDate: Date) => { createPostwhen(startDate); - datePickerRef.current?.onOpenModal('end'); + datePickerRef.current?.onOpenModal("end"); }; const requestLocationPermission = async () => { @@ -156,79 +159,73 @@ export const EditPostGratisScreen = (props: EditPostGratisScreenProps) => { enableHighAccuracy: true, timeout: 6000, }) - .then(location => { + .then((location) => { setUserLocation(location); console.log( - '---------------------location---------------------', - location, + "---------------------location---------------------", + location ); if (location) { // postListAPI(); } }) - .catch(error => { - console.log('---------------------error---------------------', error); - const {code, message} = error; + .catch((error) => { + console.log("---------------------error---------------------", error); + const { code, message } = error; console.log(code, message); }); }; const getResourcesAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch( - API_URL + '/v1/posts/resources', - { - method: 'get', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - }, - ); + const response = await fetch(API_URL + "/v1/posts/resources", { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + }); const dataItem = await response.json(); getResourseDatawhat(dataItem?.data?.what); getResourseDataTo(dataItem?.data?.to); getResourseDataFrom(dataItem?.data?.from); getResourseDataFor(dataItem?.data?.For); - getTypeIconWhat(dataItem?.data?.what[0]['icon']); - createPostwhatName(dataItem?.data?.what[0]['title']) - getTypeIconTo(dataItem?.data?.to[0]['icon']); - getToTypeValue(dataItem?.data?.to[0]['value']); - getWhatTypeValue(dataItem?.data?.what[0]['value']); + getTypeIconWhat(dataItem?.data?.what[0]["icon"]); + createPostwhatName(dataItem?.data?.what[0]["title"]); + getTypeIconTo(dataItem?.data?.to[0]["icon"]); + getToTypeValue(dataItem?.data?.to[0]["value"]); + getWhatTypeValue(dataItem?.data?.what[0]["value"]); } catch (error) { console.error(error); } }; const postImageUploadAPI = async (fileItem: any, base64Item: any) => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var pic: any = { - uploadKey: 'createPostImg', + uploadKey: "createPostImg", imageName: fileItem, - base64String: 'data:image/jpeg;base64,' + base64Item, + base64String: "data:image/jpeg;base64," + base64Item, }; try { - const response = await fetch( - API_URL + '/v1/users/upload/file', - { - method: 'post', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - body: JSON.stringify(pic), - }, - ); + const response = await fetch(API_URL + "/v1/users/upload/file", { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + body: JSON.stringify(pic), + }); const dataItem = await response.json(); -console.log(dataItem?.data) + console.log(dataItem?.data); var tempData = imageArray; tempData.push(dataItem?.data); setImageArray(tempData); var tempTwo = imageArrayKey; - tempTwo.push(dataItem?.data?.key) + tempTwo.push(dataItem?.data?.key); setImageArrayKey(tempTwo); // setCreatePostUri(dataItem?.data?.imageUrl); // selectedImageKey(dataItem?.data?.key); @@ -242,19 +239,22 @@ console.log(dataItem?.data) async function getPostDetailAPI() { LodingData(true); const token = await AsyncStorage.getItem("token"); - + console.log(API_URL + "/v2/posts/get/detail/" + postData?.id); try { console.log("222222"); - const response = await fetch(API_URL + "/v2/posts/get/detail/" + postData?.id, { - method: "get", - headers: new Headers({ - Authorization: "Bearer " + token, - "Content-Type": "application/json", - Accept: "application/json", - }), - }); + const response = await fetch( + API_URL + "/v2/posts/get/detail/" + postData?.id, + { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + Accept: "application/json", + }), + } + ); const dataItem = await response.json(); console.log("=========== Get detail Post API Response =============="); console.log(dataItem); @@ -264,12 +264,12 @@ console.log(dataItem?.data) getTypeIconWhat(dataItem?.data?.what?.icon); createPostcontent(dataItem?.data?.content); recentlyJoinUser(dataItem?.data?.usersArray); - let modifiedArray = dataItem?.data?.usersArray.map((obj:any) => { - const { first_name, last_name,pic,id,point, ...rest } = obj; - return { ...rest, user_id: obj.id,point:obj.point }; + let modifiedArray = dataItem?.data?.usersArray.map((obj: any) => { + const { first_name, last_name, pic, id, point, ...rest } = obj; + return { ...rest, user_id: obj.id, point: obj.point }; }); - console.log(modifiedArray,'getUserIdArray') - setuserListArray(modifiedArray) + console.log(modifiedArray, "getUserIdArray"); + setuserListArray(modifiedArray); tagselectArray(dataItem?.data?.tags); setImageArray(dataItem?.data?.imageUrl); setImageArrayKey(dataItem?.data?.image); @@ -283,9 +283,9 @@ console.log(dataItem?.data) async function createPostAPI() { LodingData(true); - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var data: any = { - type: 'gratis', + type: "gratis", what_type: whatSelectType, what_name: whatName, what_quantity: whatQuantity, @@ -303,21 +303,21 @@ console.log(dataItem?.data) const response = await fetch( API_URL + "/v2/posts/update/" + postData?.id, { - method: 'post', + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - Accept: 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", + Accept: "application/json", }), body: JSON.stringify(data), - }, + } ); const dataItem = await response.json(); - console.log('=========== Create Post API Response =============='); + console.log("=========== Create Post API Response =============="); console.log(dataItem); LodingData(false); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); if (dataItem?.success === true) { navigation?.goBack(); @@ -329,38 +329,34 @@ console.log(dataItem?.data) } async function gratisUserList(textUser: any) { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var datas: any = { searchtext: textUser, }; onUserSearch(textUser); - LodingData(true) - console.log('=========== User List Gratis API Request =============='); + LodingData(true); + console.log("=========== User List Gratis API Request =============="); console.log(datas); - console.log( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, - ); + console.log(API_URL + "/v1/users/search-user?searchtext=" + textUser); try { const response = await fetch( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, + API_URL + "/v1/users/search-user?searchtext=" + textUser, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", }), - }, + } ); const dataItem = await response.json(); - console.log('=========== User List Gratis API Response =============='); + console.log("=========== User List Gratis API Response =============="); const result = dataItem?.data?.map((item: any) => { - return {...item, gratisNo: 1}; + return { ...item, gratisNo: 1 }; }); userGratiesListData(result); console.log(dataItem); - LodingData(false) + LodingData(false); } catch (error) { LodingData(false); console.error(error); @@ -368,8 +364,8 @@ console.log(dataItem?.data) } const GallerySelect = async () => { - const {assets} = await launchImageLibrary({ - mediaType: 'photo', + const { assets } = await launchImageLibrary({ + mediaType: "photo", // selectionLimit: 2, includeBase64: true, maxWidth: 800, @@ -378,52 +374,52 @@ console.log(dataItem?.data) console.log(assets); if (assets) { const img = assets?.[0]; - console.log('---------------assets Gallery 222---------------'); + console.log("---------------assets Gallery 222---------------"); console.log(assets); - var fileNameTwo = img?.fileName ?? ''; + var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = - fileNameTwo.substr(0, fileNameTwo.lastIndexOf('.')) || fileNameTwo; - var base64Two = img?.base64 ?? ''; + fileNameTwo.substr(0, fileNameTwo.lastIndexOf(".")) || fileNameTwo; + var base64Two = img?.base64 ?? ""; postImageUploadAPI(output, base64Two); } }; const removeuserSelect = (userlist: any) => { const newPeople = userList.filter((person: any) => person !== userlist); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); recentlyJoinUser(newPeople); - let modifiedArray = newPeople.map((obj:any) => { - const { first_name, last_name,pic,id,gratisNo, ...rest } = obj; - return { ...rest, user_id: obj.id,point:obj.gratisNo }; + let modifiedArray = newPeople.map((obj: any) => { + const { first_name, last_name, pic, id, gratisNo, ...rest } = obj; + return { ...rest, user_id: obj.id, point: obj.gratisNo }; }); setuserListArray(modifiedArray); }; const CreateNewPostModal = () => { if (whatName.length === 0) { - Toast.show('Enter About What', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About What", Toast.LONG, { + backgroundColor: "black", }); - // } else if (whatQuantity.length === 0) { - // Toast.show('Enter What Quantity', Toast.LONG, { - // backgroundColor: 'black', - // }); - // } else if (userList.length === 0) { - // Toast.show('Add User', Toast.LONG, { - // backgroundColor: 'black', - // }); + // } else if (whatQuantity.length === 0) { + // Toast.show('Enter What Quantity', Toast.LONG, { + // backgroundColor: 'black', + // }); + // } else if (userList.length === 0) { + // Toast.show('Add User', Toast.LONG, { + // backgroundColor: 'black', + // }); } else if (content.length === 0) { - Toast.show('Enter Post Content', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Content", Toast.LONG, { + backgroundColor: "black", }); } else if (tagArray.length === 0) { - Toast.show('Enter Post Tag', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Tag", Toast.LONG, { + backgroundColor: "black", }); } else if (imageArray.length === 0) { - Toast.show('Add Image to Post', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Add Image to Post", Toast.LONG, { + backgroundColor: "black", }); } else { createPostAPI(); @@ -456,7 +452,7 @@ console.log(dataItem?.data) } }; - const renderItem: ListRenderItem = ({item}) => ( + const renderItem: ListRenderItem = ({ item }) => ( handleRemove(item)} pillStyle={styles.marginBottom} @@ -466,55 +462,58 @@ console.log(dataItem?.data) ); const removeSelectImage = (imageItem: any) => { - console.log(imageItem, 'image url') - console.log(imageArrayKey) + console.log(imageItem, "image url"); + console.log(imageArrayKey); const newImage = imageArray.filter( - (person: any) => person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key + (person: any) => + person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key ); setImageArray(newImage); const newImagekey = imageArrayKey.filter( (person: any) => person !== imageItem?.key ); - setImageArrayKey(newImagekey) - console.log(imageArrayKey) - } - + setImageArrayKey(newImagekey); + console.log(imageArrayKey); + }; const handleRemove = (id: any) => { const newPeople = tagArray.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); tagselectArray(newPeople); }; const onAddSkill = (text: any) => { - if (text !== '' && text !== undefined) { + if (text !== "" && text !== undefined) { tagselectArray([...tagArray, text]); - console.log('onSubmitEditing onSubmitEditing', tags, tagArray, text); - createPosttags(''); + console.log("onSubmitEditing onSubmitEditing", tags, tagArray, text); + createPosttags(""); } }; - const AddUserList = (item: any) => { - const found = userList.find((element:any) => element.id == item.id); + const found = userList.find((element: any) => element.id == item.id); if (!found) { - recentlyJoinUser([...userList, item]); - - const newItems = {...item}; + recentlyJoinUser([...userList, item]); + + const newItems = { ...item }; delete newItems.first_name; delete newItems.last_name; delete newItems.pic; delete newItems.id; delete newItems.gratisNo; console.log(item.gratisNo); - const newuserData = {...newItems, point: item.gratisNo, user_id: item.id}; + const newuserData = { + ...newItems, + point: item.gratisNo, + user_id: item.id, + }; setuserListArray([...userListArray, newuserData]); - - console.log(userListArray,'userListArray userListArray'); - }else{ - Toast.show('Already Added', Toast.LONG, { - backgroundColor: 'black', + + console.log(userListArray, "userListArray userListArray"); + } else { + Toast.show("Already Added", Toast.LONG, { + backgroundColor: "black", }); } }; @@ -524,20 +523,20 @@ console.log(dataItem?.data) }; const whatQtyMinus = () => { - if(whatQuantity > 1){ - whatQuantity = whatQuantity - 1 - createPostwhatQuantity(whatQuantity) + if (whatQuantity > 1) { + whatQuantity = whatQuantity - 1; + createPostwhatQuantity(whatQuantity); } - } + }; const onBackPress = () => { navigation?.goBack(); }; const whatQtyPlus = () => { - whatQuantity = whatQuantity + 1 - createPostwhatQuantity(whatQuantity) - } + whatQuantity = whatQuantity + 1; + createPostwhatQuantity(whatQuantity); + }; return ( <> @@ -587,24 +586,23 @@ console.log(dataItem?.data) - - - - - Gratis Edit - - + showsVerticalScrollIndicator={false} + > + + + + Gratis Edit + + + style={styles.createPostModal} + > @@ -614,10 +612,11 @@ console.log(dataItem?.data) placeholderTextColor="darkgray" value={whatName} editable={false} - onChangeText={text => createPostwhatName(text)} - style={styles.postInputTwo}> - {/* */} - + onChangeText={(text) => createPostwhatName(text)} + style={styles.postInputTwo} + > + {/* */} + - @@ -626,18 +625,18 @@ console.log(dataItem?.data) + - + setWhatShowPopover(true)} - > + > + source={{ uri: typeIconWhat }} + style={styles.createImgOne} + > - @@ -646,47 +645,52 @@ console.log(dataItem?.data) multiline placeholder="What do you want to say?" placeholderTextColor="darkgray" - textAlignVertical={'top'} + textAlignVertical={"top"} value={content} - onChangeText={text => createPostcontent(text)} - style={styles.postinput}> + onChangeText={(text) => createPostcontent(text)} + style={styles.postinput} + > - + To: - + gratisUserList(text)} - style={styles.postInputToType}> - + onChangeText={(text) => gratisUserList(text)} + style={styles.postInputToType} + > + + source={{ uri: typeIconTo }} + style={styles.createImgOne} + > - - + + showsHorizontalScrollIndicator={false} + > {userList.map((userList: any) => { - return ( + return ( removeuserSelect(userList)}> + onPress={() => removeuserSelect(userList)} + > + uri={userList?.pic} + > ); })} @@ -700,24 +704,28 @@ console.log(dataItem?.data) marginVertical: 10, borderRadius: 10, maxHeight: 275, - overflow: 'hidden', - height: 'auto', - }}> + overflow: "hidden", + height: "auto", + }} + > ( + renderItem={({ item, index }) => ( - + }} + > + - + source={{ uri: item?.pic }} + > + {item?.first_name} {item?.last_name} gratisMinusClick(item, index)}> + onPress={() => gratisMinusClick(item, index)} + > + }} + > {item?.gratisNo} gratisPlusClick(item, index)}> + onPress={() => gratisPlusClick(item, index)} + > + }} + > - AddUserList(item)}> + AddUserList(item)}> + source={buttonArrowGreen} + > - )}> + )} + > ) : ( )} - Tags createPosttags(text)} - style={styles.tagInput}> + onChangeText={(text) => createPosttags(text)} + style={styles.tagInput} + > - {tags !== '' ? ( + {tags !== "" ? ( { onAddSkill(tags); - }}> + }} + > + source={addGreen} + > ) : ( @@ -802,7 +826,7 @@ console.log(dataItem?.data) item.toString()} + keyExtractor={(item) => item.toString()} renderItem={renderItem} numColumns={100} showsHorizontalScrollIndicator={false} @@ -811,7 +835,8 @@ console.log(dataItem?.data) + style={styles.imagesCont} + > Image + add images @@ -820,10 +845,12 @@ console.log(dataItem?.data) {imageArray.map((item: any) => { return ( - removeSelectImage(item)} - > - + removeSelectImage(item)}> + + ); })} @@ -832,14 +859,15 @@ console.log(dataItem?.data) + style={styles.purchaseContainer} + > {strings.postOffer} - + diff --git a/src/screens/createEditPost/offerEdit.tsx b/src/screens/createEditPost/offerEdit.tsx index 47b615fb5..563b0b188 100644 --- a/src/screens/createEditPost/offerEdit.tsx +++ b/src/screens/createEditPost/offerEdit.tsx @@ -143,7 +143,6 @@ export const EditPostOfferScreen = (props: EditPostOfferScreenProps) => { userId: user?.id, }); - const datePickerRef: React.Ref = useRef(null); const keyboardDismiss = () => { @@ -174,10 +173,10 @@ export const EditPostOfferScreen = (props: EditPostOfferScreenProps) => { } else { setToTitleData(); } - console.log(type) - if(type === 'everyone'){ - recentlyJoinUser([]) - setuserListArray([]) + console.log(type); + if (type === "everyone") { + recentlyJoinUser([]); + setuserListArray([]); } getToTypeValue(type); getTypeIconTo(icon); @@ -187,7 +186,7 @@ export const EditPostOfferScreen = (props: EditPostOfferScreenProps) => { const selectForTypePost = (icon: any, type: any) => { getTypeIconFor(icon); getForTypeValue(type); - + setForShowPopover(false); }; @@ -347,7 +346,7 @@ export const EditPostOfferScreen = (props: EditPostOfferScreenProps) => { recentlyJoinUser(dataItem?.data?.usersArray); setToTitleData(); let modifiedArray = dataItem?.data?.usersArray.map((obj: any) => { - const { first_name, last_name, pic, id,point, ...rest } = obj; + const { first_name, last_name, pic, id, point, ...rest } = obj; setuserListArray([...userListArray, obj.id]); }); console.log(modifiedArray, "getUserIdArray"); @@ -591,10 +590,10 @@ export const EditPostOfferScreen = (props: EditPostOfferScreenProps) => { const removeuserSelect = (userlist: any) => { const newPeople = userList.filter((person: any) => person !== userlist); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); recentlyJoinUser(newPeople); - const ids = newPeople.map((obj:any) => obj.id); + const ids = newPeople.map((obj: any) => obj.id); setuserListArray(ids); }; diff --git a/src/screens/createEditPost/requestEdit.tsx b/src/screens/createEditPost/requestEdit.tsx index e3f0045fc..fc7d7617b 100644 --- a/src/screens/createEditPost/requestEdit.tsx +++ b/src/screens/createEditPost/requestEdit.tsx @@ -1,6 +1,6 @@ -import React, {useEffect, useRef, useState} from 'react'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; +import React, { useEffect, useRef, useState } from "react"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; import { FlatList, Image, @@ -12,9 +12,9 @@ import { TextInput, TouchableOpacity, View, -} from 'react-native'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {ImageComponent} from '@components/image-component'; +} from "react-native"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ImageComponent } from "@components/image-component"; import { addGreen, arrowDown, @@ -32,32 +32,35 @@ import { postCalender, request, requestGreen, -} from '@assets/images'; -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import moment from 'moment'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; -import GetLocation from 'react-native-get-location'; -import Popover, {PopoverPlacement, Rect} from 'react-native-popover-view'; -import {SizedBox} from '@components/sized-box'; -import {verticalScale} from '@theme/device/normalize'; +} from "@assets/images"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import moment from "moment"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import GetLocation from "react-native-get-location"; +import Popover, { PopoverPlacement, Rect } from "react-native-popover-view"; +import { SizedBox } from "@components/sized-box"; +import { verticalScale } from "@theme/device/normalize"; import { DatePickerRefProps, DateRangePicker, -} from '@components/date-range-picker'; -import {launchImageLibrary} from 'react-native-image-picker'; -import {GooglePlacesAutocomplete} from 'react-native-google-places-autocomplete'; -import Toast from 'react-native-simple-toast'; -import {Loader} from '@components/loader'; -import {navigations} from '@config/app-navigation/constant'; -import {FlatListComponent} from '@components/flatlist-component'; -import {Pill} from '@components/pill'; -import {API_URL} from '@network/constant'; -import ActiveEnv from '@config/env/env.dev.json'; -import { useSelector } from 'react-redux'; -import { StoreType } from '@network/reducers/store'; -import { UserProfileState } from '@network/reducers/user-profile-reducer'; -import { useUserProfile } from '@network/hooks/user-service-hooks/use-user-profile'; +} from "@components/date-range-picker"; +import { launchImageLibrary } from "react-native-image-picker"; +import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; +import Toast from "react-native-simple-toast"; +import { Loader } from "@components/loader"; +import { navigations } from "@config/app-navigation/constant"; +import { FlatListComponent } from "@components/flatlist-component"; +import { Pill } from "@components/pill"; +import { API_URL } from "@network/constant"; +import ActiveEnv from "@config/env/env.dev.json"; +import { useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; +import { UserProfileState } from "@network/reducers/user-profile-reducer"; +import { useUserProfile } from "@network/hooks/user-service-hooks/use-user-profile"; interface EditPostRequestScreenProps { navigation?: NavigationContainerRef; @@ -68,16 +71,14 @@ interface EditPostRequestScreenProps { }; } -export const EditPostRequestScreen = ( - props: EditPostRequestScreenProps, -) => { - const {navigation,route} = props || {}; +export const EditPostRequestScreen = (props: EditPostRequestScreenProps) => { + const { navigation, route } = props || {}; const { postData } = route?.params ?? {}; - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const [selecttype, createPostSelectType] = useState(1); - const [type, createPostType] = useState('offer'); + const [type, createPostType] = useState("offer"); const [typeIconWhat, getTypeIconWhat]: any = useState(); const [showWhatPopover, setWhatShowPopover] = useState(false); const [getResourceList, getResourseData]: any = useState([]); @@ -87,23 +88,23 @@ export const EditPostRequestScreen = ( const [getResourceToList, getResourseDataTo]: any = useState([]); const [getResourceForLis, getResourseDataFor]: any = useState([]); const [icontotype, getTypeIconTo]: any = useState(); - const [valueTotype, getToTypeValue] = useState(''); + const [valueTotype, getToTypeValue] = useState(""); const [iconFrom, getTypeIconFrom]: any = useState(); const [typrFrom, getFromTypeValue]: any = useState(); const [imageArray, setImageArray]: any = useState([]); - const [imageArrayKey, setImageArrayKey]:any = useState([]); - const [forName, createPostforName] = useState(''); + const [imageArrayKey, setImageArrayKey]: any = useState([]); + const [forName, createPostforName] = useState(""); var [forQuantity, createPostforQuantity] = useState(1); - const [whereAddress, createPostwhereAddress] = useState(''); + const [whereAddress, createPostwhereAddress] = useState(""); const [imageKey, selectedImageKey] = useState(); - const [when, createPostwhen]:any = useState(); - const [content, createPostcontent] = useState(''); - const [tags, createPosttags]: any = useState(''); + const [when, createPostwhen]: any = useState(); + const [content, createPostcontent] = useState(""); + const [tags, createPosttags]: any = useState(""); const [tagArray, tagselectArray]: any = useState([]); - const [whatName, createPostwhatName] = useState(''); - const [fromName, createPostFromName] = useState(''); - const [addnewCmt, onAddComment] = useState(''); - const [addnewCmtReply, onAddCommentReply] = useState(''); + const [whatName, createPostwhatName] = useState(""); + const [fromName, createPostFromName] = useState(""); + const [addnewCmt, onAddComment] = useState(""); + const [addnewCmtReply, onAddCommentReply] = useState(""); var [whatQuantity, createPostwhatQuantity] = useState(1); const [typeIconFor, getTypeIconFor]: any = useState(); const [whatForType, getForTypeValue]: any = useState(); @@ -115,8 +116,8 @@ export const EditPostRequestScreen = ( const [userList, recentlyJoinUser]: any = useState([]); const [userListArray, setuserListArray]: any = useState([]); const [usergratisList, userGratiesListData]: any = useState([]); - const [usertext, onUserSearch] = useState(''); - const [settoTitle, setToTitleData]:any = useState(); + const [usertext, onUserSearch] = useState(""); + const [settoTitle, setToTitleData]: any = useState(); var [latitude, setLatitude]: any = useState(); var [longitude, setLongitude]: any = useState(); const datePickerRef: React.Ref = useRef(null); @@ -154,18 +155,18 @@ export const EditPostRequestScreen = ( setForShowPopover(false); }; - const selectFromTypePost = (icon: any, type: any,title:any) => { - if (title === 'Everyone') { + const selectFromTypePost = (icon: any, type: any, title: any) => { + if (title === "Everyone") { setToTitleData(title); } else { setToTitleData(); } - if(type === 'everyone'){ - recentlyJoinUser([]) - setuserListArray([]) + if (type === "everyone") { + recentlyJoinUser([]); + setuserListArray([]); } getTypeIconTo(icon); - getFromTypeValue(type) + getFromTypeValue(type); getToTypeValue(type); setFronShowPopover(false); }; @@ -173,7 +174,7 @@ export const EditPostRequestScreen = ( const onConfirmStartDateTime = (startDate: Date) => { console.log(startDate); createPostwhen(startDate); - datePickerRef.current?.onOpenModal('end'); + datePickerRef.current?.onOpenModal("end"); }; const requestLocationPermission = async () => { @@ -181,36 +182,36 @@ export const EditPostRequestScreen = ( enableHighAccuracy: true, timeout: 6000, }) - .then(location => { + .then((location) => { setUserLocation(location); console.log( - '---------------------location---------------------', - location, + "---------------------location---------------------", + location ); if (location) { // postListAPI(); } }) - .catch(error => { - console.log('---------------------error---------------------', error); - const {code, message} = error; + .catch((error) => { + console.log("---------------------error---------------------", error); + const { code, message } = error; console.log(code, message); }); }; const getResourcesAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch(API_URL + '/v1/posts/resources', { - method: 'get', + const response = await fetch(API_URL + "/v1/posts/resources", { + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), }); const dataItem = await response.json(); console.log( - '-------------------Get Resources API Response---------------------', + "-------------------Get Resources API Response---------------------" ); console.log(dataItem); getResourseDatawhat(dataItem?.data?.what); @@ -227,8 +228,8 @@ export const EditPostRequestScreen = ( // getFromTypeValue(dataItem?.data?.from[0]['value']); // getWhatTypeValue(dataItem?.data?.what[0]['value']); console.log( - dataItem?.data[0]['icon'], - '------------icon image--------------', + dataItem?.data[0]["icon"], + "------------icon image--------------" ); } catch (error) { console.error(error); @@ -236,32 +237,32 @@ export const EditPostRequestScreen = ( }; const postImageUploadAPI = async (fileItem: any, base64Item: any) => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var pic: any = { - uploadKey: 'createPostImg', + uploadKey: "createPostImg", imageName: fileItem, - base64String: 'data:image/jpeg;base64,' + base64Item, + base64String: "data:image/jpeg;base64," + base64Item, }; - console.log('================ postImageUploadAPI Request================='); + console.log("================ postImageUploadAPI Request================="); console.log(pic); try { - const response = await fetch(API_URL + '/v1/users/upload/file', { - method: 'post', + const response = await fetch(API_URL + "/v1/users/upload/file", { + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), body: JSON.stringify(pic), }); const dataItem = await response.json(); - console.log('-----------------Response------------'); + console.log("-----------------Response------------"); var tempData = imageArray; tempData.push(dataItem?.data); setImageArray(tempData); var tempTwo = imageArrayKey; - tempTwo.push(dataItem?.data?.key) + tempTwo.push(dataItem?.data?.key); setImageArrayKey(tempTwo); selectedImageKey(dataItem?.data?.key); console.log(dataItem); @@ -275,48 +276,51 @@ export const EditPostRequestScreen = ( async function getPostDetailAPI() { LodingData(true); const token = await AsyncStorage.getItem("token"); - + console.log(API_URL + "/v2/posts/get/detail/" + postData?.id); try { console.log("222222"); - const response = await fetch(API_URL + "/v2/posts/get/detail/" + postData?.id, { - method: "get", - headers: new Headers({ - Authorization: "Bearer " + token, - "Content-Type": "application/json", - Accept: "application/json", - }), - }); + const response = await fetch( + API_URL + "/v2/posts/get/detail/" + postData?.id, + { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + Accept: "application/json", + }), + } + ); const dataItem = await response.json(); console.log("=========== Get detail Post API Response =============="); console.log(dataItem); createPostwhatName(dataItem?.data?.what?.name); createPostwhatQuantity(dataItem?.data?.what?.quantity); getTypeIconWhat(dataItem?.data?.what?.icon); - getWhatTypeValue(dataItem?.data?.what?.type) + getWhatTypeValue(dataItem?.data?.what?.type); createPostcontent(dataItem?.data?.content); - createPostforName(dataItem?.data?.for?.name) - getForTypeValue(dataItem?.data?.for?.type) - if(dataItem?.data?.from?.type === 'person'){ + createPostforName(dataItem?.data?.for?.name); + getForTypeValue(dataItem?.data?.for?.type); + if (dataItem?.data?.from?.type === "person") { setToTitleData(); recentlyJoinUser(dataItem?.data?.usersArray); - let modifiedArray = dataItem?.data?.usersArray.map((obj:any) => { - const { first_name, last_name,pic,id,point, ...rest } = obj; - setuserListArray([...userListArray, obj.id]); - }); - } else{ + let modifiedArray = dataItem?.data?.usersArray.map((obj: any) => { + const { first_name, last_name, pic, id, point, ...rest } = obj; + setuserListArray([...userListArray, obj.id]); + }); + } else { setToTitleData(dataItem?.data?.from?.title); } - getFromTypeValue(dataItem?.data?.from?.type) - getTypeIconTo(dataItem?.data?.from?.icon) - createPostforQuantity(dataItem?.data?.for?.quantity) - getTypeIconFor(dataItem?.data?.for?.icon) - createPostwhen(dataItem?.data?.when) - setLatitude(dataItem?.data?.where?.location?.coordinates[1]) - setLongitude(dataItem?.data?.where?.location?.coordinates[0]) + getFromTypeValue(dataItem?.data?.from?.type); + getTypeIconTo(dataItem?.data?.from?.icon); + createPostforQuantity(dataItem?.data?.for?.quantity); + getTypeIconFor(dataItem?.data?.for?.icon); + createPostwhen(dataItem?.data?.when); + setLatitude(dataItem?.data?.where?.location?.coordinates[1]); + setLongitude(dataItem?.data?.where?.location?.coordinates[0]); createPostwhereAddress(dataItem?.data?.where?.address); - + tagselectArray(dataItem?.data?.tags); setImageArray(dataItem?.data?.imageUrl); setImageArrayKey(dataItem?.data?.image); @@ -331,9 +335,9 @@ export const EditPostRequestScreen = ( async function createPostAPI() { LodingData(true); - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var data: any = { - type: 'request', + type: "request", what_type: whatSelectType, what_name: whatName, what_quantity: whatQuantity, @@ -348,26 +352,29 @@ export const EditPostRequestScreen = ( tags: tagArray, post_image: imageArrayKey, from_type: typrFrom, - from_users:userListArray + from_users: userListArray, }; console.log(API_URL + "/v2/posts/update/" + postData?.id); console.log(data); try { - const response = await fetch(API_URL + "/v2/posts/update/" + postData?.id, { - method: 'post', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - body: JSON.stringify(data), - }); + const response = await fetch( + API_URL + "/v2/posts/update/" + postData?.id, + { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + body: JSON.stringify(data), + } + ); const dataItem = await response.json(); - console.log('=========== Create Post API Response =============='); + console.log("=========== Create Post API Response =============="); console.log(dataItem); LodingData(false); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); if (dataItem?.success === true) { navigation?.goBack(); @@ -385,8 +392,8 @@ export const EditPostRequestScreen = ( }; const GallerySelect = async () => { - const {assets} = await launchImageLibrary({ - mediaType: 'photo', + const { assets } = await launchImageLibrary({ + mediaType: "photo", // selectionLimit: 2, includeBase64: true, maxWidth: 800, @@ -395,37 +402,37 @@ export const EditPostRequestScreen = ( console.log(assets); if (assets) { const img = assets?.[0]; - console.log('---------------assets Gallery 222---------------'); + console.log("---------------assets Gallery 222---------------"); console.log(assets); - var fileNameTwo = img?.fileName ?? ''; + var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = - fileNameTwo.substr(0, fileNameTwo.lastIndexOf('.')) || fileNameTwo; - var base64Two = img?.base64 ?? ''; + fileNameTwo.substr(0, fileNameTwo.lastIndexOf(".")) || fileNameTwo; + var base64Two = img?.base64 ?? ""; postImageUploadAPI(output, base64Two); } }; const CreateNewPostModal = () => { if (whatName.length === 0) { - Toast.show('Enter About What', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About What", Toast.LONG, { + backgroundColor: "black", }); } else if (forName.length === 0) { - Toast.show('Enter About For', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About For", Toast.LONG, { + backgroundColor: "black", }); } else if (content.length === 0) { - Toast.show('Enter Post Content', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Content", Toast.LONG, { + backgroundColor: "black", }); } else if (tagArray.length === 0) { - Toast.show('Enter Post Tag', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Tag", Toast.LONG, { + backgroundColor: "black", }); } else if (imageArray.length === 0) { - Toast.show('Add Image to Post', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Add Image to Post", Toast.LONG, { + backgroundColor: "black", }); } else { createPostAPI(); @@ -434,47 +441,46 @@ export const EditPostRequestScreen = ( // CreatePostModal(false); }; - const whatQtyMinus = () => { - if(whatQuantity > 1){ - whatQuantity = whatQuantity - 1 - createPostwhatQuantity(whatQuantity) + if (whatQuantity > 1) { + whatQuantity = whatQuantity - 1; + createPostwhatQuantity(whatQuantity); } - } + }; const whatQtyPlus = () => { - whatQuantity = whatQuantity + 1 - createPostwhatQuantity(whatQuantity) - } + whatQuantity = whatQuantity + 1; + createPostwhatQuantity(whatQuantity); + }; const ForQtyMinus = () => { - if(forQuantity > 1){ - forQuantity = forQuantity - 1 - createPostforQuantity(forQuantity) + if (forQuantity > 1) { + forQuantity = forQuantity - 1; + createPostforQuantity(forQuantity); } - } + }; const ForQtyPlus = () => { - forQuantity = forQuantity + 1 - createPostforQuantity(forQuantity) - } + forQuantity = forQuantity + 1; + createPostforQuantity(forQuantity); + }; const handleRemove = (id: any) => { const newPeople = tagArray.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); tagselectArray(newPeople); }; const onAddSkill = (text: any) => { - if (text !== '' && text !== undefined) { + if (text !== "" && text !== undefined) { tagselectArray([...tagArray, text]); - console.log('onSubmitEditing onSubmitEditing', tags, tagArray, text); - createPosttags(''); + console.log("onSubmitEditing onSubmitEditing", tags, tagArray, text); + createPosttags(""); } }; - const renderItem: ListRenderItem = ({item}) => ( + const renderItem: ListRenderItem = ({ item }) => ( handleRemove(item)} pillStyle={styles.marginBottom} @@ -485,19 +491,19 @@ export const EditPostRequestScreen = ( const removeuserSelect = (userlist: any) => { const newPeople = userList.filter((person: any) => person !== userlist); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); recentlyJoinUser(newPeople); - const ids = newPeople.map((obj:any) => obj.id); + const ids = newPeople.map((obj: any) => obj.id); setuserListArray(ids); }; const AddUserList = (item: any) => { - const found = userList.find((element:any) => element.id == item.id); + const found = userList.find((element: any) => element.id == item.id); if (!found) { - recentlyJoinUser([...userList, item]); - - const newItems = {...item}; + recentlyJoinUser([...userList, item]); + + const newItems = { ...item }; delete newItems.first_name; delete newItems.last_name; delete newItems.pic; @@ -505,70 +511,67 @@ export const EditPostRequestScreen = ( delete newItems.gratisNo; console.log(item.gratisNo); setuserListArray([...userListArray, item.id]); - + console.log(userListArray); - }else{ - Toast.show('Already Added', Toast.LONG, { - backgroundColor: 'black', + } else { + Toast.show("Already Added", Toast.LONG, { + backgroundColor: "black", }); } }; async function gratisUserList(textUser: any) { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var datas: any = { searchtext: textUser, }; onUserSearch(textUser); - LodingData(true) - console.log('=========== User List Gratis API Request =============='); + LodingData(true); + console.log("=========== User List Gratis API Request =============="); console.log(datas); - console.log( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, - ); + console.log(API_URL + "/v1/users/search-user?searchtext=" + textUser); try { const response = await fetch( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, + API_URL + "/v1/users/search-user?searchtext=" + textUser, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", }), - }, + } ); const dataItem = await response.json(); - console.log('=========== User List Gratis API Response =============='); + console.log("=========== User List Gratis API Response =============="); const result = dataItem?.data?.map((item: any) => { - return {...item, gratisNo: 1}; + return { ...item, gratisNo: 1 }; }); userGratiesListData(result); console.log(dataItem); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); - LodingData(false) + LodingData(false); } catch (error) { LodingData(false); console.error(error); } } - const removeSelectImage = (imageItem: any) => { - console.log(imageItem, 'image url') - console.log(imageArrayKey) + const removeSelectImage = (imageItem: any) => { + console.log(imageItem, "image url"); + console.log(imageArrayKey); const newImage = imageArray.filter( - (person: any) => person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key + (person: any) => + person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key ); setImageArray(newImage); const newImagekey = imageArrayKey.filter( (person: any) => person !== imageItem?.key ); - setImageArrayKey(newImagekey) - console.log(imageArrayKey) - } + setImageArrayKey(newImagekey); + console.log(imageArrayKey); + }; const gratisPlusClick = (item: any, index: any) => { // console.log(item) @@ -645,23 +648,19 @@ export const EditPostRequestScreen = ( - - - - - Request Edit - - + showsVerticalScrollIndicator={false} + > + + + + Request Edit + + + style={styles.createPostModal} + > @@ -670,8 +669,9 @@ export const EditPostRequestScreen = ( placeholder="What is your request?" placeholderTextColor="darkgray" value={whatName} - onChangeText={text => createPostwhatName(text)} - style={styles.postInputTwo}> + onChangeText={(text) => createPostwhatName(text)} + style={styles.postInputTwo} + > - @@ -688,23 +688,26 @@ export const EditPostRequestScreen = ( from={ setWhatShowPopover(true)}> + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectWhatTypePost(item?.icon, item?.value) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -712,58 +715,61 @@ export const EditPostRequestScreen = ( + }} + > - )}> + )} + > setWhatShowPopover(true)}> + onPress={() => setWhatShowPopover(true)} + > + source={{ uri: typeIconWhat }} + style={styles.createImgOne} + > Where - {/* */} { createPostwhereAddress(data.description); - setLatitude(details?.geometry?.location?.lat) - setLongitude(details?.geometry?.location?.lng) + setLatitude(details?.geometry?.location?.lat); + setLongitude(details?.geometry?.location?.lng); console.log(data); // description - console.log(details); + console.log(details); }} query={{ key: ActiveEnv.GOOGLE_KEY, // client @@ -772,10 +778,11 @@ export const EditPostRequestScreen = ( // currentLocation={true} currentLocationLabel="Current location" /> - + style={styles.createImgTwo} + > Post Body @@ -783,10 +790,11 @@ export const EditPostRequestScreen = ( multiline // placeholder="What do you want to say?" placeholderTextColor="darkgray" - textAlignVertical={'top'} + textAlignVertical={"top"} value={content} - onChangeText={text => createPostcontent(text)} - style={styles.postinput}> + onChangeText={(text) => createPostcontent(text)} + style={styles.postinput} + > {/* @@ -805,10 +813,11 @@ export const EditPostRequestScreen = ( // placeholder="who do you request this of?" placeholderTextColor="darkgray" value={settoTitle} - editable={settoTitle == 'Everyone' ? false : true} - onChangeText={text => gratisUserList(text)} - style={styles.postInputTwo}> - + editable={settoTitle == "Everyone" ? false : true} + onChangeText={(text) => gratisUserList(text)} + style={styles.postInputTwo} + > + + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + - selectFromTypePost(item?.icon, item?.value,item?.title) + selectFromTypePost( + item?.icon, + item?.value, + item?.title + ) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -840,68 +856,78 @@ export const EditPostRequestScreen = ( + }} + > - )}> + )} + > setFronShowPopover(true)}> + onPress={() => setFronShowPopover(true)} + > + resizeMode="contain" + source={{ uri: icontotype }} + style={styles.createImgOne} + > - + showsHorizontalScrollIndicator={false} + > {userList.map((userList: any) => { return ( removeuserSelect(userList)}> + onPress={() => removeuserSelect(userList)} + > + uri={userList?.pic} + > ); })} - {settoTitle !== 'Everyone' ? ( + {settoTitle !== "Everyone" ? ( + overflow: "hidden", + height: "auto", + }} + > ( + renderItem={({ item, index }) => ( - + }} + > + - + source={{ uri: item?.pic }} + > + {item?.first_name} {item?.last_name} - - AddUserList(item)}> + AddUserList(item)}> + source={buttonArrowGreen} + > - )}> + )} + > ) : ( @@ -938,14 +973,15 @@ export const EditPostRequestScreen = ( )} For - + createPostforName(text)} - style={styles.postInputTwo}> - + onChangeText={(text) => createPostforName(text)} + style={styles.postInputTwo} + > + - @@ -961,23 +997,26 @@ export const EditPostRequestScreen = ( from={ setForShowPopover(true)}> + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectForTypePost(item?.icon, item?.value) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -985,62 +1024,70 @@ export const EditPostRequestScreen = ( + }} + > - )}> + )} + > setForShowPopover(true)}> + onPress={() => setForShowPopover(true)} + > + source={{ uri: typeIconFor }} + style={styles.createImgOne} + > - - When - - datePickerRef.current?.onOpenModal('start')} - style={styles.postInputTwo}> - - {`${moment(when).format('DD MMM YYYY hh:mm A')}`} - + When - - - - + datePickerRef.current?.onOpenModal("start")} + style={styles.postInputTwo} + > + + {`${moment(when).format("DD MMM YYYY hh:mm A")}`} + + + + + + Tags createPosttags(text)} - style={styles.tagInput}> + onChangeText={(text) => createPosttags(text)} + style={styles.tagInput} + > - {tags !== '' ? ( + {tags !== "" ? ( { onAddSkill(tags); - }}> + }} + > + source={addGreen} + > ) : ( @@ -1049,7 +1096,7 @@ export const EditPostRequestScreen = ( item.toString()} + keyExtractor={(item) => item.toString()} renderItem={renderItem} numColumns={100} showsHorizontalScrollIndicator={false} @@ -1058,7 +1105,8 @@ export const EditPostRequestScreen = ( + style={styles.imagesCont} + > Image + add images @@ -1067,20 +1115,22 @@ export const EditPostRequestScreen = ( {imageArray.map((item: any) => { return ( - removeSelectImage(item)} - > - + removeSelectImage(item)}> + + ); })} - + style={styles.purchaseContainer} + > {strings.postOffer} { return StyleSheet.create({ container: { - justifyContent: 'center', + justifyContent: "center", backgroundColor: theme.colors.white, - alignItems: 'center', + alignItems: "center", flex: 1, }, text: { @@ -25,31 +25,30 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 52, left: 10, height: normalScale(30), width: normalScale(30), zIndex: 11111222222, - paddingLeft:4, - paddingTop:4 + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 40, color: theme.colors.white, - zIndex: 11111222 - + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -63,52 +62,52 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, fontFamily: theme.fontType.regular, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 25 + bottom: 25, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -116,16 +115,16 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, container2: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), paddingLeft: 11, - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), shadowColor: theme.colors.black, @@ -141,7 +140,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, elevation: 5, // position:'absolute', - top: -20 + top: -20, }, icon1: { height: normalScale(30), @@ -151,23 +150,23 @@ export const createStyleSheet = (theme: ThemeProps) => { label1: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#197127' + color: "#197127", // justifyContent: 'center', // alignItems: 'center', }, label1Service: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#0081D2' + color: "#0081D2", }, label1Event: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#B10E00' + color: "#B10E00", }, filterTags: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, avatarImage: { height: 60, @@ -178,12 +177,12 @@ export const createStyleSheet = (theme: ThemeProps) => { }, avatarContainer: { marginLeft: 20, - marginRight: 20, + marginRight: 20, // backgroundColor:'red' }, skillAddImage: { - position: 'absolute', - bottom:-10, + position: "absolute", + bottom: -10, right: 16, height: 22, width: 22, @@ -199,32 +198,31 @@ export const createStyleSheet = (theme: ThemeProps) => { marginBottom: verticalScale(10), }, flexWrap: { - flexWrap: 'wrap', + flexWrap: "wrap", }, postInput: { - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 22, width: width - 90, marginLeft: 10, paddingHorizontal: 10, - justifyContent:'center', + justifyContent: "center", fontFamily: theme.fontType.regular, - }, postContainer: { marginVertical: 10, - flexDirection: 'row', + flexDirection: "row", }, postFilter: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, container3: { // borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), width: 110, @@ -234,7 +232,6 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - }, label2: { fontFamily: theme.fontType.regular, @@ -246,7 +243,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font14, color: theme.colors.green, }, - label4:{ + label4: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, @@ -255,7 +252,7 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.white, margin: 10, borderRadius: 12, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -267,9 +264,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), backgroundColor: theme.colors.lightRed, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), - marginHorizontal: 10 + marginHorizontal: 10, }, dummy: { width: normalScale(80), @@ -300,56 +297,56 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginLeft: normalScale(10), }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: 10, }, pin: { height: normalScale(14), width: normalScale(14), marginRight: normalScale(8), - marginTop:6 + marginTop: 6, }, location: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, fullAddress: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, addressDot: { height: 6, - width: 6, - marginTop:10, - marginHorizontal: 5 + width: 6, + marginTop: 10, + marginHorizontal: 5, }, sposerLabel: { - position: 'absolute', + position: "absolute", right: -32, top: 30, - zIndex: 11112222 + zIndex: 11112222, }, gretitude: { height: 20, width: 20, - position: 'absolute', + position: "absolute", right: 12, - bottom: 5 + bottom: 5, }, dateContainer: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", marginTop: verticalScale(10), marginHorizontal: 10, padding: 10, borderRadius: 12, backgroundColor: theme.colors.white, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -370,11 +367,11 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginBottom:12 }, posttitle: { - textAlign: 'center', - color: '#007112', + textAlign: "center", + color: "#007112", fontSize: 16, fontFamily: theme.fontType.regular, - marginTop:3 + marginTop: 3, }, feedContainer: { marginHorizontal: 10, @@ -383,7 +380,7 @@ export const createStyleSheet = (theme: ThemeProps) => { borderWidth: 3, borderRadius: 8, paddingBottom: 14, - overflow:'hidden' + overflow: "hidden", }, postfilterImage: { height: 22, @@ -394,12 +391,12 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 35, borderRadius: 100, marginRight: 10, - alignItems: 'center', - marginTop: 1 + alignItems: "center", + marginTop: 1, }, userDetailcont: { marginHorizontal: 10, - flexDirection: 'row', + flexDirection: "row", }, userName: { color: theme.colors.black, @@ -412,26 +409,26 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, postDes: { - textAlign: 'left', + textAlign: "left", color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, marginHorizontal: 15, marginVertical: 10, - lineHeight:20 + lineHeight: 20, }, userPost: { height: 500, - width: 'auto', + width: "auto", marginHorizontal: 10, marginBottom: 20, - borderRadius: 10 + borderRadius: 10, }, scrollViewStyle: { paddingBottom: verticalScale(100), }, - scrollView: { - // flex:1 + scrollView: { + // flex:1 paddingBottom: verticalScale(100), // paddingHorizontal: normalScale(22), }, @@ -439,17 +436,17 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, - marginRight: 5 + marginRight: 5, }, postDetailCont: { - flexDirection: 'row', + flexDirection: "row", marginHorizontal: 20, - marginBottom: 5 + marginBottom: 5, }, detailImage: { height: 14, width: 14, - marginRight: 8 + marginRight: 8, }, likeCount: { color: theme.colors.black, @@ -459,7 +456,7 @@ export const createStyleSheet = (theme: ThemeProps) => { commentImage: { height: 14, width: 14, - marginLeft:5 + marginLeft: 5, }, msgCount: { color: theme.colors.black, @@ -467,52 +464,52 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, commentTitle: { - flexDirection: 'row', - justifyContent: 'space-between', - marginHorizontal: 13 + flexDirection: "row", + justifyContent: "space-between", + marginHorizontal: 13, }, commentCont: { - flexDirection: 'row' + flexDirection: "row", }, commentContTwo: { - flexDirection: 'row', - justifyContent: 'space-evenly', - alignItems: 'center', - paddingTop:2, - paddingBottom:2 + flexDirection: "row", + justifyContent: "space-evenly", + alignItems: "center", + paddingTop: 2, + paddingBottom: 2, }, commentImgTwo: { height: 23, - width: 23 + width: 23, }, commentContShow: { fontSize: 12, - color: '#000000', + color: "#000000", marginHorizontal: 13, - marginTop: 2 + marginTop: 2, }, commentImgProfile: { marginLeft: 16, marginRight: 30, - flexDirection: 'row', - justifyContent: 'flex-start', - marginVertical:6, - overflow:'hidden' + flexDirection: "row", + justifyContent: "flex-start", + marginVertical: 6, + overflow: "hidden", }, commentDisplayCont: { - backgroundColor: '#E6E6E6', + backgroundColor: "#E6E6E6", borderWidth: 2, - borderColor: '#C2DBC6', - height: 'auto', + borderColor: "#C2DBC6", + height: "auto", borderRadius: 20, width: 230, paddingHorizontal: 10, paddingTop: 6, - paddingBottom: 6 + paddingBottom: 6, }, replyMsgCont: { fontSize: 12, - color: '#110101', + color: "#110101", paddingTop: 2, paddingLeft: 14, }, @@ -521,73 +518,73 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 24, }, replyContainer: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 80, marginTop: 2, }, replyLbl: { fontSize: 12, marginLeft: 10, - marginTop: 4 + marginTop: 4, }, minuteCont: { fontSize: 12, marginLeft: 16, - marginTop: 4 + marginTop: 4, }, commentImgProfileTwo: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 20, - justifyContent:'center', + justifyContent: "center", marginTop: 2, - overflow:'hidden' + overflow: "hidden", }, replyContainerTwo: { - flexDirection: 'row', - justifyContent:'center', + flexDirection: "row", + justifyContent: "center", marginLeft: 30, // marginLeft: 145, - marginVertical:10, + marginVertical: 10, // marginTop: 2, }, replyIcon: { height: 9, width: 10, marginTop: 6, - marginRight: 4 + marginRight: 4, }, replyMoreLbl: { fontSize: 12, - marginTop: 4, - marginRight: 50 + marginTop: 4, + marginRight: 50, }, - textOne:{ + textOne: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, // marginRight:2, - fontWeight:'600' + fontWeight: "600", }, - createPostModal:{ + createPostModal: { borderTopRightRadius: 24, borderTopLeftRadius: 24, // paddingVertical: verticalScale(20), - paddingHorizontal:8, + paddingHorizontal: 8, marginHorizontal: 7, }, - createPostCont:{ - flexDirection:'row', - alignItems:'center' + createPostCont: { + flexDirection: "row", + alignItems: "center", }, postInputTwo: { borderRadius: 10, width: width - 215, marginLeft: 3, paddingHorizontal: 10, - height:35, - justifyContent:'center', - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + height: 35, + justifyContent: "center", + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, color: theme.colors.black, }, @@ -596,154 +593,153 @@ export const createStyleSheet = (theme: ThemeProps) => { width: width - 130, marginLeft: 3, paddingHorizontal: 10, - height:35, - justifyContent:'center', - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + height: 35, + justifyContent: "center", + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, - marginRight:8, - color: theme.colors.black + marginRight: 8, + color: theme.colors.black, }, postdate: { borderRadius: 10, // marginLeft: 10, // paddingHorizontal: 10, - alignItems:'center', - flexDirection:'row' + alignItems: "center", + flexDirection: "row", }, - QuantityContainer:{ - flexDirection:'row', - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + QuantityContainer: { + flexDirection: "row", + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, borderRadius: 8, - paddingHorizontal:5, - paddingVertical:4, - marginHorizontal:5, - shadowColor: 'lightgray', + paddingHorizontal: 5, + paddingVertical: 4, + marginHorizontal: 5, + shadowColor: "lightgray", shadowOffset: { width: 2, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, }, - QuantityMinus:{ - marginHorizontal:6, - color:theme.colors.black, - fontSize:theme.fontSize.font14, - fontFamily:theme.fontType.medium + QuantityMinus: { + marginHorizontal: 6, + color: theme.colors.black, + fontSize: theme.fontSize.font14, + fontFamily: theme.fontType.medium, }, - QuantityMunber:{ - color:theme.colors.black, - fontSize:theme.fontSize.font14, - fontFamily:theme.fontType.bold, - + QuantityMunber: { + color: theme.colors.black, + fontSize: theme.fontSize.font14, + fontFamily: theme.fontType.bold, }, - QuantityPlus:{ - marginHorizontal:6, - color:theme.colors.black, - fontSize:theme.fontSize.font14, - fontFamily:theme.fontType.medium - }, - createImgOne:{ - height:20, - width:20, - marginRight:5, - }, - calenderImage:{ - height:20, - width:20, - marginLeft:70, - }, - quntitiyInput:{ - width:90, - height:30, - backgroundColor:'lightgray', - borderRadius:12, - paddingHorizontal:5 - }, - quntitiyCont:{ - flexDirection:'row', - marginTop:10, - marginBottom:10, - alignItems:'center', - }, - postCont:{ + QuantityPlus: { + marginHorizontal: 6, + color: theme.colors.black, + fontSize: theme.fontSize.font14, + fontFamily: theme.fontType.medium, + }, + createImgOne: { + height: 20, + width: 20, + marginRight: 5, + }, + calenderImage: { + height: 20, + width: 20, + marginLeft: 70, + }, + quntitiyInput: { + width: 90, + height: 30, + backgroundColor: "lightgray", + borderRadius: 12, + paddingHorizontal: 5, + }, + quntitiyCont: { + flexDirection: "row", + marginTop: 10, + marginBottom: 10, + alignItems: "center", + }, + postCont: { // marginTop:10 }, - postinput:{ - height:160, - marginTop:5, - textAlign: 'left', - verticalAlign: 'top', - borderRadius:12, - paddingHorizontal:5, - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + postinput: { + height: 160, + marginTop: 5, + textAlign: "left", + verticalAlign: "top", + borderRadius: 12, + paddingHorizontal: 5, + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, color: theme.colors.black, }, - tagCont:{ - marginTop:10, - flexDirection:'row', - alignItems:'center' - }, - tagInput:{ - height:30, - width:150, - borderRadius:8, - paddingHorizontal:5, - marginLeft:10, - paddingVertical: 2, - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, - backgroundColor: theme.colors.lightgrayTwo, - color: theme.colors.black - }, - imagesCont:{ - flexDirection:'row', - marginTop:10 - }, - textTwo:{ + tagCont: { + marginTop: 10, + flexDirection: "row", + alignItems: "center", + }, + tagInput: { + height: 30, + width: 150, + borderRadius: 8, + paddingHorizontal: 5, + marginLeft: 10, + paddingVertical: 2, + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, + backgroundColor: theme.colors.lightgrayTwo, + color: theme.colors.black, + }, + imagesCont: { + flexDirection: "row", + marginTop: 10, + }, + textTwo: { color: theme.colors.black, fontSize: 15, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - textThree:{ - color: 'lightgray', + textThree: { + color: "lightgray", fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - multipleImagecont:{ - flex: 1, - flexDirection:'row', - // width : '100%', - flexWrap: 'wrap', + multipleImagecont: { + flex: 1, + flexDirection: "row", + // width : '100%', + flexWrap: "wrap", }, selectImage: { height: 90, width: 90, borderRadius: 18, marginRight: 10, - marginTop: 12 + marginTop: 12, }, - postClass:{ - borderColor:'green', - borderWidth:2, - borderRadius:10, - paddingVertical:10, - paddingHorizontal:5, - margin:10 + postClass: { + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + paddingVertical: 10, + paddingHorizontal: 5, + margin: 10, }, purchaseContainer: { - backgroundColor: '#007112', + backgroundColor: "#007112", borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(14), shadowColor: theme.colors.black, @@ -754,12 +750,12 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), marginHorizontal: 45, - marginBottom:25 + marginBottom: 25, }, titleTwo: { fontFamily: theme.fontType.medium, @@ -771,87 +767,87 @@ export const createStyleSheet = (theme: ThemeProps) => { width: normalScale(30), marginLeft: normalScale(10), }, - gratiescontainer:{ - height:180, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - bottom:15, - margin:16, - padding:10 - }, - gratiesTitle:{ + gratiescontainer: { + height: 180, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + bottom: 15, + margin: 16, + padding: 10, + }, + gratiesTitle: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font16, color: theme.colors.black, - marginBottom:10, - textAlign:'center' + marginBottom: 10, + textAlign: "center", }, - gratisimg:{ - height:45, - width:45 + gratisimg: { + height: 45, + width: 45, }, - gratistext:{ + gratistext: { fontFamily: theme.fontType.bold, fontSize: theme.fontSize.font14, color: theme.colors.black, - fontWeight:'600', - }, - gratisCont:{ - flexDirection:'row', - marginVertical:5, - marginRight:20, - position:'absolute', - right:-10, - }, - commentInput:{ - height:40, - width:width-90, - backgroundColor:'lightgray', - borderRadius:12, - paddingVertical:5, - marginVertical:10, - marginHorizontal:10, - padding:10 - }, - commentContainer:{ - height:200, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - margin:20, - padding:10, + fontWeight: "600", + }, + gratisCont: { + flexDirection: "row", + marginVertical: 5, + marginRight: 20, + position: "absolute", + right: -10, + }, + commentInput: { + height: 40, + width: width - 90, + backgroundColor: "lightgray", + borderRadius: 12, + paddingVertical: 5, + marginVertical: 10, + marginHorizontal: 10, + padding: 10, + }, + commentContainer: { + height: 200, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + margin: 20, + padding: 10, // justifyContent:'center' }, - createPostContTwo:{ - flexDirection:'row', - alignItems : 'flex-start' + createPostContTwo: { + flexDirection: "row", + alignItems: "flex-start", }, - textTwoWhere:{ + textTwoWhere: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:3, - fontWeight:'600', - paddingTop : 9 + marginRight: 3, + fontWeight: "600", + paddingTop: 9, }, - createImgTwo:{ - height:20, - width:20, - marginTop : 8, - marginHorizontal:5 + createImgTwo: { + height: 20, + width: 20, + marginTop: 8, + marginHorizontal: 5, }, keyboardView: { - position: 'absolute', + position: "absolute", // top:650, bottom: 0, left: 0, right: 0, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, @@ -861,6 +857,5 @@ export const createStyleSheet = (theme: ThemeProps) => { gesture: { flex: 1, }, - }); }; diff --git a/src/screens/createPost/gratis.tsx b/src/screens/createPost/gratis.tsx index e6b83ea41..4327d0a2c 100644 --- a/src/screens/createPost/gratis.tsx +++ b/src/screens/createPost/gratis.tsx @@ -1,6 +1,6 @@ -import React, {useEffect, useRef, useState} from 'react'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; +import React, { useEffect, useRef, useState } from "react"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; import { Alert, FlatList, @@ -12,9 +12,9 @@ import { TextInput, TouchableOpacity, View, -} from 'react-native'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {ImageComponent} from '@components/image-component'; +} from "react-native"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ImageComponent } from "@components/image-component"; import { Gratis, addGreen, @@ -33,41 +33,44 @@ import { plus, postCalender, request, -} from '@assets/images'; -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import moment from 'moment'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; -import GetLocation from 'react-native-get-location'; -import Popover, {PopoverPlacement, Rect} from 'react-native-popover-view'; -import {SizedBox} from '@components/sized-box'; -import {verticalScale} from '@theme/device/normalize'; +} from "@assets/images"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import moment from "moment"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import GetLocation from "react-native-get-location"; +import Popover, { PopoverPlacement, Rect } from "react-native-popover-view"; +import { SizedBox } from "@components/sized-box"; +import { verticalScale } from "@theme/device/normalize"; import { DatePickerRefProps, DateRangePicker, -} from '@components/date-range-picker'; -import {launchImageLibrary} from 'react-native-image-picker'; -import {GooglePlacesAutocomplete} from 'react-native-google-places-autocomplete'; -import Toast from 'react-native-simple-toast'; -import {Loader} from '@components/loader'; -import {navigations} from '@config/app-navigation/constant'; -import {ScrollView} from 'react-native'; -import {Pill} from '@components/pill'; -import {FlatListComponent} from '@components/flatlist-component'; -import {width} from '@theme/device/device'; -import { API_URL } from '@network/constant'; +} from "@components/date-range-picker"; +import { launchImageLibrary } from "react-native-image-picker"; +import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; +import Toast from "react-native-simple-toast"; +import { Loader } from "@components/loader"; +import { navigations } from "@config/app-navigation/constant"; +import { ScrollView } from "react-native"; +import { Pill } from "@components/pill"; +import { FlatListComponent } from "@components/flatlist-component"; +import { width } from "@theme/device/device"; +import { API_URL } from "@network/constant"; interface CreatePostGratisScreenProps { navigation?: NavigationContainerRef; } export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { - const {navigation} = props || {}; - const {theme} = useAppTheme(); + const { navigation } = props || {}; + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const [selecttype, createPostSelectType] = useState(1); - const [type, createPostType] = useState('offer'); + const [type, createPostType] = useState("offer"); const [typeIconWhat, getTypeIconWhat]: any = useState(); const [showWhatPopover, setWhatShowPopover] = useState(false); const [getResourcewhatList, getResourseDatawhat]: any = useState([]); @@ -76,17 +79,17 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { const [getResourceForLis, getResourseDataFor]: any = useState([]); const [whatSelectType, getWhatTypeValue]: any = useState(); const [postImage, setCreatePostUri]: any = useState([]); - const [forName, createPostforName] = useState(''); - const [forQuantity, createPostforQuantity] = useState(''); - const [whereAddress, createPostwhereAddress] = useState(''); + const [forName, createPostforName] = useState(""); + const [forQuantity, createPostforQuantity] = useState(""); + const [whereAddress, createPostwhereAddress] = useState(""); const [imageKey, selectedImageKey] = useState(); const [when, createPostwhen] = useState(new Date()); - const [content, createPostcontent] = useState(''); - const [tags, createPosttags]: any = useState(''); + const [content, createPostcontent] = useState(""); + const [tags, createPosttags]: any = useState(""); const [tagArray, tagselectArray]: any = useState([]); - const [whatName, createPostwhatName] = useState(''); - const [addnewCmt, onAddComment] = useState(''); - const [addnewCmtReply, onAddCommentReply] = useState(''); + const [whatName, createPostwhatName] = useState(""); + const [addnewCmt, onAddComment] = useState(""); + const [addnewCmtReply, onAddCommentReply] = useState(""); var [whatQuantity, createPostwhatQuantity] = useState(1); const [typeIconTo, getTypeIconTo]: any = useState(); const [typrTovalue, getToTypeValue]: any = useState(); @@ -98,9 +101,9 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { const [userList, recentlyJoinUser]: any = useState([]); const [userListArray, setuserListArray]: any = useState([]); const [imageArray, setImageArray]: any = useState([]); - const [imageArrayKey, setImageArrayKey]:any = useState([]); + const [imageArrayKey, setImageArrayKey]: any = useState([]); var [gratisNo, totalGratisData]: any = useState(1); - const [usertext, onUserSearch] = useState(''); + const [usertext, onUserSearch] = useState(""); const datePickerRef: React.Ref = useRef(null); const keyboardDismiss = () => { @@ -131,39 +134,36 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { const onConfirmStartDateTime = (startDate: Date) => { console.log(startDate); createPostwhen(startDate); - datePickerRef.current?.onOpenModal('end'); + datePickerRef.current?.onOpenModal("end"); }; const getResourcesAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch( - API_URL + '/v1/posts/resources', - { - method: 'get', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - }, - ); + const response = await fetch(API_URL + "/v1/posts/resources", { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + }); const dataItem = await response.json(); console.log( - '-------------------Get Resources API Response---------------------', + "-------------------Get Resources API Response---------------------" ); console.log(dataItem); getResourseDatawhat(dataItem?.data?.what); getResourseDataTo(dataItem?.data?.to); getResourseDataFrom(dataItem?.data?.from); getResourseDataFor(dataItem?.data?.For); - getTypeIconWhat(dataItem?.data?.what[0]['icon']); - createPostwhatName(dataItem?.data?.what[0]['title']) - getTypeIconTo(dataItem?.data?.to[0]['icon']); - getToTypeValue(dataItem?.data?.to[0]['value']); - getWhatTypeValue(dataItem?.data?.what[0]['value']); + getTypeIconWhat(dataItem?.data?.what[0]["icon"]); + createPostwhatName(dataItem?.data?.what[0]["title"]); + getTypeIconTo(dataItem?.data?.to[0]["icon"]); + getToTypeValue(dataItem?.data?.to[0]["value"]); + getWhatTypeValue(dataItem?.data?.what[0]["value"]); console.log( - dataItem?.data[0]['icon'], - '------------icon image--------------', + dataItem?.data[0]["icon"], + "------------icon image--------------" ); } catch (error) { console.error(error); @@ -171,36 +171,33 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { }; const postImageUploadAPI = async (fileItem: any, base64Item: any) => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var pic: any = { - uploadKey: 'createPostImg', + uploadKey: "createPostImg", imageName: fileItem, - base64String: 'data:image/jpeg;base64,' + base64Item, + base64String: "data:image/jpeg;base64," + base64Item, }; - console.log('================ postImageUploadAPI Request================='); + console.log("================ postImageUploadAPI Request================="); console.log(pic); try { - const response = await fetch( - API_URL + '/v1/users/upload/file', - { - method: 'post', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - body: JSON.stringify(pic), - }, - ); + const response = await fetch(API_URL + "/v1/users/upload/file", { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + body: JSON.stringify(pic), + }); const dataItem = await response.json(); - console.log('-----------------Response------------'); + console.log("-----------------Response------------"); var tempData = imageArray; tempData.push(dataItem?.data); setImageArray(tempData); var tempTwo = imageArrayKey; - tempTwo.push(dataItem?.data?.key) + tempTwo.push(dataItem?.data?.key); setImageArrayKey(tempTwo); // setCreatePostUri(dataItem?.data?.imageUrl); // selectedImageKey(dataItem?.data?.key); @@ -214,9 +211,9 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { async function createPostAPI() { LodingData(true); - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var data: any = { - type: 'gratis', + type: "gratis", what_type: whatSelectType, what_name: whatName, what_quantity: whatQuantity, @@ -227,28 +224,25 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { post_image: imageArrayKey, }; - console.log('=========== Create Post API Request =============='); + console.log("=========== Create Post API Request =============="); console.log(data); try { - const response = await fetch( - API_URL + '/v1/posts/create', - { - method: 'post', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - Accept: 'application/json', - }), - body: JSON.stringify(data), - }, - ); + const response = await fetch(API_URL + "/v1/posts/create", { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + Accept: "application/json", + }), + body: JSON.stringify(data), + }); const dataItem = await response.json(); - console.log('=========== Create Post API Response =============='); + console.log("=========== Create Post API Response =============="); console.log(dataItem); LodingData(false); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); if (dataItem?.success === true) { navigation?.goBack(); @@ -262,38 +256,34 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { } async function gratisUserList(textUser: any) { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var datas: any = { searchtext: textUser, }; onUserSearch(textUser); - LodingData(true) - console.log('=========== User List Gratis API Request =============='); + LodingData(true); + console.log("=========== User List Gratis API Request =============="); console.log(datas); - console.log( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, - ); + console.log(API_URL + "/v1/users/search-user?searchtext=" + textUser); try { const response = await fetch( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, + API_URL + "/v1/users/search-user?searchtext=" + textUser, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", }), - }, + } ); const dataItem = await response.json(); - console.log('=========== User List Gratis API Response =============='); + console.log("=========== User List Gratis API Response =============="); const result = dataItem?.data?.map((item: any) => { - return {...item, gratisNo: 1}; + return { ...item, gratisNo: 1 }; }); userGratiesListData(result); console.log(dataItem); - LodingData(false) + LodingData(false); } catch (error) { LodingData(false); console.error(error); @@ -301,8 +291,8 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { } const GallerySelect = async () => { - const {assets} = await launchImageLibrary({ - mediaType: 'photo', + const { assets } = await launchImageLibrary({ + mediaType: "photo", // selectionLimit: 2, includeBase64: true, maxWidth: 800, @@ -311,20 +301,20 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { console.log(assets); if (assets) { const img = assets?.[0]; - console.log('---------------assets Gallery 222---------------'); + console.log("---------------assets Gallery 222---------------"); console.log(assets); - var fileNameTwo = img?.fileName ?? ''; + var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = - fileNameTwo.substr(0, fileNameTwo.lastIndexOf('.')) || fileNameTwo; - var base64Two = img?.base64 ?? ''; + fileNameTwo.substr(0, fileNameTwo.lastIndexOf(".")) || fileNameTwo; + var base64Two = img?.base64 ?? ""; postImageUploadAPI(output, base64Two); } }; const removeuserSelect = (id: any) => { const newPeople = userList.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); recentlyJoinUser(newPeople); setuserListArray(newPeople); @@ -332,28 +322,28 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { const CreateNewPostModal = () => { if (whatName?.length === 0) { - Toast.show('Enter About What', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About What", Toast.LONG, { + backgroundColor: "black", }); - // } else if (whatQuantity.length === 0) { - // Toast.show('Enter What Quantity', Toast.LONG, { - // backgroundColor: 'black', - // }); - // } else if (userList.length === 0) { - // Toast.show('Add User', Toast.LONG, { - // backgroundColor: 'black', - // }); + // } else if (whatQuantity.length === 0) { + // Toast.show('Enter What Quantity', Toast.LONG, { + // backgroundColor: 'black', + // }); + // } else if (userList.length === 0) { + // Toast.show('Add User', Toast.LONG, { + // backgroundColor: 'black', + // }); } else if (content?.length === 0) { - Toast.show('Enter Post Content', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Content", Toast.LONG, { + backgroundColor: "black", }); } else if (tagArray?.length === 0) { - Toast.show('Enter Post Tag', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Tag", Toast.LONG, { + backgroundColor: "black", }); } else if (imageArray?.length === 0) { - Toast.show('Add Image to Post', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Add Image to Post", Toast.LONG, { + backgroundColor: "black", }); } else { createPostAPI(); @@ -386,7 +376,7 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { } }; - const renderItem: ListRenderItem = ({item}) => ( + const renderItem: ListRenderItem = ({ item }) => ( handleRemove(item)} pillStyle={styles.marginBottom} @@ -396,31 +386,32 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { ); const removeSelectImage = (imageItem: any) => { - console.log(imageItem, 'image url') - console.log(imageArrayKey) + console.log(imageItem, "image url"); + console.log(imageArrayKey); const newImage = imageArray.filter( - (person: any) => person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key + (person: any) => + person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key ); setImageArray(newImage); const newImagekey = imageArrayKey.filter( (person: any) => person !== imageItem?.key ); - setImageArrayKey(newImagekey) - console.log(imageArrayKey) - } + setImageArrayKey(newImagekey); + console.log(imageArrayKey); + }; const handleRemove = (id: any) => { const newPeople = tagArray.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); tagselectArray(newPeople); }; const onAddSkill = (text: any) => { - if (text !== '' && text !== undefined) { + if (text !== "" && text !== undefined) { tagselectArray([...tagArray, text]); - console.log('onSubmitEditing onSubmitEditing', tags, tagArray, text); - createPosttags(''); + console.log("onSubmitEditing onSubmitEditing", tags, tagArray, text); + createPosttags(""); } }; @@ -441,41 +432,43 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { // } const AddUserList = (item: any) => { - const found = userList.find((element:any) => element.id == item.id); + const found = userList.find((element: any) => element.id == item.id); if (!found) { - recentlyJoinUser([...userList, item]); - - const newItems = {...item}; + recentlyJoinUser([...userList, item]); + + const newItems = { ...item }; delete newItems.first_name; delete newItems.last_name; delete newItems.pic; delete newItems.id; delete newItems.gratisNo; console.log(item.gratisNo); - const newuserData = {...newItems, point: item.gratisNo, user_id: item.id}; + const newuserData = { + ...newItems, + point: item.gratisNo, + user_id: item.id, + }; setuserListArray([...userListArray, newuserData]); - + console.log(userListArray); - }else{ - Toast.show('Already Added', Toast.LONG, { - backgroundColor: 'black', + } else { + Toast.show("Already Added", Toast.LONG, { + backgroundColor: "black", }); } - - }; const whatQtyMinus = () => { - if(whatQuantity > 1){ - whatQuantity = whatQuantity - 1 - createPostwhatQuantity(whatQuantity) + if (whatQuantity > 1) { + whatQuantity = whatQuantity - 1; + createPostwhatQuantity(whatQuantity); } - } + }; const whatQtyPlus = () => { - whatQuantity = whatQuantity + 1 - createPostwhatQuantity(whatQuantity) - } + whatQuantity = whatQuantity + 1; + createPostwhatQuantity(whatQuantity); + }; return ( <> @@ -483,11 +476,13 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { + showsVerticalScrollIndicator={false} + > + style={styles.createPostModal} + > @@ -497,10 +492,11 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { placeholderTextColor="darkgray" value={whatName} editable={false} - onChangeText={text => createPostwhatName(text)} - style={styles.postInputTwo}> - {/* */} - + onChangeText={(text) => createPostwhatName(text)} + style={styles.postInputTwo} + > + {/* */} + - @@ -509,18 +505,18 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { + - + setWhatShowPopover(true)} - > + > + source={{ uri: typeIconWhat }} + style={styles.createImgOne} + > - @@ -529,30 +525,32 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { multiline placeholder="What do you want to say?" placeholderTextColor="darkgray" - textAlignVertical={'top'} + textAlignVertical={"top"} value={content} - onChangeText={text => createPostcontent(text)} - style={styles.postinput}> + onChangeText={(text) => createPostcontent(text)} + style={styles.postinput} + > - + To: - + gratisUserList(text)} - style={styles.postInputToType}> - + onChangeText={(text) => gratisUserList(text)} + style={styles.postInputToType} + > + + source={{ uri: typeIconTo }} + style={styles.createImgOne} + > - @@ -560,16 +558,19 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { + showsHorizontalScrollIndicator={false} + > {userList.map((userList: any) => { return ( removeuserSelect(userList)}> + onPress={() => removeuserSelect(userList)} + > + uri={userList?.pic} + > ); })} @@ -583,24 +584,28 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { marginVertical: 10, borderRadius: 10, maxHeight: 275, - overflow: 'hidden', - height: 'auto', - }}> + overflow: "hidden", + height: "auto", + }} + > ( + renderItem={({ item, index }) => ( - + }} + > + { borderRadius: 100, }} resizeMode="cover" - source={{uri: item?.pic}}> - + source={{ uri: item?.pic }} + > + {item?.first_name} {item?.last_name} gratisMinusClick(item, index)}> + onPress={() => gratisMinusClick(item, index)} + > + }} + > {item?.gratisNo} gratisPlusClick(item, index)}> + onPress={() => gratisPlusClick(item, index)} + > + }} + > - AddUserList(item)}> + AddUserList(item)}> + source={buttonArrowGreen} + > - )}> + )} + > ) : ( )} - Tags createPosttags(text)} - style={styles.tagInput}> + onChangeText={(text) => createPosttags(text)} + style={styles.tagInput} + > - {tags !== '' ? ( + {tags !== "" ? ( { onAddSkill(tags); - }}> + }} + > + source={addGreen} + > ) : ( @@ -685,7 +706,7 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { item.toString()} + keyExtractor={(item) => item.toString()} renderItem={renderItem} numColumns={100} showsHorizontalScrollIndicator={false} @@ -694,7 +715,8 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { + style={styles.imagesCont} + > Image + add images @@ -703,10 +725,12 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { {imageArray.map((item: any) => { return ( - removeSelectImage(item)} - > - + removeSelectImage(item)}> + + ); })} @@ -715,7 +739,8 @@ export const CreatePostGratisScreen = (props: CreatePostGratisScreenProps) => { + style={styles.purchaseContainer} + > {strings.postOffer} ; } export const CreatePostScreen = (props: CreatePostScreenProps) => { - - const {navigation} = props || {}; - const {theme} = useAppTheme(); + const { navigation } = props || {}; + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); - const [selecttype, createPostSelectType] = useState(getData('POST_TAB_OPEN_INDEX')); - console.log('selectType', selecttype); - const [type, createPostType] = useState('offer'); + const { strings } = useStringsAndLabels(); + const [selecttype, createPostSelectType] = useState( + getData("POST_TAB_OPEN_INDEX") + ); + console.log("selectType", selecttype); + const [type, createPostType] = useState("offer"); const [typeIconWhat, getTypeIconWhat]: any = useState(); const [showWhatPopover, setWhatShowPopover] = useState(false); const [getResourceList, getResourseData]: any = useState([]); const [whatSelectType, getWhatTypeValue]: any = useState(); const [postImage, setCreatePostUri]: any = useState([]); - const [forName, createPostforName] = useState(''); - const [forQuantity, createPostforQuantity] = useState(''); - const [whereAddress, createPostwhereAddress] = useState(''); + const [forName, createPostforName] = useState(""); + const [forQuantity, createPostforQuantity] = useState(""); + const [whereAddress, createPostwhereAddress] = useState(""); const [imageKey, selectedImageKey] = useState(); const [when, createPostwhen] = useState(new Date()); - const [content, createPostcontent] = useState(''); - const [tags, createPosttags] = useState(''); - const [whatName, createPostwhatName] = useState(''); - const [addnewCmt, onAddComment] = useState(''); + const [content, createPostcontent] = useState(""); + const [tags, createPosttags] = useState(""); + const [whatName, createPostwhatName] = useState(""); + const [addnewCmt, onAddComment] = useState(""); const [typeIconFor, getTypeIconFor]: any = useState(); const [whatForType, getForTypeValue]: any = useState(); const [showForPopover, setForShowPopover] = useState(false); const [isLoading, LodingData] = useState(false); var [location, setUserLocation]: any = useState(); - const datePickerRef: React.Ref = useRef(null); - const {user} = useSelector( - state => state.userProfileReducer, - ) as {user: {id: string; pic: string; city: string; state: string}}; - const {refetch} = useUserProfile({ + const datePickerRef: React.Ref = useRef(null); + const { user } = useSelector( + (state) => state.userProfileReducer + ) as { user: { id: string; pic: string; city: string; state: string } }; + const { refetch } = useUserProfile({ userId: user?.id, }); @@ -127,35 +131,32 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { const onConfirmStartDateTime = (startDate: Date) => { console.log(startDate); createPostwhen(startDate); - datePickerRef.current?.onOpenModal('end'); + datePickerRef.current?.onOpenModal("end"); }; const getResourcesAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch( - API_URL + '/v1/posts/resources', - { - method: 'get', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', - }), - }, - ); + const response = await fetch(API_URL + "/v1/posts/resources", { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", + }), + }); const dataItem = await response.json(); console.log( - '-------------------Get Resources API Response---------------------', + "-------------------Get Resources API Response---------------------" ); console.log(dataItem); getResourseData(dataItem?.data); - getTypeIconWhat(dataItem?.data[0]['icon']); - getTypeIconFor(dataItem?.data[0]['icon']); - getForTypeValue(dataItem?.data[0]['value']); - getWhatTypeValue(dataItem?.data[0]['value']); + getTypeIconWhat(dataItem?.data[0]["icon"]); + getTypeIconFor(dataItem?.data[0]["icon"]); + getForTypeValue(dataItem?.data[0]["value"]); + getWhatTypeValue(dataItem?.data[0]["value"]); console.log( - dataItem?.data[0]['icon'], - '------------icon image--------------', + dataItem?.data[0]["icon"], + "------------icon image--------------" ); } catch (error) { console.error(error); @@ -163,29 +164,26 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { }; const postImageUploadAPI = async (fileItem: any, base64Item: any) => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var pic: any = { - uploadKey: 'createPostImg', + uploadKey: "createPostImg", imageName: fileItem, - base64String: 'data:image/jpeg;base64,' + base64Item, + base64String: "data:image/jpeg;base64," + base64Item, }; - console.log('================ postImageUploadAPI Request================='); + console.log("================ postImageUploadAPI Request================="); console.log(pic); try { - const response = await fetch( - API_URL + '/v1/users/upload/file', - { - method: 'post', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - body: JSON.stringify(pic), - }, - ); + const response = await fetch(API_URL + "/v1/users/upload/file", { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + body: JSON.stringify(pic), + }); const dataItem = await response.json(); - console.log('-----------------Response------------'); + console.log("-----------------Response------------"); setCreatePostUri(dataItem?.data?.imageUrl); selectedImageKey(dataItem?.data?.key); console.log(dataItem); @@ -196,14 +194,13 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { } }; - const onBackPress = () => { navigation?.goBack(); }; const GallerySelect = async () => { - const {assets} = await launchImageLibrary({ - mediaType: 'photo', + const { assets } = await launchImageLibrary({ + mediaType: "photo", // selectionLimit: 2, includeBase64: true, maxWidth: 800, @@ -212,18 +209,17 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { console.log(assets); if (assets) { const img = assets?.[0]; - console.log('---------------assets Gallery 222---------------'); + console.log("---------------assets Gallery 222---------------"); console.log(assets); - var fileNameTwo = img?.fileName ?? ''; + var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = - fileNameTwo.substr(0, fileNameTwo.lastIndexOf('.')) || fileNameTwo; - var base64Two = img?.base64 ?? ''; + fileNameTwo.substr(0, fileNameTwo.lastIndexOf(".")) || fileNameTwo; + var base64Two = img?.base64 ?? ""; postImageUploadAPI(output, base64Two); } }; - const onNavigateToProfile = () => { navigation?.navigate(navigations.PROFILE); }; @@ -242,7 +238,7 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { <> - + @@ -258,10 +254,11 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { + source={onelogo} + > NE - L o c a l + L o c a l @@ -271,7 +268,8 @@ export const CreatePostScreen = (props: CreatePostScreenProps) => { + style={styles.profileView} + > { - + showsVerticalScrollIndicator={false} + > + createPostSetType(1, 'offer')}> + onPress={() => createPostSetType(1, "offer")} + > { createPostSetType(2, 'request')}> + onPress={() => createPostSetType(2, "request")} + > { createPostSetType(3, 'gratis')}> + onPress={() => createPostSetType(3, "gratis")} + > ; @@ -65,12 +68,12 @@ interface Range { } export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { - const {navigation} = props || {}; - const {theme} = useAppTheme(); + const { navigation } = props || {}; + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const [selecttype, createPostSelectType] = useState(1); - const [type, createPostType] = useState('offer'); + const [type, createPostType] = useState("offer"); const [typeIconWhat, getTypeIconWhat]: any = useState(); const [showWhatPopover, setWhatShowPopover] = useState(false); const [showToPopover, setToShowPopover] = useState(false); @@ -80,24 +83,24 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { const [getResourceForLis, getResourseDataFor]: any = useState([]); const [whatSelectType, getWhatTypeValue]: any = useState(); const [imageArray, setImageArray]: any = useState([]); - const [imageArrayKey, setImageArrayKey]:any = useState([]); - const [forName, createPostforName] = useState(''); + const [imageArrayKey, setImageArrayKey]: any = useState([]); + const [forName, createPostforName] = useState(""); var [forQuantity, createPostforQuantity] = useState(1); - const [whereAddress, createPostwhereAddress] = useState(''); + const [whereAddress, createPostwhereAddress] = useState(""); const [settoTitle, setToTitleData]: any = useState(); const [whenDate, createPostwhen]: any = useState(new Date()); - const [content, createPostcontent] = useState(''); - const [tags, createPosttags]: any = useState(''); + const [content, createPostcontent] = useState(""); + const [tags, createPosttags]: any = useState(""); const [tagArray, tagselectArray]: any = useState([]); - const [whatName, createPostwhatName] = useState(''); - const [addnewCmt, onAddComment] = useState(''); - const [addnewCmtReply, onAddCommentReply] = useState(''); + const [whatName, createPostwhatName] = useState(""); + const [addnewCmt, onAddComment] = useState(""); + const [addnewCmtReply, onAddCommentReply] = useState(""); var [whatQuantity, createPostwhatQuantity] = useState(1); const [typeIconFor, getTypeIconFor]: any = useState(); const [whatForType, getForTypeValue]: any = useState(); const [icontotype, getTypeIconTo]: any = useState(); - const [valueTotype, getToTypeValue] = useState(''); - const [toname, getToTypename] = useState(''); + const [valueTotype, getToTypeValue] = useState(""); + const [toname, getToTypename] = useState(""); const [iconFrom, getTypeIconFrom]: any = useState(); const [typrFrom, getFromTypeValue]: any = useState(); const [showForPopover, setForShowPopover] = useState(false); @@ -107,7 +110,7 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { var [gratisNo, totalGratisData]: any = useState(1); const [userList, recentlyJoinUser]: any = useState([]); const [userListArray, setuserListArray]: any = useState([]); - const [usertext, onUserSearch] = useState(''); + const [usertext, onUserSearch] = useState(""); const [open, setOpen] = useState(false); var [location, setUserLocation]: any = useState(); var makeDate = new Date(); @@ -140,7 +143,7 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { const selectToTypePost = (icon: any, type: any, title: any) => { getTypeIconTo(icon); - if (title === 'Everyone') { + if (title === "Everyone") { setToTitleData(title); } else { setToTitleData(); @@ -158,47 +161,47 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { const onConfirmStartDateTime = (startDate: Date) => { console.log(startDate); createPostwhen(startDate); - datePickerRef.current?.onOpenModal('end'); + datePickerRef.current?.onOpenModal("end"); }; const getResourcesAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch(API_URL + '/v1/posts/resources', { - method: 'get', + const response = await fetch(API_URL + "/v1/posts/resources", { + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), }); const dataItem = await response.json(); - console.log(API_URL + '/v1/posts/resources'); + console.log(API_URL + "/v1/posts/resources"); console.log( - '-------------------Get Resources API Response---------------------', + "-------------------Get Resources API Response---------------------" ); console.log(dataItem); console.log(dataItem?.data?.to); - + getResourseDatawhat(dataItem?.data?.what); getResourseDataTo(dataItem?.data?.to); getResourseDataFrom(dataItem?.data?.from); getResourseDataFor(dataItem?.data?.for); - getTypeIconWhat(dataItem?.data?.what[0]['icon']); - getWhatTypeValue(dataItem?.data?.what[0]['value']); + getTypeIconWhat(dataItem?.data?.what[0]["icon"]); + getWhatTypeValue(dataItem?.data?.what[0]["value"]); - getTypeIconFor(dataItem?.data?.for[0]['icon']); - getForTypeValue(dataItem?.data?.for[0]['value']); + getTypeIconFor(dataItem?.data?.for[0]["icon"]); + getForTypeValue(dataItem?.data?.for[0]["value"]); - getTypeIconTo(dataItem?.data?.to[0]['icon']); - setToTitleData(dataItem?.data?.to[0]['title']); - getToTypeValue(dataItem?.data?.to[0]['value']); + getTypeIconTo(dataItem?.data?.to[0]["icon"]); + setToTitleData(dataItem?.data?.to[0]["title"]); + getToTypeValue(dataItem?.data?.to[0]["value"]); - getTypeIconFrom(dataItem?.data?.from[0]['icon']); - getFromTypeValue(dataItem?.data?.from[0]['value']); + getTypeIconFrom(dataItem?.data?.from[0]["icon"]); + getFromTypeValue(dataItem?.data?.from[0]["value"]); console.log( - dataItem?.data[0]['icon'], - '------------icon image--------------', + dataItem?.data[0]["icon"], + "------------icon image--------------" ); } catch (error) { console.error(error); @@ -206,32 +209,32 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { }; const postImageUploadAPI = async (fileItem: any, base64Item: any) => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var pic: any = { - uploadKey: 'createPostImg', + uploadKey: "createPostImg", imageName: fileItem, - base64String: 'data:image/jpeg;base64,' + base64Item, + base64String: "data:image/jpeg;base64," + base64Item, }; - console.log('================ postImageUploadAPI Request================='); + console.log("================ postImageUploadAPI Request================="); console.log(pic); try { - const response = await fetch(API_URL + '/v1/users/upload/file', { - method: 'post', + const response = await fetch(API_URL + "/v1/users/upload/file", { + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), body: JSON.stringify(pic), }); const dataItem = await response.json(); - console.log('-----------------Response------------'); + console.log("-----------------Response------------"); var tempData = imageArray; tempData.push(dataItem?.data); setImageArray(tempData); var tempTwo = imageArrayKey; - tempTwo.push(dataItem?.data?.key) + tempTwo.push(dataItem?.data?.key); setImageArrayKey(tempTwo); LodingData(false); } catch (error) { @@ -240,12 +243,12 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { } }; - async function createPostAPI() { - console.log('1111111'); + async function createPostAPI() { + console.log("1111111"); LodingData(true); - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var data = { - type: 'offer', + type: "offer", what_type: whatSelectType, what_name: whatName, what_quantity: whatQuantity, @@ -260,29 +263,29 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { tags: tagArray, post_image: imageArrayKey, to_type: valueTotype, - to_offer_users:userListArray + to_offer_users: userListArray, }; - console.log('=========== Create Post API Request =============='); + console.log("=========== Create Post API Request =============="); console.log(data); try { - console.log('222222'); + console.log("222222"); - const response = await fetch(API_URL + '/v1/posts/create', { - method: 'post', + const response = await fetch(API_URL + "/v1/posts/create", { + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - Accept: 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", + Accept: "application/json", }), body: JSON.stringify(data), }); const dataItem = await response.json(); - console.log('=========== Create Post API Response =============='); + console.log("=========== Create Post API Response =============="); console.log(dataItem); LodingData(false); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); if (dataItem?.success === true) { navigation?.goBack(); @@ -290,7 +293,7 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { // postListAPI(); } catch (error) { - console.log('33333'); + console.log("33333"); LodingData(false); console.error(error); @@ -302,8 +305,8 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { }; const GallerySelect = async () => { - const {assets} = await launchImageLibrary({ - mediaType: 'photo', + const { assets } = await launchImageLibrary({ + mediaType: "photo", // selectionLimit: 2, includeBase64: true, maxWidth: 800, @@ -312,13 +315,13 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { console.log(assets); if (assets) { const img = assets?.[0]; - console.log('---------------assets Gallery 222---------------'); + console.log("---------------assets Gallery 222---------------"); console.log(assets); - var fileNameTwo = img?.fileName ?? ''; + var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = - fileNameTwo.substr(0, fileNameTwo.lastIndexOf('.')) || fileNameTwo; - var base64Two = img?.base64 ?? ''; + fileNameTwo.substr(0, fileNameTwo.lastIndexOf(".")) || fileNameTwo; + var base64Two = img?.base64 ?? ""; postImageUploadAPI(output, base64Two); } }; @@ -329,55 +332,55 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { const onConfirm = useCallback( (res: Range) => { - console.log(res, '--------------date pick------------'); + console.log(res, "--------------date pick------------"); const startDate = res?.startDate; const endDate = res?.endDate; setOpen(false); - setRange({startDate, endDate}); - console.log(range, '---------------set range ---------------'); + setRange({ startDate, endDate }); + console.log(range, "---------------set range ---------------"); }, - [setOpen, setRange], + [setOpen, setRange] ); const CreateNewPostModal = () => { if (whatName.length === 0) { - Toast.show('Enter About What', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About What", Toast.LONG, { + backgroundColor: "black", }); // } else if (whatQuantity.length === 0) { // Toast.show('Enter What Quantity', Toast.LONG, { // backgroundColor: 'black', // }); } else if (forName.length === 0) { - Toast.show('Enter About For', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About For", Toast.LONG, { + backgroundColor: "black", }); } else if (valueTotype.length === 0) { - Toast.show('Enter About To', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About To", Toast.LONG, { + backgroundColor: "black", }); // } else if (forQuantity.length === 0) { // Toast.show('Enter For Quantity', Toast.LONG, { // backgroundColor: 'black', // }); } else if (whereAddress.length === 0) { - Toast.show('Enter Address', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Address", Toast.LONG, { + backgroundColor: "black", }); } else if (content.length === 0) { - Toast.show('Enter Post Content', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Content", Toast.LONG, { + backgroundColor: "black", }); } else if (tagArray.length === 0) { - Toast.show('Enter Post Tag', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Tag", Toast.LONG, { + backgroundColor: "black", }); } else if (imageArray.length === 0) { - Toast.show('Add Image to Post', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Add Image to Post", Toast.LONG, { + backgroundColor: "black", }); } else { - console.log('create post api call'); + console.log("create post api call"); createPostAPI(); } // } else { @@ -395,7 +398,7 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { // navigation?.navigate(navigations.PROFILE); // }; - const renderItem: ListRenderItem = ({item}) => ( + const renderItem: ListRenderItem = ({ item }) => ( handleRemove(item)} pillStyle={styles.marginBottom} @@ -406,16 +409,16 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { const handleRemove = (id: any) => { const newPeople = tagArray.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); tagselectArray(newPeople); }; const onAddSkill = (text: any) => { - if (text !== '' && text !== undefined) { + if (text !== "" && text !== undefined) { tagselectArray([...tagArray, text]); - console.log('onSubmitEditing onSubmitEditing', tags, tagArray, text); - createPosttags(''); + console.log("onSubmitEditing onSubmitEditing", tags, tagArray, text); + createPosttags(""); } }; @@ -444,35 +447,35 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { }; async function gratisUserList(textUser: any) { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var datas: any = { searchtext: textUser, }; onUserSearch(textUser); LodingData(true); - console.log('=========== User List Gratis API Request =============='); + console.log("=========== User List Gratis API Request =============="); console.log(datas); - console.log(API_URL + '/v1/users/search-user?searchtext=' + textUser); + console.log(API_URL + "/v1/users/search-user?searchtext=" + textUser); try { const response = await fetch( - API_URL + '/v1/users/search-user?searchtext=' + textUser, + API_URL + "/v1/users/search-user?searchtext=" + textUser, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", }), - }, + } ); const dataItem = await response.json(); - console.log('=========== User List Gratis API Response =============='); + console.log("=========== User List Gratis API Response =============="); const result = dataItem?.data?.map((item: any) => { - return {...item, gratisNo: 1}; + return { ...item, gratisNo: 1 }; }); userGratiesListData(result); console.log(dataItem); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); LodingData(false); } catch (error) { @@ -483,56 +486,59 @@ export const CreatePostOfferScreen = (props: CreatePostOfferScreenProps) => { const removeuserSelect = (id: any) => { const newPeople = userList.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); recentlyJoinUser(newPeople); setuserListArray(newPeople); }; const AddUserList = (item: any) => { - const found = userList.find((element:any) => element.id == item.id); + const found = userList.find((element: any) => element.id == item.id); if (!found) { - recentlyJoinUser([...userList, item]); - const newItems = {...item}; - delete newItems.first_name; - delete newItems.last_name; - delete newItems.pic; - delete newItems.id; - delete newItems.gratisNo; - console.log(item.gratisNo); - setuserListArray([...userListArray, item.id]); - console.log(userListArray); - } else{ - Toast.show('Already Added', Toast.LONG, { - backgroundColor: 'black', - }); - } -}; + recentlyJoinUser([...userList, item]); + const newItems = { ...item }; + delete newItems.first_name; + delete newItems.last_name; + delete newItems.pic; + delete newItems.id; + delete newItems.gratisNo; + console.log(item.gratisNo); + setuserListArray([...userListArray, item.id]); + console.log(userListArray); + } else { + Toast.show("Already Added", Toast.LONG, { + backgroundColor: "black", + }); + } + }; -const removeSelectImage = (imageItem: any) => { - console.log(imageItem, 'image url') - console.log(imageArrayKey) - const newImage = imageArray.filter( - (person: any) => person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key - ); - setImageArray(newImage); - const newImagekey = imageArrayKey.filter( - (person: any) => person !== imageItem?.key - ); - setImageArrayKey(newImagekey) - console.log(imageArrayKey) - } + const removeSelectImage = (imageItem: any) => { + console.log(imageItem, "image url"); + console.log(imageArrayKey); + const newImage = imageArray.filter( + (person: any) => + person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key + ); + setImageArray(newImage); + const newImagekey = imageArrayKey.filter( + (person: any) => person !== imageItem?.key + ); + setImageArrayKey(newImagekey); + console.log(imageArrayKey); + }; return ( <> + showsVerticalScrollIndicator={false} + > + style={styles.createPostModal} + > @@ -542,8 +548,9 @@ const removeSelectImage = (imageItem: any) => { placeholder="What do you want to offer?" placeholderTextColor="#8B8888" value={whatName} - onChangeText={text => createPostwhatName(text)} - style={styles.postInputTwo}> + onChangeText={(text) => createPostwhatName(text)} + style={styles.postInputTwo} + > - @@ -562,21 +569,24 @@ const removeSelectImage = (imageItem: any) => { + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectWhatTypePost(item?.icon, item?.value) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -584,19 +594,23 @@ const removeSelectImage = (imageItem: any) => { + }} + > - )}> + )} + > setWhatShowPopover(true)}> + onPress={() => setWhatShowPopover(true)} + > + source={{ uri: typeIconWhat }} + style={styles.createImgOne} + > @@ -608,38 +622,38 @@ const removeSelectImage = (imageItem: any) => { { createPostwhereAddress(data.description); - setUserLocation(details?.geometry?.location) + setUserLocation(details?.geometry?.location); console.log(data); console.log(details); // description }} @@ -653,7 +667,8 @@ const removeSelectImage = (imageItem: any) => { + style={styles.createImgTwo} + > {/* */} @@ -662,22 +677,26 @@ const removeSelectImage = (imageItem: any) => { createPostcontent(text)} - style={styles.postinput}> + onChangeText={(text) => createPostcontent(text)} + style={styles.postinput} + > To - {setToTitleData(text); gratisUserList(text)}} - style={styles.postInputToType}> + editable={settoTitle == "Everyone" ? false : true} + onChangeText={(text) => { + setToTitleData(text); + gratisUserList(text); + }} + style={styles.postInputToType} + > { + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectToTypePost( item?.icon, item?.value, - item?.title, + item?.title ) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} - )}> + )} + > setToShowPopover(true)}> + onPress={() => setToShowPopover(true)} + > + source={{ uri: icontotype }} + style={styles.createImgOne} + > @@ -728,47 +753,54 @@ const removeSelectImage = (imageItem: any) => { + showsHorizontalScrollIndicator={false} + > {userList.map((userList: any) => { return ( removeuserSelect(userList)}> + onPress={() => removeuserSelect(userList)} + > + uri={userList?.pic} + > ); })} - {settoTitle !== 'Everyone' ? ( + {settoTitle !== "Everyone" ? ( + overflow: "hidden", + height: "auto", + }} + > ( + renderItem={({ item, index }) => ( - + }} + > + { borderRadius: 100, }} resizeMode="cover" - source={{uri: item?.pic}}> + source={{ uri: item?.pic }} + > + color: theme.colors.black, + }} + > {item?.first_name} {item?.last_name} - AddUserList(item)}> + AddUserList(item)}> + source={buttonArrowGreen} + > - )}> + )} + > ) : ( @@ -816,8 +851,9 @@ const removeSelectImage = (imageItem: any) => { value={forName} placeholder="what reciprocity do you want?" placeholderTextColor="darkgray" - onChangeText={text => createPostforName(text)} - style={styles.postInputTwo}> + onChangeText={(text) => createPostforName(text)} + style={styles.postInputTwo} + > - @@ -836,21 +872,24 @@ const removeSelectImage = (imageItem: any) => { + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectForTypePost(item?.icon, item?.value) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -858,19 +897,23 @@ const removeSelectImage = (imageItem: any) => { + }} + > - )}> + )} + > setForShowPopover(true)}> + onPress={() => setForShowPopover(true)} + > + source={{ uri: typeIconFor }} + style={styles.createImgOne} + > @@ -879,10 +922,11 @@ const removeSelectImage = (imageItem: any) => { datePickerRef.current?.onOpenModal('start')} - style={styles.postInputTwo}> + onPress={() => datePickerRef.current?.onOpenModal("start")} + style={styles.postInputTwo} + > - {`${moment(whenDate).format('DD MMM YYYY hh:mm A')}`} + {`${moment(whenDate).format("DD MMM YYYY hh:mm A")}`} { + style={styles.calenderImage} + > @@ -902,19 +947,22 @@ const removeSelectImage = (imageItem: any) => { placeholder="add tags or people" placeholderTextColor="darkgray" value={tags} - onChangeText={text => createPosttags(text)} - style={styles.tagInput}> + onChangeText={(text) => createPosttags(text)} + style={styles.tagInput} + > - {tags !== '' ? ( + {tags !== "" ? ( { onAddSkill(tags); - }}> + }} + > + source={addGreen} + > ) : ( @@ -923,7 +971,7 @@ const removeSelectImage = (imageItem: any) => { item.toString()} + keyExtractor={(item) => item.toString()} renderItem={renderItem} numColumns={100} showsHorizontalScrollIndicator={false} @@ -932,7 +980,8 @@ const removeSelectImage = (imageItem: any) => { + style={styles.imagesCont} + > Image + add images @@ -941,14 +990,15 @@ const removeSelectImage = (imageItem: any) => { {imageArray.map((item: any) => { return ( - removeSelectImage(item)} - > - + removeSelectImage(item)}> + + ); })} - {/* @@ -1028,7 +1078,8 @@ const removeSelectImage = (imageItem: any) => { + style={styles.purchaseContainer} + > {strings.postOffer} { startDate={range.startDate} endDate={range.endDate} onConfirm={onConfirm} - validRange={{startDate: new Date()}} + validRange={{ startDate: new Date() }} editIcon="none" closeIcon={close} /> diff --git a/src/screens/createPost/request.tsx b/src/screens/createPost/request.tsx index 7709f0404..1b03a6909 100644 --- a/src/screens/createPost/request.tsx +++ b/src/screens/createPost/request.tsx @@ -1,6 +1,6 @@ -import React, {useEffect, useRef, useState} from 'react'; -import {createStyleSheet} from './style'; -import {useAppTheme} from '@app-hooks/use-app-theme'; +import React, { useEffect, useRef, useState } from "react"; +import { createStyleSheet } from "./style"; +import { useAppTheme } from "@app-hooks/use-app-theme"; import { FlatList, Image, @@ -12,9 +12,9 @@ import { TextInput, TouchableOpacity, View, -} from 'react-native'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {ImageComponent} from '@components/image-component'; +} from "react-native"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { ImageComponent } from "@components/image-component"; import { addGreen, arrowDown, @@ -31,42 +31,45 @@ import { plus, postCalender, request, -} from '@assets/images'; -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import moment from 'moment'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; -import GetLocation from 'react-native-get-location'; -import Popover, {PopoverPlacement, Rect} from 'react-native-popover-view'; -import {SizedBox} from '@components/sized-box'; -import {verticalScale} from '@theme/device/normalize'; +} from "@assets/images"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import moment from "moment"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import GetLocation from "react-native-get-location"; +import Popover, { PopoverPlacement, Rect } from "react-native-popover-view"; +import { SizedBox } from "@components/sized-box"; +import { verticalScale } from "@theme/device/normalize"; import { DatePickerRefProps, DateRangePicker, -} from '@components/date-range-picker'; -import {launchImageLibrary} from 'react-native-image-picker'; -import {GooglePlacesAutocomplete} from 'react-native-google-places-autocomplete'; -import Toast from 'react-native-simple-toast'; -import {Loader} from '@components/loader'; -import {navigations} from '@config/app-navigation/constant'; -import {FlatListComponent} from '@components/flatlist-component'; -import {Pill} from '@components/pill'; -import {API_URL} from '@network/constant'; -import ActiveEnv from '@config/env/env.dev.json'; +} from "@components/date-range-picker"; +import { launchImageLibrary } from "react-native-image-picker"; +import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete"; +import Toast from "react-native-simple-toast"; +import { Loader } from "@components/loader"; +import { navigations } from "@config/app-navigation/constant"; +import { FlatListComponent } from "@components/flatlist-component"; +import { Pill } from "@components/pill"; +import { API_URL } from "@network/constant"; +import ActiveEnv from "@config/env/env.dev.json"; interface CreatePostRequestScreenProps { navigation?: NavigationContainerRef; } export const CreatePostRequestScreen = ( - props: CreatePostRequestScreenProps, + props: CreatePostRequestScreenProps ) => { - const {navigation} = props || {}; - const {theme} = useAppTheme(); + const { navigation } = props || {}; + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); + const { strings } = useStringsAndLabels(); const [selecttype, createPostSelectType] = useState(1); - const [type, createPostType] = useState('offer'); + const [type, createPostType] = useState("offer"); const [typeIconWhat, getTypeIconWhat]: any = useState(); const [showWhatPopover, setWhatShowPopover] = useState(false); const [getResourceList, getResourseData]: any = useState([]); @@ -76,23 +79,23 @@ export const CreatePostRequestScreen = ( const [getResourceToList, getResourseDataTo]: any = useState([]); const [getResourceForLis, getResourseDataFor]: any = useState([]); const [icontotype, getTypeIconTo]: any = useState(); - const [valueTotype, getToTypeValue] = useState(''); + const [valueTotype, getToTypeValue] = useState(""); const [iconFrom, getTypeIconFrom]: any = useState(); const [typrFrom, getFromTypeValue]: any = useState(); const [imageArray, setImageArray]: any = useState([]); - const [imageArrayKey, setImageArrayKey]:any = useState([]); - const [forName, createPostforName] = useState(''); + const [imageArrayKey, setImageArrayKey]: any = useState([]); + const [forName, createPostforName] = useState(""); var [forQuantity, createPostforQuantity] = useState(1); - const [whereAddress, createPostwhereAddress] = useState(''); + const [whereAddress, createPostwhereAddress] = useState(""); const [imageKey, selectedImageKey] = useState(); const [when, createPostwhen] = useState(new Date()); - const [content, createPostcontent] = useState(''); - const [tags, createPosttags]: any = useState(''); + const [content, createPostcontent] = useState(""); + const [tags, createPosttags]: any = useState(""); const [tagArray, tagselectArray]: any = useState([]); - const [whatName, createPostwhatName] = useState(''); - const [fromName, createPostFromName] = useState(''); - const [addnewCmt, onAddComment] = useState(''); - const [addnewCmtReply, onAddCommentReply] = useState(''); + const [whatName, createPostwhatName] = useState(""); + const [fromName, createPostFromName] = useState(""); + const [addnewCmt, onAddComment] = useState(""); + const [addnewCmtReply, onAddCommentReply] = useState(""); var [whatQuantity, createPostwhatQuantity] = useState(1); const [typeIconFor, getTypeIconFor]: any = useState(); const [whatForType, getForTypeValue]: any = useState(); @@ -104,8 +107,8 @@ export const CreatePostRequestScreen = ( const [userList, recentlyJoinUser]: any = useState([]); const [userListArray, setuserListArray]: any = useState([]); const [usergratisList, userGratiesListData]: any = useState([]); - const [usertext, onUserSearch] = useState(''); - const [settoTitle, setToTitleData]:any = useState(); + const [usertext, onUserSearch] = useState(""); + const [settoTitle, setToTitleData]: any = useState(); const datePickerRef: React.Ref = useRef(null); const keyboardDismiss = () => { @@ -134,55 +137,55 @@ export const CreatePostRequestScreen = ( setForShowPopover(false); }; - const selectFromTypePost = (icon: any, type: any,title:any) => { - if (title === 'Everyone') { + const selectFromTypePost = (icon: any, type: any, title: any) => { + if (title === "Everyone") { setToTitleData(title); } else { setToTitleData(); } getTypeIconTo(icon); getToTypeValue(type); - getFromTypeValue(type) + getFromTypeValue(type); setFronShowPopover(false); }; const onConfirmStartDateTime = (startDate: Date) => { console.log(startDate); createPostwhen(startDate); - datePickerRef.current?.onOpenModal('end'); + datePickerRef.current?.onOpenModal("end"); }; const getResourcesAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch(API_URL + '/v1/posts/resources', { - method: 'get', + const response = await fetch(API_URL + "/v1/posts/resources", { + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), }); const dataItem = await response.json(); console.log( - '-------------------Get Resources API Response---------------------', + "-------------------Get Resources API Response---------------------" ); console.log(dataItem); getResourseDatawhat(dataItem?.data?.what); getResourseDataTo(dataItem?.data?.to); getResourseDataFrom(dataItem?.data?.from); getResourseDataFor(dataItem?.data?.for); - getTypeIconWhat(dataItem?.data?.what[0]['icon']); - getTypeIconFor(dataItem?.data?.for[0]['icon']); - getForTypeValue(dataItem?.data?.for[0]['value']); - getTypeIconTo(dataItem?.data?.to[0]['icon']); - setToTitleData(dataItem?.data?.to[0]['title']); - getToTypeValue(dataItem?.data?.to[0]['value']); - getTypeIconFrom(dataItem?.data?.from[0]['icon']); - getFromTypeValue(dataItem?.data?.from[0]['value']); - getWhatTypeValue(dataItem?.data?.what[0]['value']); + getTypeIconWhat(dataItem?.data?.what[0]["icon"]); + getTypeIconFor(dataItem?.data?.for[0]["icon"]); + getForTypeValue(dataItem?.data?.for[0]["value"]); + getTypeIconTo(dataItem?.data?.to[0]["icon"]); + setToTitleData(dataItem?.data?.to[0]["title"]); + getToTypeValue(dataItem?.data?.to[0]["value"]); + getTypeIconFrom(dataItem?.data?.from[0]["icon"]); + getFromTypeValue(dataItem?.data?.from[0]["value"]); + getWhatTypeValue(dataItem?.data?.what[0]["value"]); console.log( - dataItem?.data[0]['icon'], - '------------icon image--------------', + dataItem?.data[0]["icon"], + "------------icon image--------------" ); } catch (error) { console.error(error); @@ -190,32 +193,32 @@ export const CreatePostRequestScreen = ( }; const postImageUploadAPI = async (fileItem: any, base64Item: any) => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var pic: any = { - uploadKey: 'createPostImg', + uploadKey: "createPostImg", imageName: fileItem, - base64String: 'data:image/jpeg;base64,' + base64Item, + base64String: "data:image/jpeg;base64," + base64Item, }; - console.log('================ postImageUploadAPI Request================='); + console.log("================ postImageUploadAPI Request================="); console.log(pic); try { - const response = await fetch(API_URL + '/v1/users/upload/file', { - method: 'post', + const response = await fetch(API_URL + "/v1/users/upload/file", { + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), body: JSON.stringify(pic), }); const dataItem = await response.json(); - console.log('-----------------Response------------'); + console.log("-----------------Response------------"); var tempData = imageArray; tempData.push(dataItem?.data); setImageArray(tempData); var tempTwo = imageArrayKey; - tempTwo.push(dataItem?.data?.key) + tempTwo.push(dataItem?.data?.key); setImageArrayKey(tempTwo); selectedImageKey(dataItem?.data?.key); console.log(dataItem); @@ -228,9 +231,9 @@ export const CreatePostRequestScreen = ( async function createPostAPI() { LodingData(true); - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var data: any = { - type: 'request', + type: "request", what_type: whatSelectType, what_name: whatName, what_quantity: whatQuantity, @@ -245,26 +248,26 @@ export const CreatePostRequestScreen = ( tags: tagArray, post_image: imageArrayKey, from_type: typrFrom, - from_users:userListArray + from_users: userListArray, }; - console.log('=========== Create Post API Request =============='); + console.log("=========== Create Post API Request =============="); console.log(data); try { - const response = await fetch(API_URL + '/v1/posts/create', { - method: 'post', + const response = await fetch(API_URL + "/v1/posts/create", { + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), body: JSON.stringify(data), }); const dataItem = await response.json(); - console.log('=========== Create Post API Response =============='); + console.log("=========== Create Post API Response =============="); console.log(dataItem); LodingData(false); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); if (dataItem?.success === true) { navigation?.goBack(); @@ -282,8 +285,8 @@ export const CreatePostRequestScreen = ( }; const GallerySelect = async () => { - const {assets} = await launchImageLibrary({ - mediaType: 'photo', + const { assets } = await launchImageLibrary({ + mediaType: "photo", // selectionLimit: 2, includeBase64: true, maxWidth: 800, @@ -292,41 +295,41 @@ export const CreatePostRequestScreen = ( console.log(assets); if (assets) { const img = assets?.[0]; - console.log('---------------assets Gallery 222---------------'); + console.log("---------------assets Gallery 222---------------"); console.log(assets); - var fileNameTwo = img?.fileName ?? ''; + var fileNameTwo = img?.fileName ?? ""; LodingData(true); var output = - fileNameTwo.substr(0, fileNameTwo.lastIndexOf('.')) || fileNameTwo; - var base64Two = img?.base64 ?? ''; + fileNameTwo.substr(0, fileNameTwo.lastIndexOf(".")) || fileNameTwo; + var base64Two = img?.base64 ?? ""; postImageUploadAPI(output, base64Two); } }; const CreateNewPostModal = () => { if (whatName.length === 0) { - Toast.show('Enter About What', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About What", Toast.LONG, { + backgroundColor: "black", }); } else if (forName.length === 0) { - Toast.show('Enter About For', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter About For", Toast.LONG, { + backgroundColor: "black", }); } else if (whereAddress.length === 0) { - Toast.show('Enter Address', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Address", Toast.LONG, { + backgroundColor: "black", }); } else if (content.length === 0) { - Toast.show('Enter Post Content', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Content", Toast.LONG, { + backgroundColor: "black", }); } else if (tagArray.length === 0) { - Toast.show('Enter Post Tag', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Post Tag", Toast.LONG, { + backgroundColor: "black", }); } else if (imageArray.length === 0) { - Toast.show('Add Image to Post', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Add Image to Post", Toast.LONG, { + backgroundColor: "black", }); } else { createPostAPI(); @@ -335,47 +338,46 @@ export const CreatePostRequestScreen = ( // CreatePostModal(false); }; - const whatQtyMinus = () => { - if(whatQuantity > 1){ - whatQuantity = whatQuantity - 1 - createPostwhatQuantity(whatQuantity) + if (whatQuantity > 1) { + whatQuantity = whatQuantity - 1; + createPostwhatQuantity(whatQuantity); } - } + }; const whatQtyPlus = () => { - whatQuantity = whatQuantity + 1 - createPostwhatQuantity(whatQuantity) - } + whatQuantity = whatQuantity + 1; + createPostwhatQuantity(whatQuantity); + }; const ForQtyMinus = () => { - if(forQuantity > 1){ - forQuantity = forQuantity - 1 - createPostforQuantity(forQuantity) + if (forQuantity > 1) { + forQuantity = forQuantity - 1; + createPostforQuantity(forQuantity); } - } + }; const ForQtyPlus = () => { - forQuantity = forQuantity + 1 - createPostforQuantity(forQuantity) - } + forQuantity = forQuantity + 1; + createPostforQuantity(forQuantity); + }; const handleRemove = (id: any) => { const newPeople = tagArray.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); tagselectArray(newPeople); }; const onAddSkill = (text: any) => { - if (text !== '' && text !== undefined) { + if (text !== "" && text !== undefined) { tagselectArray([...tagArray, text]); - console.log('onSubmitEditing onSubmitEditing', tags, tagArray, text); - createPosttags(''); + console.log("onSubmitEditing onSubmitEditing", tags, tagArray, text); + createPosttags(""); } }; - const renderItem: ListRenderItem = ({item}) => ( + const renderItem: ListRenderItem = ({ item }) => ( handleRemove(item)} pillStyle={styles.marginBottom} @@ -386,7 +388,7 @@ export const CreatePostRequestScreen = ( const removeuserSelect = (id: any) => { const newPeople = userList.filter((person: any) => person !== id); - console.log('--------newPeople---------', newPeople); + console.log("--------newPeople---------", newPeople); recentlyJoinUser(newPeople); setuserListArray(newPeople); @@ -395,8 +397,8 @@ export const CreatePostRequestScreen = ( // const AddUserList = (item: any) => { // const found = userList.find((element:any) => element.id == item.id); // if (!found) { - // recentlyJoinUser([...userList, item]); - + // recentlyJoinUser([...userList, item]); + // const newItems = {...item}; // delete newItems.first_name; // delete newItems.last_name; @@ -406,71 +408,67 @@ export const CreatePostRequestScreen = ( // console.log(item.gratisNo); // const newuserData = {...newItems, point: item.gratisNo, user_id: item.id}; // setuserListArray([...userListArray, newuserData]); - + // console.log(userListArray); // }else{ - // Toast.show('Already Added', Toast.LONG, { + // Toast.show('Already Added', Toast.LONG, { // backgroundColor: 'black', // }); // } // }; const AddUserList = (item: any) => { - const found = userList.find((element:any) => element.id == item.id); + const found = userList.find((element: any) => element.id == item.id); if (!found) { - recentlyJoinUser([...userList, item]); - const newItems = {...item}; - delete newItems.first_name; - delete newItems.last_name; - delete newItems.pic; - delete newItems.id; - delete newItems.gratisNo; - console.log(item.gratisNo); - setuserListArray([...userListArray, item.id]); - console.log(userListArray); - } else{ - Toast.show('Already Added', Toast.LONG, { - backgroundColor: 'black', - }); - } -}; + recentlyJoinUser([...userList, item]); + const newItems = { ...item }; + delete newItems.first_name; + delete newItems.last_name; + delete newItems.pic; + delete newItems.id; + delete newItems.gratisNo; + console.log(item.gratisNo); + setuserListArray([...userListArray, item.id]); + console.log(userListArray); + } else { + Toast.show("Already Added", Toast.LONG, { + backgroundColor: "black", + }); + } + }; async function gratisUserList(textUser: any) { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); var datas: any = { searchtext: textUser, }; onUserSearch(textUser); - LodingData(true) - console.log('=========== User List Gratis API Request =============='); + LodingData(true); + console.log("=========== User List Gratis API Request =============="); console.log(datas); - console.log( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, - ); + console.log(API_URL + "/v1/users/search-user?searchtext=" + textUser); try { const response = await fetch( - API_URL + '/v1/users/search-user?searchtext=' + - textUser, + API_URL + "/v1/users/search-user?searchtext=" + textUser, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", }), - }, + } ); const dataItem = await response.json(); - console.log('=========== User List Gratis API Response =============='); + console.log("=========== User List Gratis API Response =============="); const result = dataItem?.data?.map((item: any) => { - return {...item, gratisNo: 1}; + return { ...item, gratisNo: 1 }; }); userGratiesListData(result); console.log(dataItem); Toast.show(dataItem?.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); - LodingData(false) + LodingData(false); } catch (error) { LodingData(false); console.error(error); @@ -478,18 +476,19 @@ export const CreatePostRequestScreen = ( } const removeSelectImage = (imageItem: any) => { - console.log(imageItem, 'image url') - console.log(imageArrayKey) + console.log(imageItem, "image url"); + console.log(imageArrayKey); const newImage = imageArray.filter( - (person: any) => person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key + (person: any) => + person.imageUrl !== imageItem?.imageUrl && person.key !== imageItem.key ); setImageArray(newImage); const newImagekey = imageArrayKey.filter( (person: any) => person !== imageItem?.key ); - setImageArrayKey(newImagekey) - console.log(imageArrayKey) - } + setImageArrayKey(newImagekey); + console.log(imageArrayKey); + }; const gratisPlusClick = (item: any, index: any) => { // console.log(item) @@ -531,11 +530,13 @@ export const CreatePostRequestScreen = ( + showsVerticalScrollIndicator={false} + > + style={styles.createPostModal} + > @@ -544,8 +545,9 @@ export const CreatePostRequestScreen = ( placeholder="What is your request?" placeholderTextColor="darkgray" value={whatName} - onChangeText={text => createPostwhatName(text)} - style={styles.postInputTwo}> + onChangeText={(text) => createPostwhatName(text)} + style={styles.postInputTwo} + > - @@ -562,23 +564,26 @@ export const CreatePostRequestScreen = ( from={ setWhatShowPopover(true)}> + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectWhatTypePost(item?.icon, item?.value) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -586,55 +591,58 @@ export const CreatePostRequestScreen = ( + }} + > - )}> + )} + > setWhatShowPopover(true)}> + onPress={() => setWhatShowPopover(true)} + > + source={{ uri: typeIconWhat }} + style={styles.createImgOne} + > Where - {/* */} { createPostwhereAddress(data.description); - setUserLocation(details?.geometry?.location) + setUserLocation(details?.geometry?.location); console.log(data); console.log(details); // description }} @@ -645,10 +653,11 @@ export const CreatePostRequestScreen = ( // currentLocation={true} currentLocationLabel="Current location" /> - + style={styles.createImgTwo} + > Post Body @@ -656,10 +665,11 @@ export const CreatePostRequestScreen = ( multiline // placeholder="What do you want to say?" placeholderTextColor="darkgray" - textAlignVertical={'top'} + textAlignVertical={"top"} value={content} - onChangeText={text => createPostcontent(text)} - style={styles.postinput}> + onChangeText={(text) => createPostcontent(text)} + style={styles.postinput} + > {/* @@ -678,10 +688,14 @@ export const CreatePostRequestScreen = ( // placeholder="who do you request this of?" placeholderTextColor="darkgray" value={settoTitle} - editable={settoTitle == 'Everyone' ? false : true} - onChangeText={text => {setToTitleData(text); gratisUserList(text)}} - style={styles.postInputTwo}> - + editable={settoTitle == "Everyone" ? false : true} + onChangeText={(text) => { + setToTitleData(text); + gratisUserList(text); + }} + style={styles.postInputTwo} + > + + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + - selectFromTypePost(item?.icon, item?.value,item?.title) + selectFromTypePost( + item?.icon, + item?.value, + item?.title + ) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -713,68 +734,78 @@ export const CreatePostRequestScreen = ( + }} + > - )}> + )} + > setFronShowPopover(true)}> + onPress={() => setFronShowPopover(true)} + > + resizeMode="contain" + source={{ uri: icontotype }} + style={styles.createImgOne} + > - + showsHorizontalScrollIndicator={false} + > {userList.map((userList: any) => { return ( removeuserSelect(userList)}> + onPress={() => removeuserSelect(userList)} + > + uri={userList?.pic} + > ); })} - {settoTitle !== 'Everyone' ? ( + {settoTitle !== "Everyone" ? ( + overflow: "hidden", + height: "auto", + }} + > ( + renderItem={({ item, index }) => ( - + }} + > + - + source={{ uri: item?.pic }} + > + {item?.first_name} {item?.last_name} - - AddUserList(item)}> + AddUserList(item)}> + source={buttonArrowGreen} + > - )}> + )} + > {/* For - + createPostforName(text)} - style={styles.postInputTwo}> - + onChangeText={(text) => createPostforName(text)} + style={styles.postInputTwo} + > + - @@ -920,23 +961,26 @@ export const CreatePostRequestScreen = ( from={ setForShowPopover(true)}> + style={styles.arrowDown} + > - }> + } + > ( - + renderItem={({ item }) => ( + selectForTypePost(item?.icon, item?.value) } style={styles.container3} - activeOpacity={0.8}> + activeOpacity={0.8} + > {item?.title} @@ -944,21 +988,24 @@ export const CreatePostRequestScreen = ( + }} + > - )}> + )} + > setForShowPopover(true)}> + onPress={() => setForShowPopover(true)} + > + source={{ uri: typeIconFor }} + style={styles.createImgOne} + > - {/* Quantity @@ -973,44 +1020,49 @@ export const CreatePostRequestScreen = ( - When - - datePickerRef.current?.onOpenModal('start')} - style={styles.postInputTwo}> - - {`${moment(when).format('DD MMM YYYY hh:mm A')}`} - + When - - - - + datePickerRef.current?.onOpenModal("start")} + style={styles.postInputTwo} + > + + {`${moment(when).format("DD MMM YYYY hh:mm A")}`} + + + + + + Tags createPosttags(text)} - style={styles.tagInput}> + onChangeText={(text) => createPosttags(text)} + style={styles.tagInput} + > - {tags !== '' ? ( + {tags !== "" ? ( { onAddSkill(tags); - }}> + }} + > + source={addGreen} + > ) : ( @@ -1019,7 +1071,7 @@ export const CreatePostRequestScreen = ( item.toString()} + keyExtractor={(item) => item.toString()} renderItem={renderItem} numColumns={100} showsHorizontalScrollIndicator={false} @@ -1028,7 +1080,8 @@ export const CreatePostRequestScreen = ( + style={styles.imagesCont} + > Image + add images @@ -1037,20 +1090,22 @@ export const CreatePostRequestScreen = ( {imageArray.map((item: any) => { return ( - removeSelectImage(item)} - > - + removeSelectImage(item)}> + + ); })} - + style={styles.purchaseContainer} + > {strings.postOffer} { return StyleSheet.create({ container: { - justifyContent: 'center', + justifyContent: "center", backgroundColor: theme.colors.white, - alignItems: 'center', + alignItems: "center", flex: 1, }, text: { @@ -25,31 +25,30 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 52, left: 10, height: normalScale(30), width: normalScale(30), zIndex: 11111222222, - paddingLeft:4, - paddingTop:4 + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 40, color: theme.colors.white, - zIndex: 11111222 - + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -63,52 +62,52 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, fontFamily: theme.fontType.regular, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 25 + bottom: 25, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -116,16 +115,16 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, container2: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), paddingLeft: 11, - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), shadowColor: theme.colors.black, @@ -141,7 +140,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, elevation: 5, // position:'absolute', - top: -20 + top: -20, }, icon1: { height: normalScale(30), @@ -151,23 +150,23 @@ export const createStyleSheet = (theme: ThemeProps) => { label1: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#197127' + color: "#197127", // justifyContent: 'center', // alignItems: 'center', }, label1Service: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#0081D2' + color: "#0081D2", }, label1Event: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#B10E00' + color: "#B10E00", }, filterTags: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, avatarImage: { height: 60, @@ -178,12 +177,12 @@ export const createStyleSheet = (theme: ThemeProps) => { }, avatarContainer: { marginLeft: 20, - marginRight: 20, + marginRight: 20, // backgroundColor:'red' }, skillAddImage: { - position: 'absolute', - bottom:-10, + position: "absolute", + bottom: -10, right: 16, height: 22, width: 22, @@ -199,32 +198,31 @@ export const createStyleSheet = (theme: ThemeProps) => { marginBottom: verticalScale(10), }, flexWrap: { - flexWrap: 'wrap', + flexWrap: "wrap", }, postInput: { - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 22, width: width - 90, marginLeft: 10, paddingHorizontal: 10, - justifyContent:'center', + justifyContent: "center", fontFamily: theme.fontType.regular, - }, postContainer: { marginVertical: 10, - flexDirection: 'row', + flexDirection: "row", }, postFilter: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, container3: { // borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), - flexDirection: 'row', - alignItems: 'center', + flexDirection: "row", + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), width: 110, @@ -234,7 +232,6 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - }, label2: { fontFamily: theme.fontType.regular, @@ -246,7 +243,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font14, color: theme.colors.green, }, - label4:{ + label4: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, @@ -255,7 +252,7 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.white, margin: 10, borderRadius: 12, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -267,9 +264,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), backgroundColor: theme.colors.lightRed, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), - marginHorizontal: 10 + marginHorizontal: 10, }, dummy: { width: normalScale(80), @@ -300,56 +297,56 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginLeft: normalScale(10), }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: 10, }, pin: { height: normalScale(14), width: normalScale(14), marginRight: normalScale(8), - marginTop:6 + marginTop: 6, }, location: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, fullAddress: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, addressDot: { height: 6, - width: 6, - marginTop:10, - marginHorizontal: 5 + width: 6, + marginTop: 10, + marginHorizontal: 5, }, sposerLabel: { - position: 'absolute', + position: "absolute", right: -32, top: 30, - zIndex: 11112222 + zIndex: 11112222, }, gretitude: { height: 20, width: 20, - position: 'absolute', + position: "absolute", right: 12, - bottom: 5 + bottom: 5, }, dateContainer: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", marginTop: verticalScale(10), marginHorizontal: 10, padding: 10, borderRadius: 12, backgroundColor: theme.colors.white, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -370,11 +367,11 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginBottom:12 }, posttitle: { - textAlign: 'center', - color: '#007112', + textAlign: "center", + color: "#007112", fontSize: 16, fontFamily: theme.fontType.regular, - marginTop:3 + marginTop: 3, }, feedContainer: { marginHorizontal: 10, @@ -383,7 +380,7 @@ export const createStyleSheet = (theme: ThemeProps) => { borderWidth: 3, borderRadius: 8, paddingBottom: 14, - overflow:'hidden' + overflow: "hidden", }, postfilterImage: { height: 22, @@ -394,12 +391,12 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 35, borderRadius: 100, marginRight: 10, - alignItems: 'center', - marginTop: 1 + alignItems: "center", + marginTop: 1, }, userDetailcont: { marginHorizontal: 10, - flexDirection: 'row', + flexDirection: "row", }, userName: { color: theme.colors.black, @@ -412,26 +409,26 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, postDes: { - textAlign: 'left', + textAlign: "left", color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, marginHorizontal: 15, marginVertical: 10, - lineHeight:20 + lineHeight: 20, }, userPost: { height: 500, - width: 'auto', + width: "auto", marginHorizontal: 10, marginBottom: 20, - borderRadius: 10 + borderRadius: 10, }, scrollViewStyle: { paddingBottom: verticalScale(100), }, - scrollView: { - // flex:1 + scrollView: { + // flex:1 paddingBottom: verticalScale(100), // paddingHorizontal: normalScale(22), }, @@ -439,17 +436,17 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, - marginRight: 5 + marginRight: 5, }, postDetailCont: { - flexDirection: 'row', + flexDirection: "row", marginHorizontal: 20, - marginBottom: 5 + marginBottom: 5, }, detailImage: { height: 14, width: 14, - marginRight: 8 + marginRight: 8, }, likeCount: { color: theme.colors.black, @@ -459,7 +456,7 @@ export const createStyleSheet = (theme: ThemeProps) => { commentImage: { height: 14, width: 14, - marginLeft:5 + marginLeft: 5, }, msgCount: { color: theme.colors.black, @@ -467,52 +464,52 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, commentTitle: { - flexDirection: 'row', - justifyContent: 'space-between', - marginHorizontal: 13 + flexDirection: "row", + justifyContent: "space-between", + marginHorizontal: 13, }, commentCont: { - flexDirection: 'row' + flexDirection: "row", }, commentContTwo: { - flexDirection: 'row', - justifyContent: 'space-evenly', - alignItems: 'center', - paddingTop:2, - paddingBottom:2 + flexDirection: "row", + justifyContent: "space-evenly", + alignItems: "center", + paddingTop: 2, + paddingBottom: 2, }, commentImgTwo: { height: 23, - width: 23 + width: 23, }, commentContShow: { fontSize: 12, - color: '#000000', + color: "#000000", marginHorizontal: 13, - marginTop: 2 + marginTop: 2, }, commentImgProfile: { marginLeft: 16, marginRight: 30, - flexDirection: 'row', - justifyContent: 'flex-start', - marginVertical:6, - overflow:'hidden' + flexDirection: "row", + justifyContent: "flex-start", + marginVertical: 6, + overflow: "hidden", }, commentDisplayCont: { - backgroundColor: '#E6E6E6', + backgroundColor: "#E6E6E6", borderWidth: 2, - borderColor: '#C2DBC6', - height: 'auto', + borderColor: "#C2DBC6", + height: "auto", borderRadius: 20, width: 230, paddingHorizontal: 10, paddingTop: 6, - paddingBottom: 6 + paddingBottom: 6, }, replyMsgCont: { fontSize: 12, - color: '#110101', + color: "#110101", paddingTop: 2, paddingLeft: 14, }, @@ -521,73 +518,73 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 24, }, replyContainer: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 80, marginTop: 2, }, replyLbl: { fontSize: 12, marginLeft: 10, - marginTop: 4 + marginTop: 4, }, minuteCont: { fontSize: 12, marginLeft: 16, - marginTop: 4 + marginTop: 4, }, commentImgProfileTwo: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 20, - justifyContent:'center', + justifyContent: "center", marginTop: 2, - overflow:'hidden' + overflow: "hidden", }, replyContainerTwo: { - flexDirection: 'row', - justifyContent:'center', + flexDirection: "row", + justifyContent: "center", marginLeft: 30, // marginLeft: 145, - marginVertical:10, + marginVertical: 10, // marginTop: 2, }, replyIcon: { height: 9, width: 10, marginTop: 6, - marginRight: 4 + marginRight: 4, }, replyMoreLbl: { fontSize: 12, - marginTop: 4, - marginRight: 50 + marginTop: 4, + marginRight: 50, }, - textOne:{ + textOne: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, // marginRight:2, - fontWeight:'600' + fontWeight: "600", }, - createPostModal:{ + createPostModal: { borderTopRightRadius: 24, borderTopLeftRadius: 24, // paddingVertical: verticalScale(20), - paddingHorizontal:8, + paddingHorizontal: 8, marginHorizontal: 7, }, - createPostCont:{ - flexDirection:'row', - alignItems:'center' + createPostCont: { + flexDirection: "row", + alignItems: "center", }, postInputTwo: { borderRadius: 10, width: width - 215, marginLeft: 3, paddingHorizontal: 10, - height:35, - justifyContent:'center', - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + height: 35, + justifyContent: "center", + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, color: theme.colors.black, }, @@ -596,154 +593,153 @@ export const createStyleSheet = (theme: ThemeProps) => { width: width - 130, marginLeft: 3, paddingHorizontal: 10, - height:35, - justifyContent:'center', - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + height: 35, + justifyContent: "center", + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, - marginRight:8, - color: theme.colors.black + marginRight: 8, + color: theme.colors.black, }, postdate: { borderRadius: 10, // marginLeft: 10, // paddingHorizontal: 10, - alignItems:'center', - flexDirection:'row' + alignItems: "center", + flexDirection: "row", }, - QuantityContainer:{ - flexDirection:'row', - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + QuantityContainer: { + flexDirection: "row", + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, borderRadius: 8, - paddingHorizontal:5, - paddingVertical:4, - marginHorizontal:5, - shadowColor: 'lightgray', + paddingHorizontal: 5, + paddingVertical: 4, + marginHorizontal: 5, + shadowColor: "lightgray", shadowOffset: { width: 2, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, }, - QuantityMinus:{ - marginHorizontal:6, - color:theme.colors.black, - fontSize:theme.fontSize.font14, - fontFamily:theme.fontType.medium + QuantityMinus: { + marginHorizontal: 6, + color: theme.colors.black, + fontSize: theme.fontSize.font14, + fontFamily: theme.fontType.medium, }, - QuantityMunber:{ - color:theme.colors.black, - fontSize:theme.fontSize.font14, - fontFamily:theme.fontType.bold, - + QuantityMunber: { + color: theme.colors.black, + fontSize: theme.fontSize.font14, + fontFamily: theme.fontType.bold, }, - QuantityPlus:{ - marginHorizontal:6, - color:theme.colors.black, - fontSize:theme.fontSize.font14, - fontFamily:theme.fontType.medium - }, - createImgOne:{ - height:20, - width:20, - marginRight:5, - }, - calenderImage:{ - height:20, - width:20, - marginLeft:70, - }, - quntitiyInput:{ - width:90, - height:30, - backgroundColor:'lightgray', - borderRadius:12, - paddingHorizontal:5 - }, - quntitiyCont:{ - flexDirection:'row', - marginTop:10, - marginBottom:10, - alignItems:'center', - }, - postCont:{ + QuantityPlus: { + marginHorizontal: 6, + color: theme.colors.black, + fontSize: theme.fontSize.font14, + fontFamily: theme.fontType.medium, + }, + createImgOne: { + height: 20, + width: 20, + marginRight: 5, + }, + calenderImage: { + height: 20, + width: 20, + marginLeft: 70, + }, + quntitiyInput: { + width: 90, + height: 30, + backgroundColor: "lightgray", + borderRadius: 12, + paddingHorizontal: 5, + }, + quntitiyCont: { + flexDirection: "row", + marginTop: 10, + marginBottom: 10, + alignItems: "center", + }, + postCont: { // marginTop:10 }, - postinput:{ - height:160, - marginTop:5, - textAlign: 'left', - verticalAlign: 'top', - borderRadius:12, - paddingHorizontal:5, - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, + postinput: { + height: 160, + marginTop: 5, + textAlign: "left", + verticalAlign: "top", + borderRadius: 12, + paddingHorizontal: 5, + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, backgroundColor: theme.colors.lightgrayTwo, color: theme.colors.black, }, - tagCont:{ - marginTop:10, - flexDirection:'row', - alignItems:'center' - }, - tagInput:{ - height:30, - width:150, - borderRadius:8, - paddingHorizontal:5, - marginLeft:10, - paddingVertical: 2, - borderColor:theme.colors.black, - borderWidth:theme.borderWidth.borderWidth1, - backgroundColor: theme.colors.lightgrayTwo, - color: theme.colors.black - }, - imagesCont:{ - flexDirection:'row', - marginTop:10 - }, - textTwo:{ + tagCont: { + marginTop: 10, + flexDirection: "row", + alignItems: "center", + }, + tagInput: { + height: 30, + width: 150, + borderRadius: 8, + paddingHorizontal: 5, + marginLeft: 10, + paddingVertical: 2, + borderColor: theme.colors.black, + borderWidth: theme.borderWidth.borderWidth1, + backgroundColor: theme.colors.lightgrayTwo, + color: theme.colors.black, + }, + imagesCont: { + flexDirection: "row", + marginTop: 10, + }, + textTwo: { color: theme.colors.black, fontSize: 15, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - textThree:{ - color: 'lightgray', + textThree: { + color: "lightgray", fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - multipleImagecont:{ - flex: 1, - flexDirection:'row', - // width : '100%', - flexWrap: 'wrap', + multipleImagecont: { + flex: 1, + flexDirection: "row", + // width : '100%', + flexWrap: "wrap", }, selectImage: { height: 90, width: 90, borderRadius: 18, marginRight: 10, - marginTop: 12 + marginTop: 12, }, - postClass:{ - borderColor:'green', - borderWidth:2, - borderRadius:10, - paddingVertical:10, - paddingHorizontal:5, - margin:10 + postClass: { + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + paddingVertical: 10, + paddingHorizontal: 5, + margin: 10, }, purchaseContainer: { - backgroundColor: '#007112', + backgroundColor: "#007112", borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(14), shadowColor: theme.colors.black, @@ -754,11 +750,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), - marginHorizontal: 45 + marginHorizontal: 45, }, titleTwo: { fontFamily: theme.fontType.medium, @@ -770,87 +766,87 @@ export const createStyleSheet = (theme: ThemeProps) => { width: normalScale(30), marginLeft: normalScale(10), }, - gratiescontainer:{ - height:180, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - bottom:15, - margin:16, - padding:10 - }, - gratiesTitle:{ + gratiescontainer: { + height: 180, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + bottom: 15, + margin: 16, + padding: 10, + }, + gratiesTitle: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font16, color: theme.colors.black, - marginBottom:10, - textAlign:'center' + marginBottom: 10, + textAlign: "center", }, - gratisimg:{ - height:45, - width:45 + gratisimg: { + height: 45, + width: 45, }, - gratistext:{ + gratistext: { fontFamily: theme.fontType.bold, fontSize: theme.fontSize.font14, color: theme.colors.black, - fontWeight:'600', - }, - gratisCont:{ - flexDirection:'row', - marginVertical:5, - marginRight:20, - position:'absolute', - right:-10, - }, - commentInput:{ - height:40, - width:width-90, - backgroundColor:'lightgray', - borderRadius:12, - paddingVertical:5, - marginVertical:10, - marginHorizontal:10, - padding:10 - }, - commentContainer:{ - height:200, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - margin:20, - padding:10, + fontWeight: "600", + }, + gratisCont: { + flexDirection: "row", + marginVertical: 5, + marginRight: 20, + position: "absolute", + right: -10, + }, + commentInput: { + height: 40, + width: width - 90, + backgroundColor: "lightgray", + borderRadius: 12, + paddingVertical: 5, + marginVertical: 10, + marginHorizontal: 10, + padding: 10, + }, + commentContainer: { + height: 200, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + margin: 20, + padding: 10, // justifyContent:'center' }, - createPostContTwo:{ - flexDirection:'row', - alignItems : 'flex-start' + createPostContTwo: { + flexDirection: "row", + alignItems: "flex-start", }, - textTwoWhere:{ + textTwoWhere: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:3, - fontWeight:'600', - paddingTop : 9 + marginRight: 3, + fontWeight: "600", + paddingTop: 9, }, - createImgTwo:{ - height:20, - width:20, - marginTop : 8, - marginHorizontal:5 + createImgTwo: { + height: 20, + width: 20, + marginTop: 8, + marginHorizontal: 5, }, keyboardView: { - position: 'absolute', + position: "absolute", // top:650, bottom: 0, left: 0, right: 0, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, @@ -860,6 +856,5 @@ export const createStyleSheet = (theme: ThemeProps) => { gesture: { flex: 1, }, - }); }; diff --git a/src/screens/event-detail/index.tsx b/src/screens/event-detail/index.tsx index 8269d1e4c..3530b2408 100644 --- a/src/screens/event-detail/index.tsx +++ b/src/screens/event-detail/index.tsx @@ -132,7 +132,7 @@ export const EventDetailScreen = (props: EventDetailScreenProps) => { // viewCount } = data || {}; - console.log(id, '-------------id-------------') + console.log(id, "-------------id-------------"); const { mutateAsync: createPayoutIntent } = useCreatePayoutIntent(); const { mutateAsync: purchaseTicket, isLoading: purchaseTicketLoading } = usePurchaseTicket(); @@ -145,7 +145,6 @@ export const EventDetailScreen = (props: EventDetailScreenProps) => { fetchRsvpDataAPI(); }, [id]); - const fetchRsvpDataAPI = async () => { LodingData(true); const token = await AsyncStorage.getItem("token"); @@ -447,7 +446,7 @@ export const EventDetailScreen = (props: EventDetailScreenProps) => { } }; - const findItemById = (rsvpDatas:any) => { + const findItemById = (rsvpDatas: any) => { const foundItem: any = rsvpDatas?.data?.rsvps.find( (item: any) => item?.user_id?.id === user?.id ); diff --git a/src/screens/event-detail/style.ts b/src/screens/event-detail/style.ts index 0b4fd5c4b..8099a6e54 100644 --- a/src/screens/event-detail/style.ts +++ b/src/screens/event-detail/style.ts @@ -1,7 +1,7 @@ -import { width } from '@theme/device/device'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { ThemeProps } from '@theme/theme'; -import { StyleSheet } from 'react-native'; +import { width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -10,7 +10,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, container: { // paddingLeft: normalScale(0), - marginHorizontal:normalScale(16) + marginHorizontal: normalScale(16), }, title: { fontFamily: theme.fontType.medium, @@ -20,7 +20,7 @@ export const createStyleSheet = (theme: ThemeProps) => { marginBottom: verticalScale(6), }, row: { - flexDirection: 'row', + flexDirection: "row", }, circularView: { backgroundColor: theme.colors.red, @@ -37,8 +37,8 @@ export const createStyleSheet = (theme: ThemeProps) => { elevation: 5, height: normalScale(58), width: normalScale(58), - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, calendarTime: { height: normalScale(40), @@ -57,7 +57,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - width:width - 100 + width: width - 100, }, marginTop: { marginTop: verticalScale(14), @@ -86,10 +86,10 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.darkBlack, }, rowOnly: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginBottom: verticalScale(8), - alignItems: 'center', + alignItems: "center", }, ticket: { fontFamily: theme.fontType.regular, @@ -115,19 +115,19 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font64, color: theme.colors.black, - alignSelf: 'center', + alignSelf: "center", }, radio: { height: normalScale(15), width: normalScale(15), - alignSelf:'center', + alignSelf: "center", }, text: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, marginLeft: normalScale(8), - width:'50%' + width: "50%", }, line: { height: verticalScale(1), @@ -143,29 +143,29 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.lightGrey, }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 25 + bottom: 25, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -181,30 +181,30 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 52, left: 10, height: normalScale(35), width: normalScale(35), zIndex: 11111222222, - paddingLeft:4, - paddingTop:4 + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, color: theme.colors.white, - zIndex: 11111222 + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -212,76 +212,75 @@ export const createStyleSheet = (theme: ThemeProps) => { marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, }, quantityContainer: { - width:'50%', + width: "50%", marginHorizontal: 15, - flexDirection: 'row' + flexDirection: "row", }, quantityIcon: { height: 20, - width: 20 + width: 20, }, quantityText: { fontFamily: theme.fontType.regular, marginHorizontal: 15, fontSize: 16, - color: 'black' + color: "black", }, priceTaxcontainer: { marginTop: 10, - marginBottom:10 + marginBottom: 10, }, totalPrice: { fontFamily: theme.fontType.regular, fontSize: 16, - color: 'black', - + color: "black", }, soldOutClass: { fontFamily: theme.fontType.regular, fontSize: 22, - color: 'red', - marginVertical:15 + color: "red", + marginVertical: 15, }, priceTitle: { fontFamily: theme.fontType.regular, fontSize: 24, - color: 'black', - marginBottom:10 + color: "black", + marginBottom: 10, }, subTotalContainer: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", paddingVertical: 5, - paddingLeft: 5 - }, + paddingLeft: 5, + }, subTotalLbl: { fontFamily: theme.fontType.extraLight, fontSize: 16, @@ -296,8 +295,8 @@ export const createStyleSheet = (theme: ThemeProps) => { gesture: { flex: 1, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, @@ -305,14 +304,14 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.modalOverlay, }, keyboardViewTwo: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, // top:0 }, addCardBorderContainer: { - position: 'absolute', + position: "absolute", left: 0, right: 0, bottom: 0, @@ -320,7 +319,7 @@ export const createStyleSheet = (theme: ThemeProps) => { borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(400), - height:'auto', + height: "auto", borderColor: theme.colors.black, backgroundColor: theme.colors.white, borderTopWidth: theme.borderWidth.borderWidth6, @@ -329,11 +328,11 @@ export const createStyleSheet = (theme: ThemeProps) => { marginHorizontal: 12, // flex: 1, }, - cardListContainer:{ - flexDirection: 'row', - justifyContent:'space-between', + cardListContainer: { + flexDirection: "row", + justifyContent: "space-between", marginTop: 10, - marginHorizontal:20 + marginHorizontal: 20, // height:40 }, addCardNewBorderContainer: { @@ -344,7 +343,7 @@ export const createStyleSheet = (theme: ThemeProps) => { borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), - height:'auto', + height: "auto", borderColor: theme.colors.black, backgroundColor: theme.colors.white, borderTopWidth: theme.borderWidth.borderWidth6, @@ -356,9 +355,9 @@ export const createStyleSheet = (theme: ThemeProps) => { closeCardCont: { height: 25, width: 25, - position: 'absolute', + position: "absolute", left: 10, - top: -11 + top: -11, }, addCardTitle: { color: theme.colors.black, @@ -372,7 +371,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font16, fontFamily: theme.fontType.regular, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginTop: 10, // marginBottom: 10 @@ -383,7 +382,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", // margin: 10, marginLeft: 20, marginRight: 20, @@ -393,19 +392,19 @@ export const createStyleSheet = (theme: ThemeProps) => { // paddingBottom:10, // paddingLeft: 45, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, cardList: { - flexDirection: 'row', - marginLeft: 10 + flexDirection: "row", + marginLeft: 10, }, cardNum: { color: theme.colors.black, fontSize: theme.fontSize.font16, fontFamily: theme.fontType.regular, marginRight: 5, - marginBottom: 5 + marginBottom: 5, }, CardexpDate: { color: theme.colors.darkGrey, @@ -418,10 +417,10 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font18, fontFamily: theme.fontType.regular, marginRight: 5, - textAlign: 'center', + textAlign: "center", }, purchaseContainer: { - backgroundColor: '#007112', + backgroundColor: "#007112", borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(14), shadowColor: theme.colors.black, @@ -432,11 +431,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), - marginHorizontal: 45 + marginHorizontal: 45, }, titleTwo: { fontFamily: theme.fontType.medium, @@ -455,7 +454,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", // margin: 10, marginLeft: 20, marginRight: 20, @@ -465,7 +464,7 @@ export const createStyleSheet = (theme: ThemeProps) => { // paddingBottom:10, paddingLeft: 45, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardDateInput: { color: theme.colors.black, @@ -473,13 +472,13 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginRight: 20, marginBottom: 10, marginTop: 10, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardCVCInput: { color: theme.colors.black, @@ -487,35 +486,34 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginRight: 20, marginBottom: 10, marginTop: 10, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardLogo: { width: 25, height: 15, - position: 'absolute', + position: "absolute", top: 22, left: 30, // right:20, - zIndex: 11111 + zIndex: 11111, }, cardView: { - flexDirection: 'row', - justifyContent: 'space-between' + flexDirection: "row", + justifyContent: "space-between", }, - greenBtn:{ - height:30, - width:30, - alignSelf:'center', - + greenBtn: { + height: 30, + width: 30, + alignSelf: "center", }, - cardContainer:{ - marginVertical:10 + cardContainer: { + marginVertical: 10, }, addCardContainer: { backgroundColor: theme.colors.lightBlueTwo, @@ -528,15 +526,15 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 0, height: verticalScale(0), }, - + elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), marginLeft: 20, marginRight: 20, - marginTop: 8 + marginTop: 8, }, }); }; diff --git a/src/screens/event-detail/ticket-checkout-modal.tsx b/src/screens/event-detail/ticket-checkout-modal.tsx index 8fa785c2a..d3b94d915 100644 --- a/src/screens/event-detail/ticket-checkout-modal.tsx +++ b/src/screens/event-detail/ticket-checkout-modal.tsx @@ -1,8 +1,8 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import React, {forwardRef, useEffect, useState} from 'react'; -import {createStyleSheet} from './style'; -import {ModalComponent} from '@components/modal-component'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import React, { forwardRef, useEffect, useState } from "react"; +import { createStyleSheet } from "./style"; +import { ModalComponent } from "@components/modal-component"; import { FlatList, Keyboard, @@ -10,10 +10,10 @@ import { Text, TouchableOpacity, View, -} from 'react-native'; -import {EventList} from '@components/event-list'; -import {ImageComponent} from '@components/image-component'; -import {ButtonComponent} from '@components/button-component'; +} from "react-native"; +import { EventList } from "@components/event-list"; +import { ImageComponent } from "@components/image-component"; +import { ButtonComponent } from "@components/button-component"; import { activeRadio, addCard, @@ -23,20 +23,20 @@ import { inactiveRadio, minus, plus, -} from '@assets/images'; -import {Result} from '@network/hooks/home-service-hooks/use-event-lists'; -import {formatPrice} from '@utils/common'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import {SizedBox} from '@components/sized-box'; -import {Loader} from '@components/loader'; -import {ScrollView} from 'react-native-gesture-handler'; -import {Modal} from 'react-native'; -import GestureRecognizer from 'react-native-swipe-gestures'; -import {TextInput} from 'react-native'; -import {Platform} from 'react-native'; -import Toast from 'react-native-simple-toast'; -import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; -import { API_URL } from '@network/constant'; +} from "@assets/images"; +import { Result } from "@network/hooks/home-service-hooks/use-event-lists"; +import { formatPrice } from "@utils/common"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { SizedBox } from "@components/sized-box"; +import { Loader } from "@components/loader"; +import { ScrollView } from "react-native-gesture-handler"; +import { Modal } from "react-native"; +import GestureRecognizer from "react-native-swipe-gestures"; +import { TextInput } from "react-native"; +import { Platform } from "react-native"; +import Toast from "react-native-simple-toast"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import { API_URL } from "@network/constant"; interface TicketCheckoutModalCompProps { onPurchase: ( @@ -44,20 +44,20 @@ interface TicketCheckoutModalCompProps { ticketId: string, ticketName: string, cardData: string, - quantityticket: number, + quantityticket: number ) => void; eventData: Result; - loader:boolean; + loader: boolean; } const TicketCheckoutModalComp = ( props: TicketCheckoutModalCompProps, - ref: React.Ref | undefined, + ref: React.Ref | undefined ) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); - const {onPurchase, eventData,loader} = props || {}; + const { strings } = useStringsAndLabels(); + const { onPurchase, eventData, loader } = props || {}; const [selectedRadioIndex, setSelectedRadioIndex] = useState(0); const [SelectCardIndex, setSelectedCardRadioIndex] = useState(0); var [quantityticket, totalTicketQuantity]: any = useState(1); @@ -66,32 +66,34 @@ const TicketCheckoutModalComp = ( var [ticketId, PurchaseTicketId]: any = useState(); var [setLoader, isLoading] = useState(false); - const [cardnumber, cardNumberData] = useState(''); - const [cardExpmonth, cardExpMonth] = useState(''); - const [cardExpyear, cardExpYears] = useState(''); - const [cardCvv, cardCVVData] = useState(''); - const [date, setDate] = useState(''); + const [cardnumber, cardNumberData] = useState(""); + const [cardExpmonth, cardExpMonth] = useState(""); + const [cardExpyear, cardExpYears] = useState(""); + const [cardCvv, cardCVVData] = useState(""); + const [date, setDate] = useState(""); const [addcard, addCardModal] = useState(false); const [addNewcard, addNewCardModal] = useState(false); const [setCard, setCardData]: any = useState([]); - const [newCardName, addNewCardName] = useState(''); - const [newCardNumber, addNewCardNumber] = useState(''); - const [newCardMonth, addNewCardMonth] = useState(''); - const [newCardYear, addNewCardYear] = useState(''); - const [newCardCvv, addNewCardCvv] = useState(''); - const [newCardCountry, addNewCardCountry] = useState(''); - const [newCardAddress, addNewCardAddress] = useState(''); - const [newCardAddressTwo, addNewCardAddressTwo] = useState(''); - const [newCardCity, addNewCardCity] = useState(''); - const [newCardState, addNewCardSate] = useState(''); - const [newCardZip, addNewCardZip] = useState(''); + const [newCardName, addNewCardName] = useState(""); + const [newCardNumber, addNewCardNumber] = useState(""); + const [newCardMonth, addNewCardMonth] = useState(""); + const [newCardYear, addNewCardYear] = useState(""); + const [newCardCvv, addNewCardCvv] = useState(""); + const [newCardCountry, addNewCardCountry] = useState(""); + const [newCardAddress, addNewCardAddress] = useState(""); + const [newCardAddressTwo, addNewCardAddressTwo] = useState(""); + const [newCardCity, addNewCardCity] = useState(""); + const [newCardState, addNewCardSate] = useState(""); + const [newCardZip, addNewCardZip] = useState(""); var [buttonDisable, buttonDisableCheck] = useState(Boolean); useEffect(() => { getCardDetailAPI(); - const index = eventData?.tickets.findIndex(ele => !ele.is_ticket_purchased); + const index = eventData?.tickets.findIndex( + (ele) => !ele.is_ticket_purchased + ); setSelectedRadioIndex(index); if (eventData?.tickets.length !== 0) { if (eventData?.tickets[0].available_quantity === 0) { @@ -106,32 +108,19 @@ const TicketCheckoutModalComp = ( }, [eventData]); async function totalPriceCalculation(ticketId: any, quantityticket: any) { - const token = await AsyncStorage.getItem('token'); - console.log( - API_URL + '/v1/tickets/' + - ticketId + - '/' + - quantityticket, - ); + const token = await AsyncStorage.getItem("token"); + console.log(API_URL + "/v1/tickets/" + ticketId + "/" + quantityticket); try { - console.log( - API_URL + '/v1/tickets/' + - ticketId + - '/' + - quantityticket, - ); + console.log(API_URL + "/v1/tickets/" + ticketId + "/" + quantityticket); const response = await fetch( - API_URL + '/v1/tickets/' + - ticketId + - '/' + - quantityticket, + API_URL + "/v1/tickets/" + ticketId + "/" + quantityticket, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", }), - }, + } ); const dataItem = await response.json(); isLoading(false); @@ -176,74 +165,67 @@ const TicketCheckoutModalComp = ( const onOpenModal = () => { isLoading(true); - if(setPrice === 0){ + if (setPrice === 0) { onPurchase( setCard[SelectCardIndex], - eventData?.tickets?.[selectedRadioIndex]?.id ?? '', + eventData?.tickets?.[selectedRadioIndex]?.id ?? "", eventData?.tickets?.[selectedRadioIndex]?.name, setPrice, - quantityticket, - ) - }else{ + quantityticket + ); + } else { addCardModal(true); getCardDetailAPI(); } - }; const addCardModalHide = () => { addCardModal(false); - cardNumberData(''); - cardExpMonth(''); - cardExpYears(''); - cardCVVData(''); + cardNumberData(""); + cardExpMonth(""); + cardExpYears(""); + cardCVVData(""); }; const addNewCardDetial = () => { addNewCardModal(false); - cardNumberData(''); + cardNumberData(""); // cardExpMonth(''); // cardExpYears(''); // cardCVVData(''); }; const getCardDetailAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch( - API_URL + '/v1/subscriptions/cards', - { - method: 'get', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - }, - ); + const response = await fetch(API_URL + "/v1/subscriptions/cards", { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + }); const dataItem = await response.json(); isLoading(false); - + setCardData(dataItem?.data?.cards); } catch (error) { isLoading(false); console.error(error); - } + } }; // ======================Config API========================= const ConfigListAPI = async () => { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); try { - const response = await fetch( - API_URL + '/v1/config/list', - { - method: 'get', - headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', - }), - }, - ); + const response = await fetch(API_URL + "/v1/config/list", { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/json", + }), + }); const dataItem = await response.json(); const keyId = dataItem?.data?.stripe?.stripePublicKey; setTimeout(() => { @@ -261,24 +243,23 @@ const TicketCheckoutModalComp = ( async function cardStripeAPI(stripeId: any) { const genCard: any = { - 'card[number]': newCardNumber, - 'card[exp_month]': newCardMonth, - 'card[exp_year]': newCardYear, - 'card[cvc]': newCardCvv, + "card[number]": newCardNumber, + "card[exp_month]": newCardMonth, + "card[exp_year]": newCardYear, + "card[cvc]": newCardCvv, }; - - const results = await fetch('https://api.stripe.com/v1/tokens', { - method: 'post', + const results = await fetch("https://api.stripe.com/v1/tokens", { + method: "post", headers: { - Accept: 'application/json', - 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Bearer ' + stripeId, + Accept: "application/json", + "Content-Type": "application/x-www-form-urlencoded", + Authorization: "Bearer " + stripeId, }, body: Object.keys(genCard) - .map(key => key + '=' + genCard[key]) - .join('&'), - }).then(response => response.json()); + .map((key) => key + "=" + genCard[key]) + .join("&"), + }).then((response) => response.json()); const card_tok = results.id; @@ -289,7 +270,7 @@ const TicketCheckoutModalComp = ( }, 3000); if (results.error) { Toast.show(results.error.message, Toast.LONG, { - backgroundColor: 'black', + backgroundColor: "black", }); } @@ -343,18 +324,18 @@ const TicketCheckoutModalComp = ( const addNewCardDetailModal = () => { addNewCardModal(true); - addNewCardName(''); - addNewCardNumber(''); - addNewCardMonth(''); - addNewCardCountry(''); - addNewCardYear(''); - addNewCardCvv(''); - addNewCardAddress(''); - addNewCardAddressTwo(''); - addNewCardCity(''); - addNewCardSate(''); - addNewCardZip(''); - setDate(''); + addNewCardName(""); + addNewCardNumber(""); + addNewCardMonth(""); + addNewCardCountry(""); + addNewCardYear(""); + addNewCardCvv(""); + addNewCardAddress(""); + addNewCardAddressTwo(""); + addNewCardCity(""); + addNewCardSate(""); + addNewCardZip(""); + setDate(""); }; async function onCheckValidation() { @@ -362,48 +343,48 @@ const TicketCheckoutModalComp = ( isLoading(true); if (newCardName.length === 0) { isLoading(false); - Toast.show('Enter Card Holder Name', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Card Holder Name", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardNumber.length != 16) { isLoading(false); - Toast.show('Enter Your Valid Card Number', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Your Valid Card Number", Toast.LONG, { + backgroundColor: "black", }); } else if (date.length < 3) { isLoading(false); - Toast.show('Enter Valide Date', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Valide Date", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardCvv.length != 3) { isLoading(false); - Toast.show('Invalide CVV Number', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Invalide CVV Number", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardCountry.length === 0) { isLoading(false); - Toast.show('Enter Country Name', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Country Name", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardAddress.length === 0) { isLoading(false); - Toast.show('Enter your Address', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter your Address", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardCity.length === 0) { isLoading(false); - Toast.show('Enter City Name', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter City Name", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardState.length === 0) { isLoading(false); - Toast.show('Enter State Name', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter State Name", Toast.LONG, { + backgroundColor: "black", }); } else if (newCardZip.length === 0) { isLoading(false); - Toast.show('Enter Zip Code', Toast.LONG, { - backgroundColor: 'black', + Toast.show("Enter Zip Code", Toast.LONG, { + backgroundColor: "black", }); } else { ConfigListAPI(); @@ -415,240 +396,230 @@ const TicketCheckoutModalComp = ( }; const OnCardValidation = () => { - if(setCard.length !== 0){ + if (setCard.length !== 0) { onPurchase( setCard[SelectCardIndex], - eventData?.tickets?.[selectedRadioIndex]?.id ?? '', + eventData?.tickets?.[selectedRadioIndex]?.id ?? "", eventData?.tickets?.[selectedRadioIndex]?.name, setPrice, - quantityticket, - ) - } - else{ - Toast.show('First Add Card', Toast.LONG, { - backgroundColor: 'black', + quantityticket + ); + } else { + Toast.show("First Add Card", Toast.LONG, { + backgroundColor: "black", }); } - - } - + }; return ( <> - - - - - - - {eventData?.tickets?.[selectedRadioIndex]?.price} - - {eventData?.tickets.map((ele, index) => { - if (ele?.is_ticket_purchased) { - return <>; - } - return ( + + + + + + + {eventData?.tickets?.[selectedRadioIndex]?.price} + + {eventData?.tickets.map((ele, index) => { + if (ele?.is_ticket_purchased) { + return <>; + } + return ( + onSelectTicket(index, ele)} + style={[styles.row, styles.marginTop]} + > + + {`$${ele?.price} - ${ele?.name}`} + {ele?.available_quantity !== 0 ? ( + + OnMinusClick(index, ele)} + > + + + + {index === selectedRadioIndex ? quantityticket : 1} + + OnPlusClick(index, ele)}> + + + + ) : ( + + )} + + ); + })} + + + {!buttonDisable ? ( + + + {strings.subTotal} + ${setValue?.sub_total} + + + {strings.platformFee} + + ${setValue?.platformFee} + + + + {strings.salesTax} + {setValue?.salesTax} + + + {strings.paymentFee} + + ${setValue?.paymentFee} + + + + {strings.total} + ${setValue?.total} + + + ) : ( + Ticket Sold out + )} + + + {/* */} + onOpenModal()} + // onPress={() => + // onPurchase( + // setPrice, + // eventData?.tickets?.[selectedRadioIndex]?.id ?? '', + // eventData?.tickets?.[selectedRadioIndex]?.name, + // quantityticket, + // ) + // } + title={strings.purchase} + /> + + + + + + + + + + + + {strings.purchase} + onSelectTicket(index, ele)} - style={[styles.row, styles.marginTop]} + onPress={() => addNewCardDetailModal()} + style={styles.cardContainer} > - {`$${ele?.price} - ${ele?.name}`} - {ele?.available_quantity !== 0 ? ( - - OnMinusClick(index, ele)} - > - - - - {index === selectedRadioIndex ? quantityticket : 1} - - OnPlusClick(index, ele)} - > - - - - ) : ( - - )} + style={styles.greenBtn} + source={addGreen} + > - ); - })} - - - {!buttonDisable ? ( - - - {strings.subTotal} - - ${setValue?.sub_total} - - - - - {strings.platformFee} - - - ${setValue?.platformFee} - - - - {strings.salesTax} - {setValue?.salesTax} - - - {strings.paymentFee} - - ${setValue?.paymentFee} - - - - {strings.total} - ${setValue?.total} - - - ) : ( - Ticket Sold out - )} - - - {/* */} - onOpenModal()} - // onPress={() => - // onPurchase( - // setPrice, - // eventData?.tickets?.[selectedRadioIndex]?.id ?? '', - // eventData?.tickets?.[selectedRadioIndex]?.name, - // quantityticket, - // ) - // } - title={strings.purchase} - /> - - - - - - - - - - - - {strings.purchase} - - addNewCardDetailModal()} - style={styles.cardContainer} - > - - - - - - ( - onSelectCard(index, item)} - > - - - - - - - {item?.brand} - - - {item?.last4} - - - + + + + ( + onSelectCard(index, item)} + > + + + + - - {strings.exp} + + {item?.brand} - - {item?.exp_month}/{item?.exp_year} + + {item?.last4} - - )} - > - - - + + + {strings.exp} + + + {item?.exp_month}/{item?.exp_year} + + + + + )} + > + + + - - OnCardValidation()} - activeOpacity={0.8} - style={styles.addCardContainer} - > - - - {strings.pay} ${setPrice} - - - - + + OnCardValidation()} + activeOpacity={0.8} + style={styles.addCardContainer} + > + + + {strings.pay} ${setPrice} + + + - + + - {/* Add Card Detail Modal */} - - + {/* Add Card Detail Modal */} + + + style={styles.gesture} + > - + - - - - {strings.purchase} - {strings.cardinfo} + - { - addNewCardName(value); - }} - /> - - - - - { - addNewCardNumber(value); - }} - /> - - - { - setDate( - text.length === 3 && !text.includes('/') - ? `${text.substring(0, 2)}/${text.substring(2)}` - : text, - ); - const [month, year] = text.split('/'); - addNewCardMonth(month); - addNewCardYear(year); - }} - placeholder="mm/yy" - keyboardType="number-pad" - maxLength={5} - style={styles.addCardDateInput} - value={date} - /> - - { - addNewCardCvv(value); - }} - /> - - {strings.billingAdd} - - { - addNewCardCountry(value); - }} - /> - { - addNewCardAddress(value); - }} - /> - { - addNewCardAddressTwo(value); - }} - /> - { - addNewCardCity(value); - }} - /> - { - addNewCardSate(value); - }} - /> - { - addNewCardZip(value); - }} - /> - - + + + {strings.purchase} + + {strings.cardinfo} + + { + addNewCardName(value); + }} + /> + + + + + { + addNewCardNumber(value); + }} + /> + + + { + setDate( + text.length === 3 && !text.includes("/") + ? `${text.substring(0, 2)}/${text.substring( + 2 + )}` + : text + ); + const [month, year] = text.split("/"); + addNewCardMonth(month); + addNewCardYear(year); + }} + placeholder="mm/yy" + keyboardType="number-pad" + maxLength={5} + style={styles.addCardDateInput} + value={date} + /> + + { + addNewCardCvv(value); + }} + /> + + + {strings.billingAdd} + + + { + addNewCardCountry(value); + }} + /> + { + addNewCardAddress(value); + }} + /> + { + addNewCardAddressTwo(value); + }} + /> + { + addNewCardCity(value); + }} + /> + { + addNewCardSate(value); + }} + /> + { + addNewCardZip(value); + }} + /> + + - - + + + + - - - - - + + + - + + ); }; diff --git a/src/screens/event/add-component-modal.tsx b/src/screens/event/add-component-modal.tsx index 138d4707f..89a8834ae 100644 --- a/src/screens/event/add-component-modal.tsx +++ b/src/screens/event/add-component-modal.tsx @@ -65,7 +65,7 @@ export const AddComponentModal = (props: AddComponentModalProps) => { userId: user?.id, }); const { isActiveSubscription, eventProducerID } = data || {}; - console.log(data,'user data444'); + console.log(data, "user data444"); useFocusEffect( useCallback(() => { @@ -77,8 +77,8 @@ export const AddComponentModal = (props: AddComponentModalProps) => { ); useEffect(() => { -packageDetailAPI(); - },[]) + packageDetailAPI(); + }, []); useFocusEffect( useCallback(() => { console.log("isActiveSubscription isActiveSubscription"); @@ -168,9 +168,7 @@ packageDetailAPI(); async function packageDetailAPI() { const token = await AsyncStorage.getItem("token"); console.log(token); - console.log( - API_URL + "/v1/subscriptions/packages/" + eventProducerID - ); + console.log(API_URL + "/v1/subscriptions/packages/" + eventProducerID); try { const response = await fetch( API_URL + "/v1/subscriptions/packages/" + eventProducerID, diff --git a/src/screens/event/index.tsx b/src/screens/event/index.tsx index 8f5b1c35c..1160c5e25 100644 --- a/src/screens/event/index.tsx +++ b/src/screens/event/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import { useAppTheme } from '@app-hooks/use-app-theme'; -import React, { useState, useCallback, useEffect } from 'react'; -import { createStyleSheet } from './style'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React, { useState, useCallback, useEffect } from "react"; +import { createStyleSheet } from "./style"; import { ActivityIndicator, ListRenderItem, @@ -10,9 +10,9 @@ import { Text, TouchableOpacity, View, -} from 'react-native'; -import { Header } from '@components/header'; -import { ImageComponent } from '@components/image-component'; +} from "react-native"; +import { Header } from "@components/header"; +import { ImageComponent } from "@components/image-component"; import { Search, arrowDown, @@ -27,41 +27,41 @@ import { notification, onelogo, pin, -} from '@assets/images'; -import { DatePickerModal } from 'react-native-paper-dates'; -import moment from 'moment'; -import { EventList } from '@components/event-list'; +} from "@assets/images"; +import { DatePickerModal } from "react-native-paper-dates"; +import moment from "moment"; +import { EventList } from "@components/event-list"; import { NavigationContainerRef, ParamListBase, useFocusEffect, useRoute, -} from '@react-navigation/native'; -import { navigations } from '@config/app-navigation/constant'; +} from "@react-navigation/native"; +import { navigations } from "@config/app-navigation/constant"; import { Result, useEventLists, -} from '@network/hooks/home-service-hooks/use-event-lists'; -import { Loader } from '@components/loader'; -import { FlatListComponent } from '@components/flatlist-component'; -import { useStringsAndLabels } from '@app-hooks/use-strings-and-labels'; +} from "@network/hooks/home-service-hooks/use-event-lists"; +import { Loader } from "@components/loader"; +import { FlatListComponent } from "@components/flatlist-component"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; import { useUserProfile, userProfileParsedData, -} from '@network/hooks/user-service-hooks/use-user-profile'; -import { useDispatch, useSelector } from 'react-redux'; -import { StoreType } from '@network/reducers/store'; +} from "@network/hooks/user-service-hooks/use-user-profile"; +import { useDispatch, useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; import { UserProfileState, onSetUser, -} from '@network/reducers/user-profile-reducer'; -import { Alert } from 'react-native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import { TextInput } from 'react-native'; -import GetLocation from 'react-native-get-location'; -import { FlatList, ScrollView } from 'react-native-gesture-handler'; -import { Switch } from 'react-native'; -import { API_URL, getData } from '@network/constant'; +} from "@network/reducers/user-profile-reducer"; +import { Alert } from "react-native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { TextInput } from "react-native"; +import GetLocation from "react-native-get-location"; +import { FlatList, ScrollView } from "react-native-gesture-handler"; +import { Switch } from "react-native"; +import { API_URL, getData } from "@network/constant"; interface Range { startDate: Date | undefined; @@ -90,15 +90,15 @@ export const EventListScreen = (props: EventListScreenProps) => { const [currentPages, setCurrentPage] = useState(0); const { mutateAsync } = useEventLists(); const [isLoading, LoadingData] = useState(false); - const [searchQuery, setSearchQuery] = useState(''); + const [searchQuery, setSearchQuery] = useState(""); const [page, setPage] = useState(1); - const [setFilter, SetToggleFilter] = useState('VF'); + const [setFilter, SetToggleFilter] = useState("VF"); const [loading, onPageLoad] = useState(true); const route = useRoute(); const [isEnabled, setIsEnabled] = useState(false); // const toggleSwitch = () => setIsEnabled(previousState => !previousState); const { user } = useSelector( - state => state.userProfileReducer, + (state) => state.userProfileReducer ) as { user: { id: string; pic: string } }; const { refetch } = useUserProfile({ userId: user?.id, @@ -107,47 +107,50 @@ export const EventListScreen = (props: EventListScreenProps) => { const dispatch = useDispatch(); useFocusEffect( - useCallback( () => { + useCallback(() => { getUserProfileAPI(); onPageLoad(false); setPage(1); - setSearchQuery('') + setSearchQuery(""); setEventsList([]); - }, []), + }, []) ); useFocusEffect( useCallback(() => { var tempdataTwo = getData("defaultLocation"); getEventListAPI(tempdataTwo); - }, [setFilter, page, range, searchQuery]), + }, [setFilter, page, range, searchQuery]) ); - const getEventListAPI = async (getLatitude:any) => { - if(page === 1){ + const getEventListAPI = async (getLatitude: any) => { + if (page === 1) { LoadingData(true); } - + var eventData = { - start_date: moment(range.startDate).format('YYYY-MM-DD'), - end_date: moment(range.endDate).format('YYYY-MM-DD'), + start_date: moment(range.startDate).format("YYYY-MM-DD"), + end_date: moment(range.endDate).format("YYYY-MM-DD"), event_type: setFilter, only_upcoming: 0, searchtext: searchQuery, latitude: getLatitude.latitude, longitude: getLatitude.longitude, zoom_level: getLatitude.zoomLevel, - device_type: Platform.OS + device_type: Platform.OS, }; - console.log(eventData, '--------------------event location request-----------------') - var eventList_url = API_URL + '/v2/events/list?limit=10&page=' + page; + console.log( + eventData, + "--------------------event location request-----------------" + ); + var eventList_url = API_URL + "/v2/events/list?limit=10&page=" + page; try { - const token = await AsyncStorage.getItem('token'); + const token = await AsyncStorage.getItem("token"); const response = await fetch(eventList_url, { - method: 'post', + method: "post", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), body: JSON.stringify(eventData), }); @@ -157,7 +160,7 @@ export const EventListScreen = (props: EventListScreenProps) => { var dataTemp = [...eventsList, ...dataItem?.data.results]; setEventsList(dataTemp); } else { - manageSameHeader(dataItem?.data.results) + manageSameHeader(dataItem?.data.results); } setTotalPages(dataItem?.data?.totalPages); @@ -195,30 +198,33 @@ export const EventListScreen = (props: EventListScreenProps) => { } }; - - function manageSameHeader(newEventArray:any){ - - var oldEventLastIndex = eventsList.length-1; - if (newEventArray[0]['date_title'] == eventsList[oldEventLastIndex]['date_title']) { - + function manageSameHeader(newEventArray: any) { + var oldEventLastIndex = eventsList.length - 1; + if ( + newEventArray[0]["date_title"] == + eventsList[oldEventLastIndex]["date_title"] + ) { var oldEventTempOne = [...eventsList]; - oldEventTempOne[oldEventLastIndex]['events'] = [...eventsList[oldEventLastIndex]['events'], ...newEventArray[0]['events']]; + oldEventTempOne[oldEventLastIndex]["events"] = [ + ...eventsList[oldEventLastIndex]["events"], + ...newEventArray[0]["events"], + ]; newEventArray.splice(0, 1); setEventsList([...oldEventTempOne, ...newEventArray]); - - }else{ + } else { var dataTempTwo = [...eventsList, ...newEventArray]; setEventsList(dataTempTwo); - console.log('not same date display'); + console.log("not same date display"); } - } - const setSerchValue = useCallback((searchData: any) => { - setSearchQuery(searchData); - setPage(1); - setEventsList([]); - }, [searchQuery], + const setSerchValue = useCallback( + (searchData: any) => { + setSearchQuery(searchData); + setPage(1); + setEventsList([]); + }, + [searchQuery] ); const onDismiss = useCallback(() => { @@ -235,14 +241,14 @@ export const EventListScreen = (props: EventListScreenProps) => { setPage(1); setEventsList([]); }, - [setOpen, setRange, range?.startDate, range?.endDate], + [setOpen, setRange, range?.startDate, range?.endDate] ); const onNavigateToProfile = () => { if (user?.id) { - refetch().then(res => { + refetch().then((res) => { const userData = userProfileParsedData(res?.data?.data); - console.log('check1===', userData); + console.log("check1===", userData); dispatch(onSetUser(userData)); }); } @@ -266,16 +272,13 @@ export const EventListScreen = (props: EventListScreenProps) => { setEventsList([]); setPage(1); setIsEnabled(true); - SetToggleFilter('AO'); - + SetToggleFilter("AO"); } else { setEventsList([]); setPage(1); setIsEnabled(false); - SetToggleFilter('VF'); - + SetToggleFilter("VF"); } - }; const renderItem: ListRenderItem = ({ item }) => { @@ -286,7 +289,7 @@ export const EventListScreen = (props: EventListScreenProps) => { {item?.date_title} {item.day_title} - + {item.events.map((subitem: any) => { return ( @@ -295,7 +298,7 @@ export const EventListScreen = (props: EventListScreenProps) => { onPress={() => onNavigate(subitem)} activeOpacity={0.8} key={Math.random()} - // disabled={disabled} + // disabled={disabled} > { {subitem.start_date_label} - {' • '} + {" • "} {subitem.start_time_label} @@ -345,21 +348,24 @@ export const EventListScreen = (props: EventListScreenProps) => { + source={Search} + > { + onChangeText={(value) => { console.log(value); setSerchValue(value); - }}> + }} + > + source={onelogo} + > NE L o c a l @@ -372,7 +378,8 @@ export const EventListScreen = (props: EventListScreenProps) => { + style={styles.profileView} + > { Village Friendly - {Platform.OS === "ios" ? - toggleSwitch(isEnabled)} - value={isEnabled} - /> - : - toggleSwitch(isEnabled)} - value={isEnabled} - /> - } - + {Platform.OS === "ios" ? ( + toggleSwitch(isEnabled)} + value={isEnabled} + /> + ) : ( + toggleSwitch(isEnabled)} + value={isEnabled} + /> + )} Adult Oriented @@ -413,8 +419,8 @@ export const EventListScreen = (props: EventListScreenProps) => { setOpen(true)}> {`${moment(range?.startDate).format( - 'MMM DD, YYYY', - )} - ${moment(range?.endDate).format('MMM DD, YYYY')}`} + "MMM DD, YYYY" + )} - ${moment(range?.endDate).format("MMM DD, YYYY")}`} { data={eventsList} initialNumToRender={10} onEndReached={() => { - console.log('-------------onEndReached---------------'); + console.log("-------------onEndReached---------------"); if (loading) { onPageLoad(false); postDataLoad(); @@ -450,10 +456,13 @@ export const EventListScreen = (props: EventListScreenProps) => { }} onEndReachedThreshold={0.1} > - {eventsList.length === 0 ? - - {strings.noEventsFound} - : <>} + {eventsList.length === 0 ? ( + + {strings.noEventsFound} + + ) : ( + <> + )} ); }; diff --git a/src/screens/event/style.ts b/src/screens/event/style.ts index 438e86297..979872643 100644 --- a/src/screens/event/style.ts +++ b/src/screens/event/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -14,7 +14,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -22,9 +22,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, dateContainer: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", // marginTop: verticalScale(25), }, calendar: { @@ -54,8 +54,8 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius16, width: normalScale(102), height: verticalScale(66), - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, icon: { height: normalScale(30), @@ -72,11 +72,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(220), }, optionsView: { - alignItems: 'center', + alignItems: "center", }, row: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginTop: verticalScale(12), }, greenView: { @@ -84,25 +84,25 @@ export const createStyleSheet = (theme: ThemeProps) => { marginHorizontal: normalScale(6), }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, - dateDisplyContainer:{ - backgroundColor:theme.colors.darkyellow, - marginVertical:5, - marginTop:13 - }, - displayDate:{ - textAlign:'center', - paddingVertical:5, - fontSize:theme.fontSize.font18, - fontFamily:theme.fontType.bold, - color:theme.colors.white + dateDisplyContainer: { + backgroundColor: theme.colors.darkyellow, + marginVertical: 5, + marginTop: 13, + }, + displayDate: { + textAlign: "center", + paddingVertical: 5, + fontSize: theme.fontSize.font18, + fontFamily: theme.fontType.bold, + color: theme.colors.white, }, listContainer: { @@ -112,13 +112,13 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), backgroundColor: theme.colors.white, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), shadowColor: theme.colors.darkGrey, shadowOffset: { width: 1, height: 2 }, shadowOpacity: 0.9, shadowRadius: 4, - marginHorizontal:13 + marginHorizontal: 13, }, dummy: { width: normalScale(80), @@ -140,7 +140,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font16, color: theme.colors.black, - fontWeight:'500' + fontWeight: "500", // marginBottom: verticalScale(17), // maxWidth: normalScale(200), // flexShrink:1 @@ -151,8 +151,8 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: normalScale(12), }, rowClass: { - flexDirection: 'row', - paddingTop:5 + flexDirection: "row", + paddingTop: 5, }, pin: { height: normalScale(14), @@ -163,7 +163,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - flexShrink:1 + flexShrink: 1, }, fullAddress: { fontFamily: theme.fontType.light, @@ -172,16 +172,17 @@ export const createStyleSheet = (theme: ThemeProps) => { }, addressDot: { height: 6, - width: 6, marginVertical: 5, - marginHorizontal: 5 + width: 6, + marginVertical: 5, + marginHorizontal: 5, }, - cancleText:{ - position:'absolute', - right:0, - top:65, - fontFamily:theme.fontType.medium, - fontSize:theme.fontSize.font12, - color:theme.colors.redTwo + cancleText: { + position: "absolute", + right: 0, + top: 65, + fontFamily: theme.fontType.medium, + fontSize: theme.fontSize.font12, + color: theme.colors.redTwo, }, HeaderContainerTwo: { @@ -192,29 +193,28 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 45, left: 10, height: normalScale(30), width: normalScale(30), - zIndex:11111222222 + zIndex: 11111222222, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 50, color: theme.colors.white, - zIndex:11111222 - + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -228,65 +228,63 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 30 + bottom: 30, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius:100 + borderRadius: 100, }, toggleCont: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", // marginTop: verticalScale(25), }, villageLbl: { - fontFamily:theme.fontType.medium, - color:theme.colors.black, - fontSize:theme.fontSize.font14 - }, - switchToggle: { - + fontFamily: theme.fontType.medium, + color: theme.colors.black, + fontSize: theme.fontSize.font14, }, - backgroundToggle:{ - backgroundColor:theme.colors.white, - paddingVertical:5 + switchToggle: {}, + backgroundToggle: { + backgroundColor: theme.colors.white, + paddingVertical: 5, }, - noEventLbl:{ - textAlign:'center', - color:theme.colors.black, - fontFamily:theme.fontType.semiBold, - fontSize:theme.fontSize.font16 + noEventLbl: { + textAlign: "center", + color: theme.colors.black, + fontFamily: theme.fontType.semiBold, + fontSize: theme.fontSize.font16, }, - titleContainer : { + titleContainer: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), @@ -321,18 +319,18 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: 10, }, playerDescription: { - textAlign: 'center', + textAlign: "center", // alignSelf: 'center', margin: 20, fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, - color: theme.colors.black + color: theme.colors.black, }, signUpStyle: { marginLeft: 80, marginRight: 80, marginTop: 10, - justifyContent: 'center', + justifyContent: "center", borderRadius: theme.borderRadius.radius10, height: 50, fontSize: theme.fontSize.font24, @@ -341,8 +339,8 @@ export const createStyleSheet = (theme: ThemeProps) => { borderColor: theme.colors.black, }, playerText: { - textDecorationLine: 'underline', - textAlign: 'center', + textDecorationLine: "underline", + textAlign: "center", marginTop: 10, color: theme.colors.black, fontSize: theme.fontSize.font14, @@ -351,24 +349,23 @@ export const createStyleSheet = (theme: ThemeProps) => { gesture: { flex: 1, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, right: 0, backgroundColor: theme.colors.modalOverlay, }, - modalMainContainer:{ - position:'absolute', - bottom:300, - backgroundColor:theme.colors.white, - marginHorizontal:12, - padding:16, - borderColor:theme.colors.lightGreen, - borderWidth:4, - borderRadius:theme.borderRadius.radius16, - } - + modalMainContainer: { + position: "absolute", + bottom: 300, + backgroundColor: theme.colors.white, + marginHorizontal: 12, + padding: 16, + borderColor: theme.colors.lightGreen, + borderWidth: 4, + borderRadius: theme.borderRadius.radius16, + }, }); }; diff --git a/src/screens/gratitude/index.tsx b/src/screens/gratitude/index.tsx index 5ba6e2f55..873e3dbc6 100644 --- a/src/screens/gratitude/index.tsx +++ b/src/screens/gratitude/index.tsx @@ -101,7 +101,7 @@ export const GratitudeScreen = (props: MapScreenProps) => { const [isLoading, LodingData] = useState(false); const { navigation } = props || {}; const mileStoneSwiperRef: any = useRef(null); - var zoomLeveDefault = getData("mapCircleRadius") + var zoomLeveDefault = getData("mapCircleRadius"); const [zoomLevel, setCameraZoomLevel] = useState(zoomLeveDefault); const [shape, setShapData]: any = useState(); const { user } = useSelector( @@ -111,12 +111,12 @@ export const GratitudeScreen = (props: MapScreenProps) => { userId: user?.id, }); var makeDate = new Date(); - makeDate.setMonth(makeDate.getMonth() + 1); + makeDate.setMonth(makeDate.getMonth() + 1); const [range, setRange] = useState({ startDate: new Date(), endDate: makeDate, }); - const mapRef = useRef(null); + const mapRef = useRef(null); const [mapLoaded, setMapLoaded] = useState(false); // const mapRef = useRef(null); @@ -178,7 +178,7 @@ export const GratitudeScreen = (props: MapScreenProps) => { var isLocationDefault = { latitude: location.latitude, longitude: location.longitude, - zoomLevel: getData('mapCircleRadius'), + zoomLevel: getData("mapCircleRadius"), }; setData("defaultLocation", isLocationDefault); setLongitude(location?.longitude); @@ -289,23 +289,22 @@ export const GratitudeScreen = (props: MapScreenProps) => { }; const handleRegionChange = async (event: any) => { - if(mapLoaded){ + if (mapLoaded) { const newZoomLevel = event.properties.zoomLevel; - if (newZoomLevel !== zoomLevel) { - LodingData(true); - } - console.log("handleRegionChange newZoomLevel", newZoomLevel); - setCameraZoomLevel(newZoomLevel); - var isMapLocation: any = { - latitude: latitude, - longitude: longitude, - zoomLevel: newZoomLevel, - device_type: Platform.OS, - }; - - setData("defaultLocation", isMapLocation); + if (newZoomLevel !== zoomLevel) { + LodingData(true); + } + console.log("handleRegionChange newZoomLevel", newZoomLevel); + setCameraZoomLevel(newZoomLevel); + var isMapLocation: any = { + latitude: latitude, + longitude: longitude, + zoomLevel: newZoomLevel, + device_type: Platform.OS, + }; + + setData("defaultLocation", isMapLocation); } - }; const onMarkerClick = (mapEventData: any) => { @@ -435,7 +434,7 @@ export const GratitudeScreen = (props: MapScreenProps) => { setMapLoaded(true)} + onDidFinishLoadingMap={() => setMapLoaded(true)} logoEnabled={false} scaleBarEnabled={true} ref={mapRef} diff --git a/src/screens/gratitude/style.ts b/src/screens/gratitude/style.ts index 613e1a4e8..c63439286 100644 --- a/src/screens/gratitude/style.ts +++ b/src/screens/gratitude/style.ts @@ -1,14 +1,14 @@ -import { width } from '@theme/device/device'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ container: { - justifyContent: 'center', + justifyContent: "center", backgroundColor: theme.colors.white, - alignItems: 'center', + alignItems: "center", flex: 1, }, text: { @@ -22,38 +22,37 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, row2: { - position: 'absolute', + position: "absolute", top: 45, left: 10, height: normalScale(30), width: normalScale(30), - zIndex:11111222222 + zIndex: 11111222222, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 50, color: theme.colors.white, - zIndex:11111222 - + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -67,44 +66,44 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, fontFamily: theme.fontType.regular, marginLeft: 2, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 30 + bottom: 30, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius:100 + borderRadius: 100, }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -112,31 +111,31 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, container2: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, shadowRadius: theme.borderRadius.radius8, - backgroundColor: 'rgba(255, 255, 255, 0.83)', + backgroundColor: "rgba(255, 255, 255, 0.83)", borderWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.black, - width:110, + width: 110, shadowOffset: { width: 0, height: verticalScale(0), }, elevation: 5, }, - icon1:{ + icon1: { height: normalScale(30), width: normalScale(30), marginRight: normalScale(8), @@ -147,57 +146,56 @@ export const createStyleSheet = (theme: ThemeProps) => { // justifyContent: 'center', // alignItems: 'center', }, - filterTags:{ - flexDirection:'row', + filterTags: { + flexDirection: "row", zIndex: 11122222, - alignSelf:'center', - position:'absolute', - top:-15 - }, - avatarImage:{ - height:60, - width:60, - borderRadius:100, - marginLeft:10 - }, - avatarContainer:{ - position:'absolute', - bottom:6, - height:180, - width:'100%' - }, - avatar:{ - height:40, - width:40, - borderRadius:100, - marginLeft:10, - }, - postInput:{ - backgroundColor:'lightgray', - borderRadius:22, - width:width - 90, - marginLeft:10, - paddingHorizontal:10 - - }, - postContainer:{ - marginVertical:10, - flexDirection:'row', + alignSelf: "center", + position: "absolute", + top: -15, }, - postFilter:{ - flexDirection:'row', - justifyContent:'center' + avatarImage: { + height: 60, + width: 60, + borderRadius: 100, + marginLeft: 10, + }, + avatarContainer: { + position: "absolute", + bottom: 6, + height: 180, + width: "100%", + }, + avatar: { + height: 40, + width: 40, + borderRadius: 100, + marginLeft: 10, + }, + postInput: { + backgroundColor: "lightgray", + borderRadius: 22, + width: width - 90, + marginLeft: 10, + paddingHorizontal: 10, + }, + postContainer: { + marginVertical: 10, + flexDirection: "row", + }, + postFilter: { + flexDirection: "row", + justifyContent: "center", }, container3: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), - width:110, + width: 110, elevation: 5, }, label2: { @@ -205,28 +203,27 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font12, color: theme.colors.black, }, - mainPostCont:{ - backgroundColor:theme.colors.white, - margin:10, - borderRadius:12, - shadowColor: 'lightgray', - shadowOffset: { width: 1, height: 3 }, - shadowOpacity: 0.9, - shadowRadius: 2, + mainPostCont: { + backgroundColor: theme.colors.white, + margin: 10, + borderRadius: 12, + shadowColor: "lightgray", + shadowOffset: { width: 1, height: 3 }, + shadowOpacity: 0.9, + shadowRadius: 2, }, listContainer: { borderRadius: theme.borderRadius.radius16, borderWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.black, paddingVertical: verticalScale(6), - paddingHorizontal:normalScale(6), + paddingHorizontal: normalScale(6), backgroundColor: theme.colors.white, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), - marginHorizontal:10, + marginHorizontal: 10, }, - - + dummy: { width: normalScale(80), height: verticalScale(92), @@ -235,7 +232,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, flex: { flex: 1, - overflow:'hidden', + overflow: "hidden", }, dateText: { fontFamily: theme.fontType.light, @@ -249,7 +246,7 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, marginBottom: verticalScale(7), maxWidth: normalScale(200), - flexShrink:1, + flexShrink: 1, }, event: { height: 32, @@ -257,8 +254,8 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginLeft: normalScale(10), }, row: { - flexDirection: 'row', - marginTop:12, + flexDirection: "row", + marginTop: 12, }, pin: { height: normalScale(14), @@ -274,41 +271,42 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - flexShrink:1 + flexShrink: 1, }, addressDot: { height: 6, - width: 6, marginVertical: 5, - marginHorizontal: 5 - }, - sposerLabel:{ - position:'absolute', - right:-32, - top:30, - zIndex:11112222 - }, - gretitude:{ - height:20, - width:20, - position:'absolute', - right:12, - bottom:0 + width: 6, + marginVertical: 5, + marginHorizontal: 5, + }, + sposerLabel: { + position: "absolute", + right: -32, + top: 30, + zIndex: 11112222, + }, + gretitude: { + height: 20, + width: 20, + position: "absolute", + right: 12, + bottom: 0, }, dateContainer: { - flexDirection: 'row', - alignSelf: 'center', + flexDirection: "row", + alignSelf: "center", marginTop: verticalScale(10), - marginHorizontal:10, - paddingVertical:12, - paddingHorizontal:6, - borderRadius:12, - backgroundColor:theme.colors.white, - shadowColor: 'lightgray', - shadowOffset: { width: 1, height: 3 }, - shadowOpacity: 0.9, - shadowRadius: 2, - position:'absolute', - top:30 + marginHorizontal: 10, + paddingVertical: 12, + paddingHorizontal: 6, + borderRadius: 12, + backgroundColor: theme.colors.white, + shadowColor: "lightgray", + shadowOffset: { width: 1, height: 3 }, + shadowOpacity: 0.9, + shadowRadius: 2, + position: "absolute", + top: 30, }, calendar: { height: normalScale(20), @@ -323,107 +321,107 @@ export const createStyleSheet = (theme: ThemeProps) => { arrowDown: { width: normalScale(10), height: verticalScale(5), - marginVertical:5 + marginVertical: 5, }, - posttitle:{ - textAlign:'center', - color:theme.colors.green, - fontSize:16, + posttitle: { + textAlign: "center", + color: theme.colors.green, + fontSize: 16, fontFamily: theme.fontType.regular, }, - feedContainer:{ - marginHorizontal:10, - marginVertical:10, - borderColor:theme.colors.green, - borderWidth:1, - borderRadius:8 - }, - postfilterImage:{ - height:20, - width:20, - position:'absolute', - right:10, - top:10 - }, - postProfile:{ - height:35, - width:35, - borderRadius:100, - marginRight:10 - }, - userDetailcont:{ - marginHorizontal:10, - flexDirection:'row', - }, - userName:{ - color:theme.colors.black, - fontSize:16, - fontFamily: theme.fontType.regular, + feedContainer: { + marginHorizontal: 10, + marginVertical: 10, + borderColor: theme.colors.green, + borderWidth: 1, + borderRadius: 8, }, - postTime:{ - color:theme.colors.purple, - fontSize:14, + postfilterImage: { + height: 20, + width: 20, + position: "absolute", + right: 10, + top: 10, + }, + postProfile: { + height: 35, + width: 35, + borderRadius: 100, + marginRight: 10, + }, + userDetailcont: { + marginHorizontal: 10, + flexDirection: "row", + }, + userName: { + color: theme.colors.black, + fontSize: 16, fontFamily: theme.fontType.regular, }, - postDes:{ - textAlign:'left', - color:theme.colors.black, - fontSize:12, + postTime: { + color: theme.colors.purple, + fontSize: 14, fontFamily: theme.fontType.regular, - marginHorizontal:15, - marginVertical:10 }, - userPost:{ - height:500, - width:'auto', - marginHorizontal:10, - marginBottom:20, - borderRadius:10 + postDes: { + textAlign: "left", + color: theme.colors.black, + fontSize: 12, + fontFamily: theme.fontType.regular, + marginHorizontal: 15, + marginVertical: 10, + }, + userPost: { + height: 500, + width: "auto", + marginHorizontal: 10, + marginBottom: 20, + borderRadius: 10, }, scrollView: { paddingBottom: verticalScale(100), }, - postDetail:{ - color:theme.colors.black, - fontSize:12, + postDetail: { + color: theme.colors.black, + fontSize: 12, fontFamily: theme.fontType.regular, - marginRight:5 + marginRight: 5, }, - postDetailCont:{ - flexDirection:'row', - marginHorizontal:20, - marginBottom:5 + postDetailCont: { + flexDirection: "row", + marginHorizontal: 20, + marginBottom: 5, }, - detailImage:{ - height:14, - width:14, - marginRight:8 + detailImage: { + height: 14, + width: 14, + marginRight: 8, }, - likeCount:{ - color:theme.colors.black, - fontSize:12, + likeCount: { + color: theme.colors.black, + fontSize: 12, fontFamily: theme.fontType.regular, }, - commentImage:{ - height:14, - width:14, + commentImage: { + height: 14, + width: 14, }, - msgCount:{ - color:theme.colors.black, - fontSize:12, + msgCount: { + color: theme.colors.black, + fontSize: 12, fontFamily: theme.fontType.regular, }, - commentTitle:{ - flexDirection:'row', - justifyContent:'space-between' + commentTitle: { + flexDirection: "row", + justifyContent: "space-between", }, - commentCont:{ - flexDirection:'row' + commentCont: { + flexDirection: "row", }, buttonCallout: { - position:'absolute', - top:160, - right:0, + position: "absolute", + top: 160, + right: 0, alignSelf: "center", justifyContent: "space-between", backgroundColor: "transparent", @@ -431,35 +429,34 @@ export const createStyleSheet = (theme: ThemeProps) => { touchable: { backgroundColor: "white", padding: 8, - margin: 5 + margin: 5, }, plusClass: { - height:20, - width:20 + height: 20, + width: 20, }, - map: { - flex: 1 + flex: 1, }, - type1:{ - flex: 1 + type1: { + flex: 1, }, - pinRed:{ + pinRed: { height: 20, width: 20, backgroundColor: theme.colors.red, - borderColor: 'black', + borderColor: "black", borderWidth: 2, - borderRadius: 50, + borderRadius: 50, }, - pinBlack:{ + pinBlack: { height: 20, width: 20, backgroundColor: theme.colors.green, - borderColor: 'black', + borderColor: "black", borderWidth: 2, - borderRadius: 50, + borderRadius: 50, }, addressContainer: { @@ -469,23 +466,22 @@ export const createStyleSheet = (theme: ThemeProps) => { // height: '20%', // zIndex: 1, }, - locationTitle:{ - fontSize:18, - color:theme.colors.redTwo, - paddingHorizontal:12, + locationTitle: { + fontSize: 18, + color: theme.colors.redTwo, + paddingHorizontal: 12, fontFamily: theme.fontType.regular, }, - locationDes:{ + locationDes: { fontFamily: theme.fontType.regular, - fontSize:14, - color:theme.colors.greyLine + fontSize: 14, + color: theme.colors.greyLine, }, - enableBtn:{ - fontSize:16, - color:theme.colors.redTwo, - justifyContent:'flex-start', + enableBtn: { + fontSize: 16, + color: theme.colors.redTwo, + justifyContent: "flex-start", fontFamily: theme.fontType.regular, - } - + }, }); }; diff --git a/src/screens/home/commetList/index.tsx b/src/screens/home/commetList/index.tsx index bd603f05d..5ec82a009 100644 --- a/src/screens/home/commetList/index.tsx +++ b/src/screens/home/commetList/index.tsx @@ -765,9 +765,13 @@ export const CommentList = (props: commentListProps) => { - + recentUserProfilePress( @@ -870,10 +874,14 @@ export const CommentList = (props: commentListProps) => { {commentList.length !== 0 && !isLoading ? ( - {isCommentData ? + {isCommentData ? ( + Get More Comments - : <>} - + + ) : ( + <> + )} + {/* {isCommentData && !isLoading ? ( @@ -1113,7 +1121,7 @@ export const CommentList = (props: commentListProps) => { onAddCommentReply(text)} > diff --git a/src/screens/home/index.tsx b/src/screens/home/index.tsx index 39b38177f..404a8ca56 100644 --- a/src/screens/home/index.tsx +++ b/src/screens/home/index.tsx @@ -118,7 +118,7 @@ export const HomeScreen = (props: HomeScreenProps) => { endDate: new Date(), }); - console.log(user.id, '-----------userId----------') + console.log(user.id, "-----------userId----------"); const dispatch = useDispatch(); useFocusEffect( @@ -172,11 +172,13 @@ export const HomeScreen = (props: HomeScreenProps) => { var isLocationDefault = { latitude: location.latitude, longitude: location.longitude, - zoomLevel: getData('mapCircleRadius') + zoomLevel: getData("mapCircleRadius"), }; - - console.log(isLocationDefault, '-------------isLocationDefault-------------') + console.log( + isLocationDefault, + "-------------isLocationDefault-------------" + ); setData("defaultLocation", isLocationDefault); if (location.latitude && location.longitude) { getRecentlyJoinUserAPI(location); @@ -871,7 +873,7 @@ export const HomeScreen = (props: HomeScreenProps) => { {/* ------------------Header Tab------------------- */} - + item.key} @@ -938,9 +940,7 @@ export const HomeScreen = (props: HomeScreenProps) => { {postList?.length === 0 ? strings.noPostFound : ""} - - diff --git a/src/screens/home/style.ts b/src/screens/home/style.ts index c53b5d5a5..f2e94f002 100644 --- a/src/screens/home/style.ts +++ b/src/screens/home/style.ts @@ -1,15 +1,15 @@ -import { height, width } from '@theme/device/device'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { borderRadius } from '@theme/fonts'; -import { ThemeProps } from '@theme/theme'; -import { StyleSheet } from 'react-native'; +import { height, width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { borderRadius } from "@theme/fonts"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ container: { - justifyContent: 'center', + justifyContent: "center", backgroundColor: theme.colors.white, - alignItems: 'center', + alignItems: "center", flex: 1, }, text: { @@ -22,29 +22,28 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 150, }, row2: { - position: 'absolute', + position: "absolute", top: 45, left: 10, height: normalScale(30), width: normalScale(30), - zIndex: 11111222222 + zIndex: 11111222222, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 50, color: theme.colors.white, - zIndex: 11111222 - + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -58,55 +57,54 @@ export const createStyleSheet = (theme: ThemeProps) => { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, // fontFamily: theme.fontType.regular, - fontFamily: 'NotoSerif-Regular', + fontFamily: "NotoSerif-Regular", marginLeft: 2, marginBottom: -10, }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:3, - + fontWeight: "400", + color: "white", + position: "relative", + bottom: 3, }, profileContainer: { - position: 'absolute', + position: "absolute", right: 15, - bottom: 30 + bottom: 30, }, bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, profileView: { marginTop: verticalScale(10), - alignSelf: 'flex-end', + alignSelf: "flex-end", }, profile: { height: normalScale(55), @@ -114,16 +112,16 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(50), }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, container2: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), paddingLeft: 11, - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), shadowColor: theme.colors.black, @@ -139,7 +137,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, elevation: 5, // position:'absolute', - top: -20 + top: -20, }, icon1: { height: normalScale(30), @@ -149,75 +147,75 @@ export const createStyleSheet = (theme: ThemeProps) => { label1: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#197127' + color: "#197127", // justifyContent: 'center', // alignItems: 'center', }, label1Service: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#0081D2' + color: "#0081D2", }, label1Event: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font12, - color: '#B10E00' + color: "#B10E00", }, filterTags: { - zIndex:22323, - backgroundColor: 'transparent', - flexDirection: 'row', - justifyContent: 'center' + zIndex: 22323, + backgroundColor: "transparent", + flexDirection: "row", + justifyContent: "center", }, avatarImage: { height: 60, width: 60, borderRadius: 100, marginRight: 11, - marginLeft:2 + marginLeft: 2, }, - gratisAndCommentContainer:{ - flexDirection:'row', - justifyContent:'space-evenly', - marginVertical:10 + gratisAndCommentContainer: { + flexDirection: "row", + justifyContent: "space-evenly", + marginVertical: 10, }, - gratisContainer:{ - flexDirection:'row', + gratisContainer: { + flexDirection: "row", borderWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.black, - borderRadius:theme.borderRadius.radius20, - paddingHorizontal:20, - paddingVertical:6, - alignSelf:'center', - }, - gratisClass:{ - alignSelf:'center', - marginRight:5, + borderRadius: theme.borderRadius.radius20, + paddingHorizontal: 20, + paddingVertical: 6, + alignSelf: "center", + }, + gratisClass: { + alignSelf: "center", + marginRight: 5, color: theme.colors.black, - fontSize: theme.fontSize.font14 + fontSize: theme.fontSize.font14, }, - commentsContainer:{ - flexDirection:'row', + commentsContainer: { + flexDirection: "row", borderWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.black, - borderRadius:theme.borderRadius.radius20, - paddingHorizontal:20, - paddingVertical:6, - alignSelf:'center', + borderRadius: theme.borderRadius.radius20, + paddingHorizontal: 20, + paddingVertical: 6, + alignSelf: "center", }, - commentImageThree:{ - height:20, - width:20, + commentImageThree: { + height: 20, + width: 20, }, - commentClass:{ - marginRight:5, + commentClass: { + marginRight: 5, color: theme.colors.black, - fontSize: theme.fontSize.font14 + fontSize: theme.fontSize.font14, }, avatarContainer: { marginLeft: 11, marginRight: 11, - marginTop:20 + marginTop: 20, }, avatar: { height: 40, @@ -226,23 +224,22 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: 10, }, postInput: { - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 22, width: width - 90, marginLeft: 10, paddingHorizontal: 10, - justifyContent:'center', + justifyContent: "center", fontFamily: theme.fontType.regular, - }, containerFocus: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), paddingLeft: 11, - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), shadowColor: theme.colors.black, @@ -258,23 +255,23 @@ export const createStyleSheet = (theme: ThemeProps) => { }, elevation: 5, // position:'absolute', - top: -20 + top: -20, }, postContainer: { marginVertical: 10, - flexDirection: 'row', + flexDirection: "row", }, postFilter: { - flexDirection: 'row', - justifyContent: 'center' + flexDirection: "row", + justifyContent: "center", }, container3: { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'space-between', - alignItems: 'center', + alignItems: "center", marginRight: normalScale(2), marginLeft: normalScale(2), width: 110, @@ -284,7 +281,6 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - }, label2: { fontFamily: theme.fontType.regular, @@ -296,7 +292,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font14, color: theme.colors.green, }, - label4:{ + label4: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, @@ -305,7 +301,7 @@ export const createStyleSheet = (theme: ThemeProps) => { backgroundColor: theme.colors.white, margin: 10, borderRadius: 12, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 2 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -317,9 +313,9 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingVertical: verticalScale(6), paddingHorizontal: normalScale(6), backgroundColor: theme.colors.lightRed, - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(13), - marginHorizontal: 10 + marginHorizontal: 10, }, dummy: { width: normalScale(80), @@ -350,56 +346,56 @@ export const createStyleSheet = (theme: ThemeProps) => { // marginLeft: normalScale(10), }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: 10, }, pin: { height: normalScale(14), width: normalScale(14), marginRight: normalScale(8), - marginTop:6 + marginTop: 6, }, location: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, fullAddress: { fontFamily: theme.fontType.light, fontSize: theme.fontSize.font12, color: theme.colors.black, - marginTop:6 + marginTop: 6, }, addressDot: { height: 6, - width: 6, - marginTop:10, - marginHorizontal: 5 + width: 6, + marginTop: 10, + marginHorizontal: 5, }, sposerLabel: { - position: 'absolute', + position: "absolute", right: -32, top: 30, - zIndex: 11112222 + zIndex: 11112222, }, gretitude: { height: 20, width: 20, - position: 'absolute', + position: "absolute", right: 12, - bottom: 5 + bottom: 5, }, dateContainer: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", marginTop: verticalScale(10), marginHorizontal: 10, padding: 10, borderRadius: 12, backgroundColor: theme.colors.white, - shadowColor: 'lightgray', + shadowColor: "lightgray", shadowOffset: { width: 1, height: 3 }, shadowOpacity: 0.9, shadowRadius: 2, @@ -419,11 +415,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(8), }, posttitle: { - textAlign: 'center', - color: '#007112', + textAlign: "center", + color: "#007112", fontSize: 16, fontFamily: theme.fontType.regular, - marginTop:3 + marginTop: 3, }, feedContainer: { marginHorizontal: 10, @@ -433,19 +429,19 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: 8, paddingBottom: 14, paddingTop: 8, - backgroundColor:theme.colors.white, + backgroundColor: theme.colors.white, shadowColor: theme.colors.black, shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.9, - shadowRadius: 8, - elevation: 5 + shadowRadius: 8, + elevation: 5, }, - feedPostContainer:{ + feedPostContainer: { marginHorizontal: 10, marginVertical: 6, paddingBottom: 14, paddingTop: 8, - backgroundColor:theme.colors.white, + backgroundColor: theme.colors.white, }, postfilterImage: { height: 22, @@ -456,113 +452,111 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 40, borderRadius: 100, marginRight: 10, - alignItems: 'center', - marginTop: 7 + alignItems: "center", + marginTop: 7, }, userDetailcont: { marginHorizontal: 10, - flexDirection: 'row', + flexDirection: "row", }, postTime: { color: theme.colors.gray, fontSize: 14, fontFamily: theme.fontType.regular, - paddingTop:4 + paddingTop: 4, }, postDes: { - textAlign: 'left', + textAlign: "left", color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, marginHorizontal: 15, marginVertical: 10, - lineHeight:20 + lineHeight: 20, }, userPost: { height: 300, // width: 'auto', marginHorizontal: 10, marginBottom: 20, - borderRadius: 10 + borderRadius: 10, }, scrollViewStyle: { paddingBottom: verticalScale(100), }, - scrollView: { - // flex:1 + scrollView: { + // flex:1 // paddingBottom: verticalScale(140), // paddingHorizontal: normalScale(22), - }, + }, postDetail: { color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, // marginRight: 5, - width:width - 110, + width: width - 110, }, - postDetailTitle:{ + postDetailTitle: { color: theme.colors.black, fontSize: 12, fontFamily: theme.fontType.regular, marginRight: 5, }, postDetailCont: { - flexDirection: 'row', + flexDirection: "row", paddingHorizontal: 20, marginBottom: 5, - marginRight: 8 + marginRight: 8, }, detailImage: { height: 16, width: 16, - marginRight: 4 - + marginRight: 4, }, - userListDisplay:{ - - height:25, - width:25, - borderRadius:100, - marginHorizontal:2 + userListDisplay: { + height: 25, + width: 25, + borderRadius: 100, + marginHorizontal: 2, }, - userListDisplayCont:{ - flexDirection: 'row', - position: 'absolute', - right: 70, - top: 77 + userListDisplayCont: { + flexDirection: "row", + position: "absolute", + right: 70, + top: 77, }, - userListDisplayContTwo:{ - flexDirection: 'row', - position: 'absolute', - right: 70, - top: 85 + userListDisplayContTwo: { + flexDirection: "row", + position: "absolute", + right: 70, + top: 85, }, userNameGraties: { color: theme.colors.black, fontSize: 16, fontFamily: theme.fontType.regular, - width:width-120, + width: width - 120, }, userName: { color: theme.colors.black, fontSize: 16, - paddingTop:7, + paddingTop: 7, fontFamily: theme.fontType.regular, - width:width-120, + width: width - 120, }, - userNameTwo:{ + userNameTwo: { color: theme.colors.black, fontSize: 16, - paddingTop:7, + paddingTop: 7, fontFamily: theme.fontType.regular, }, - sentPointClass:{ + sentPointClass: { color: theme.colors.gray, fontSize: 16, fontFamily: theme.fontType.regular, - flexShrink:1, - width:width-100 + flexShrink: 1, + width: width - 100, }, likeCount: { color: theme.colors.black, @@ -572,7 +566,7 @@ export const createStyleSheet = (theme: ThemeProps) => { commentImage: { height: 14, width: 14, - marginLeft:5 + marginLeft: 5, }, msgCount: { color: theme.colors.black, @@ -580,19 +574,19 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, }, commentTitle: { - flexDirection: 'row', - justifyContent: 'space-between', - marginHorizontal: 13 + flexDirection: "row", + justifyContent: "space-between", + marginHorizontal: 13, }, commentCont: { - flexDirection: 'row' + flexDirection: "row", }, commentContTwo: { - flexDirection: 'row', - justifyContent: 'space-evenly', - alignItems: 'center', - paddingTop:2, - paddingBottom:2 + flexDirection: "row", + justifyContent: "space-evenly", + alignItems: "center", + paddingTop: 2, + paddingBottom: 2, }, commentImgTwo: { height: 23, @@ -600,39 +594,39 @@ export const createStyleSheet = (theme: ThemeProps) => { }, commentContShow: { fontSize: 12, - color: '#000000', + color: "#000000", marginHorizontal: 13, - marginTop: 2 + marginTop: 2, }, commentImgProfile: { marginLeft: 16, marginRight: 30, - flexDirection: 'row', + flexDirection: "row", // justifyContent: 'flex-start', - marginVertical:6, + marginVertical: 6, // overflow:'hidden' }, bottomButton: { - justifyContent: 'flex-end', + justifyContent: "flex-end", paddingHorizontal: normalScale(16), backgroundColor: theme.colors.white, paddingBottom: verticalScale(25), paddingTop: verticalScale(5), }, commentDisplayCont: { - backgroundColor: '#E6E6E6', + backgroundColor: "#E6E6E6", borderWidth: 2, - borderColor: '#C2DBC6', + borderColor: "#C2DBC6", // height: 'auto', borderRadius: 20, width: 230, paddingHorizontal: 10, paddingTop: 6, - paddingBottom: 6 + paddingBottom: 6, }, replyMsgCont: { fontSize: 12, - color: '#110101', + color: "#110101", paddingTop: 2, paddingLeft: 14, }, @@ -641,175 +635,176 @@ export const createStyleSheet = (theme: ThemeProps) => { width: 24, marginLeft: 20, }, - scrollViewComment:{ + scrollViewComment: { flex: 1, }, replyContainer: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 70, marginTop: 2, }, replyLbl: { - color:theme.colors.black, + color: theme.colors.black, fontSize: 12, - marginTop: 4 + marginTop: 4, }, - vectorImg:{ - height:10, - width:10, - marginTop:6, - marginRight:1 + vectorImg: { + height: 10, + width: 10, + marginTop: 6, + marginRight: 1, }, - vectorImgTwo:{ - height:10, - width:10, - marginTop:6,marginRight:5 + vectorImgTwo: { + height: 10, + width: 10, + marginTop: 6, + marginRight: 5, }, minuteCont: { fontSize: 12, marginLeft: 8, marginTop: 4, - color:theme.colors.black, + color: theme.colors.black, }, commentImgProfileTwo: { - flexDirection: 'row', + flexDirection: "row", marginLeft: 20, - justifyContent:'center', + justifyContent: "center", marginTop: 5, - overflow:'hidden' + overflow: "hidden", }, replyContainerTwo: { - flexDirection: 'row', - justifyContent:'center', + flexDirection: "row", + justifyContent: "center", marginLeft: 65, // marginLeft: 145, - marginVertical:10, + marginVertical: 10, // marginTop: 2, }, replyIcon: { height: 9, width: 10, marginTop: 6, - marginRight: 4 + marginRight: 4, }, replyMoreLbl: { fontSize: 12, - marginTop: 4, + marginTop: 4, marginRight: 50, - color:theme.colors.black, + color: theme.colors.black, }, - textOne:{ + textOne: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - createPostModal:{ + createPostModal: { borderTopRightRadius: 24, borderTopLeftRadius: 24, paddingVertical: verticalScale(20), - paddingHorizontal:8, + paddingHorizontal: 8, borderColor: theme.colors.lightGreen, - backgroundColor: 'rgba(255, 255, 255, 0.4)', + backgroundColor: "rgba(255, 255, 255, 0.4)", borderTopWidth: 4, borderLeftWidth: 4, borderRightWidth: 4, marginHorizontal: 7, // flex: 1 }, - createPostCont:{ - flexDirection:'row', - alignItems:'center' + createPostCont: { + flexDirection: "row", + alignItems: "center", }, postInputTwo: { - backgroundColor: 'lightgray', + backgroundColor: "lightgray", borderRadius: 10, width: width - 200, marginLeft: 10, paddingHorizontal: 10, - height:35, - justifyContent:'center' - }, - createImgOne:{ - height:20, - width:20, - marginRight:5 - }, - quntitiyInput:{ - width:90, - height:30, - backgroundColor:'lightgray', - borderRadius:12, - paddingHorizontal:5 - }, - quntitiyCont:{ - flexDirection:'row', - marginTop:10, - marginBottom:10, - alignItems:'center', - marginLeft:50 - }, - postCont:{ - marginTop:10 - }, - postinput:{ - height:160, - marginTop:5, - backgroundColor:'lightgray', - borderRadius:12, - paddingHorizontal:5 - }, - tagCont:{ - marginTop:10, - flexDirection:'row', - alignItems:'center' - }, - tagInput:{ - height:30, - backgroundColor:'lightgray', - width:200, - borderRadius:12, - paddingHorizontal:5, - marginLeft:10 - }, - imagesCont:{ - flexDirection:'row', - marginTop:10 - }, - textTwo:{ + height: 35, + justifyContent: "center", + }, + createImgOne: { + height: 20, + width: 20, + marginRight: 5, + }, + quntitiyInput: { + width: 90, + height: 30, + backgroundColor: "lightgray", + borderRadius: 12, + paddingHorizontal: 5, + }, + quntitiyCont: { + flexDirection: "row", + marginTop: 10, + marginBottom: 10, + alignItems: "center", + marginLeft: 50, + }, + postCont: { + marginTop: 10, + }, + postinput: { + height: 160, + marginTop: 5, + backgroundColor: "lightgray", + borderRadius: 12, + paddingHorizontal: 5, + }, + tagCont: { + marginTop: 10, + flexDirection: "row", + alignItems: "center", + }, + tagInput: { + height: 30, + backgroundColor: "lightgray", + width: 200, + borderRadius: 12, + paddingHorizontal: 5, + marginLeft: 10, + }, + imagesCont: { + flexDirection: "row", + marginTop: 10, + }, + textTwo: { color: theme.colors.black, fontSize: 15, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' + marginRight: 5, + fontWeight: "600", }, - textThree:{ - color: 'lightgray', + textThree: { + color: "lightgray", fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600' - }, - multipleImagecont:{ - flexDirection:'row' - }, - selectImage:{ - height:80, - width:100, - borderRadius:12, - marginRight:10, - marginTop:15 - }, - postClass:{ - borderColor:'green', - borderWidth:2, - borderRadius:10, - padding:10, - margin:10 + marginRight: 5, + fontWeight: "600", + }, + multipleImagecont: { + flexDirection: "row", + }, + selectImage: { + height: 80, + width: 100, + borderRadius: 12, + marginRight: 10, + marginTop: 15, + }, + postClass: { + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + padding: 10, + margin: 10, }, purchaseContainer: { - backgroundColor: '#007112', + backgroundColor: "#007112", borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(14), shadowColor: theme.colors.black, @@ -820,11 +815,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), - marginHorizontal: 45 + marginHorizontal: 45, }, titleTwo: { fontFamily: theme.fontType.medium, @@ -836,96 +831,96 @@ export const createStyleSheet = (theme: ThemeProps) => { width: normalScale(30), marginLeft: normalScale(10), }, - gratiescontainer:{ + gratiescontainer: { // height:180, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - bottom:15, - margin:16, - padding:10 - }, - gratiesTitle:{ + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + bottom: 15, + margin: 16, + padding: 10, + }, + gratiesTitle: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font16, color: theme.colors.black, - marginBottom:10, - textAlign:'center' + marginBottom: 10, + textAlign: "center", }, - gratisimg:{ - height:45, - width:45 + gratisimg: { + height: 45, + width: 45, }, - gratistext:{ + gratistext: { fontFamily: theme.fontType.bold, fontSize: theme.fontSize.font36, color: theme.colors.black, - fontWeight:'600', - marginLeft:10 - }, - gratisCont:{ - flexDirection:'row', - justifyContent:'center', - alignItems:'center', - marginVertical:10 - }, - commentInput:{ - height:40, - width:width-90, - backgroundColor:'lightgray', - borderRadius:12, - paddingVertical:5, - marginVertical:10, - marginHorizontal:10, - padding:10, - color: theme.colors.black - }, - commentContainer:{ - height:200, - borderColor:'green', - borderWidth:2, - borderRadius:10, - backgroundColor: 'rgba(255, 255, 255, 10)', - margin:20, - padding:10, + fontWeight: "600", + marginLeft: 10, + }, + gratisCont: { + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + marginVertical: 10, + }, + commentInput: { + height: 40, + width: width - 90, + backgroundColor: "lightgray", + borderRadius: 12, + paddingVertical: 5, + marginVertical: 10, + marginHorizontal: 10, + padding: 10, + color: theme.colors.black, + }, + commentContainer: { + height: 200, + borderColor: "green", + borderWidth: 2, + borderRadius: 10, + backgroundColor: "rgba(255, 255, 255, 10)", + margin: 20, + padding: 10, // justifyContent:'center' }, - createPostContTwo:{ - flexDirection:'row', - alignItems : 'flex-start' + createPostContTwo: { + flexDirection: "row", + alignItems: "flex-start", }, - textTwoWhere:{ + textTwoWhere: { color: theme.colors.black, fontSize: 14, fontFamily: theme.fontType.regular, - marginRight:5, - fontWeight:'600', - paddingTop : 9 + marginRight: 5, + fontWeight: "600", + paddingTop: 9, }, - createImgTwo:{ - height:20, - width:20, - marginTop : 8, - marginRight:5 + createImgTwo: { + height: 20, + width: 20, + marginTop: 8, + marginRight: 5, }, keyboardView: { - position: 'absolute', + position: "absolute", // top:650, bottom: 0, left: 0, right: 0, }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, right: 0, backgroundColor: theme.colors.modalOverlay, }, - containerPost:{ - position: 'absolute', + containerPost: { + position: "absolute", top: 0, bottom: 0, left: 0, @@ -936,90 +931,90 @@ export const createStyleSheet = (theme: ThemeProps) => { flex: 1, }, keyboardViewTwo: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, // top:0 }, imageActionSheet: { - position: 'absolute', + position: "absolute", // top: 310, bottom: 0, left: 0, right: 0, - height: 'auto', + height: "auto", // backgroundColor: theme.colors.modalOverlay, borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(600), borderColor: theme.colors.lightPurple, - backgroundColor: 'rgba(255, 255, 255, 0.88)', + backgroundColor: "rgba(255, 255, 255, 0.88)", borderTopWidth: 3, borderLeftWidth: 3, borderRightWidth: 3, flex: 1, - marginHorizontal: 10 + marginHorizontal: 10, }, - postActionSheet:{ - position: 'absolute', + postActionSheet: { + position: "absolute", // top: 310, bottom: 0, left: 0, right: 0, - height: 'auto', + height: "auto", // backgroundColor: theme.colors.modalOverlay, borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(600), borderColor: theme.colors.lightPurple, - backgroundColor: 'rgba(255, 255, 255, 0.88)', + backgroundColor: "rgba(255, 255, 255, 0.88)", borderTopWidth: 3, borderLeftWidth: 3, borderRightWidth: 3, flex: 1, - marginHorizontal: 10 + marginHorizontal: 10, }, - postText:{ - textAlign: 'center', + postText: { + textAlign: "center", fontSize: 18, fontFamily: theme.fontType.medium, - backgroundColor: '#A493B7', - borderRadius:16, + backgroundColor: "#A493B7", + borderRadius: 16, padding: 10, margin: 10, - color:theme.colors.black, + color: theme.colors.black, }, - MainPostContainer:{ - backgroundColor:theme.colors.darkenBlack, - flex:1 + MainPostContainer: { + backgroundColor: theme.colors.darkenBlack, + flex: 1, }, - commentModalContainer:{ - height:'100%', + commentModalContainer: { + height: "100%", // marginTop:80, - backgroundColor:theme.colors.white, - borderTopStartRadius:16, - borderTopEndRadius:16, - }, - notchCont:{ - borderRadius:20, - padding:2, - backgroundColor:theme.colors.black, - alignSelf:'center', - width:50, - marginTop:80, - marginBottom:20 - }, - getMoreDataCont:{ - fontSize:16, - color:theme.colors.black, - padding:10, - marginVertical:10, - alignSelf:'center', - borderRadius:20, - borderWidth:theme.borderWidth.borderWidth1 - } + backgroundColor: theme.colors.white, + borderTopStartRadius: 16, + borderTopEndRadius: 16, + }, + notchCont: { + borderRadius: 20, + padding: 2, + backgroundColor: theme.colors.black, + alignSelf: "center", + width: 50, + marginTop: 80, + marginBottom: 20, + }, + getMoreDataCont: { + fontSize: 16, + color: theme.colors.black, + padding: 10, + marginVertical: 10, + alignSelf: "center", + borderRadius: 20, + borderWidth: theme.borderWidth.borderWidth1, + }, }); }; diff --git a/src/screens/login/index.tsx b/src/screens/login/index.tsx index 26189a186..1ea0bacad 100644 --- a/src/screens/login/index.tsx +++ b/src/screens/login/index.tsx @@ -517,10 +517,10 @@ export const LoginScreen = (props: LoginScreenProps) => { const onCheckReleaseHideShow = () => { if (Platform.OS === "ios") { const isShowPaymentCheck = getData("isShowPaymentFlow"); - return isShowPaymentCheck - } else{ + return isShowPaymentCheck; + } else { const isShowPaymentCheckAndroid = getData("isShowPaymentFlowAndroid"); - return isShowPaymentCheckAndroid + return isShowPaymentCheckAndroid; } }; diff --git a/src/screens/login/style.ts b/src/screens/login/style.ts index b59338887..5a285e9e7 100644 --- a/src/screens/login/style.ts +++ b/src/screens/login/style.ts @@ -1,23 +1,23 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ loginLogo: { height: normalScale(85), width: normalScale(85), - alignSelf: 'center', + alignSelf: "center", }, container: { - backgroundColor:theme.colors.appColor, + backgroundColor: theme.colors.appColor, paddingHorizontal: normalScale(50), - flex:1 + flex: 1, }, tncStyle: { - flexDirection: 'row', - alignItems: 'center', - marginLeft:16 + flexDirection: "row", + alignItems: "center", + marginLeft: 16, }, radio: { height: normalScale(16), @@ -30,43 +30,43 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.white, }, bold: { - fontFamily: theme.fontType.bold, + fontFamily: theme.fontType.bold, color: theme.colors.lightBlueTwo, fontSize: theme.fontSize.font16, }, - temsCont:{ + temsCont: { // borderBottomWidth:theme.borderWidth.borderWidth1, // borderBottomColor:theme.colors.blue - }, + }, forgot: { fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, color: theme.colors.white, - marginHorizontal:5 + marginHorizontal: 5, // alignSelf: 'center', }, googleButton: { borderRadius: theme.borderRadius.radius18, borderWidth: theme.borderWidth.borderWidth2, borderColor: theme.colors.black, - backgroundColor:theme.colors.gray, + backgroundColor: theme.colors.gray, paddingHorizontal: normalScale(10), paddingVertical: verticalScale(7), - alignSelf: 'center', - flexDirection: 'row', - width:'60%' + alignSelf: "center", + flexDirection: "row", + width: "60%", }, - appleButton:{ + appleButton: { borderRadius: theme.borderRadius.radius18, borderWidth: theme.borderWidth.borderWidth2, borderColor: theme.colors.black, - backgroundColor:theme.colors.black, + backgroundColor: theme.colors.black, paddingHorizontal: normalScale(10), paddingVertical: verticalScale(4), - alignSelf: 'center', - flexDirection: 'row', - width:'60%' + alignSelf: "center", + flexDirection: "row", + width: "60%", }, google: { height: normalScale(24), @@ -81,63 +81,61 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, color: theme.colors.black, marginLeft: normalScale(10), - alignSelf:'center' + alignSelf: "center", }, loginApple: { fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, color: theme.colors.white, marginLeft: normalScale(10), - alignSelf:'center' + alignSelf: "center", }, - signUpBtn:{ + signUpBtn: { backgroundColor: theme.colors.lightBlueTwo, borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, shadowRadius: theme.borderRadius.radius8, - borderColor:theme.colors.white, - borderWidth:theme.borderWidth.borderWidth2, - color:theme.colors.black, + borderColor: theme.colors.white, + borderWidth: theme.borderWidth.borderWidth2, + color: theme.colors.black, shadowOffset: { - width: 0, height: verticalScale(0), }, elevation: 5, paddingHorizontal: normalScale(10), - marginTop:12 + marginTop: 12, }, - loginBtn:{ - backgroundColor: '#BF820A', + loginBtn: { + backgroundColor: "#BF820A", borderRadius: theme.borderRadius.radius14, paddingVertical: verticalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, shadowRadius: theme.borderRadius.radius8, - borderColor:theme.colors.white, - borderWidth:theme.borderWidth.borderWidth2, - color:theme.colors.black, + borderColor: theme.colors.white, + borderWidth: theme.borderWidth.borderWidth2, + color: theme.colors.black, shadowOffset: { - width: 0, height: verticalScale(0), }, elevation: 5, paddingHorizontal: normalScale(10), - marginTop:12 + marginTop: 12, }, - signUpText:{ - fontSize:14, - textAlign:'center', - color:theme.colors.black + signUpText: { + fontSize: 14, + textAlign: "center", + color: theme.colors.black, }, HeaderContainerTwo: { - flexDirection:'row' + flexDirection: "row", }, row2: { // position: 'absolute', @@ -145,23 +143,23 @@ export const createStyleSheet = (theme: ThemeProps) => { // left: 10, height: normalScale(30), width: normalScale(30), - zIndex:11111222222 + zIndex: 11111222222, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, color: theme.colors.white, - zIndex:11111222 + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -169,64 +167,62 @@ export const createStyleSheet = (theme: ThemeProps) => { marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', + flexDirection: "row", + justifyContent: "center", }, - localText:{ - textAlign: 'center', + localText: { + textAlign: "center", fontSize: 16, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, - }, oneContainerImage: { height: normalScale(100), width: normalScale(100), - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 75, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, - marginBottom:-10, - + marginBottom: -10, }, texClass: { fontSize: 15, fontFamily: theme.fontType.medium, color: theme.colors.white, - fontWeight: '600', - marginBottom:3 + fontWeight: "600", + marginBottom: 3, }, - orText:{ + orText: { fontSize: 16, fontFamily: theme.fontType.medium, color: theme.colors.white, - fontWeight: '600', - textAlign:'center' + fontWeight: "600", + textAlign: "center", }, textInput: { - backgroundColor: 'white', + backgroundColor: "white", borderRadius: 8, fontSize: 14, - borderColor: '#8B8888', + borderColor: "#8B8888", borderWidth: 1, padding: normalScale(10), fontFamily: theme.fontType.medium, height: verticalScale(38), - color: 'black', + color: "black", }, }); }; diff --git a/src/screens/payment-screen/index.tsx b/src/screens/payment-screen/index.tsx index 6356b7cdb..5cfa820e3 100644 --- a/src/screens/payment-screen/index.tsx +++ b/src/screens/payment-screen/index.tsx @@ -1,11 +1,11 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import React, {useCallback} from 'react'; -import {PaymentSheet, useStripe} from '@stripe/stripe-react-native'; +import React, { useCallback } from "react"; +import { PaymentSheet, useStripe } from "@stripe/stripe-react-native"; import { NavigationContainerRef, ParamListBase, useFocusEffect, -} from '@react-navigation/native'; +} from "@react-navigation/native"; interface PaymentScreenProps { navigation?: NavigationContainerRef; @@ -18,17 +18,20 @@ interface PaymentScreenProps { } export const PaymentScreen = (props: PaymentScreenProps) => { - const {route, navigation} = props || {}; - const {clientSecret, onSuccess} = route?.params ?? {}; - const {initPaymentSheet, presentPaymentSheet} = useStripe(); + const { route, navigation } = props || {}; + const { clientSecret, onSuccess } = route?.params ?? {}; + const { initPaymentSheet, presentPaymentSheet } = useStripe(); const initializePaymentSheet = async () => { - console.log('-------------------------initializePaymentSheet---------------------',initPaymentSheet) + console.log( + "-------------------------initializePaymentSheet---------------------", + initPaymentSheet + ); try { await initPaymentSheet({ - paymentIntentClientSecret: clientSecret ?? '', - merchantDisplayName: 'Bold Boulder', - style: 'automatic', + paymentIntentClientSecret: clientSecret ?? "", + merchantDisplayName: "Bold Boulder", + style: "automatic", billingDetailsCollectionConfiguration: { address: PaymentSheet.AddressCollectionMode.FULL, name: PaymentSheet.CollectionMode.ALWAYS, @@ -46,11 +49,17 @@ export const PaymentScreen = (props: PaymentScreenProps) => { const openPaymentSheet = async () => { try { const res = await presentPaymentSheet(); - console.log('-------------------------openPaymentSheet---------------------',res) - if (res?.error?.code === 'Canceled') { + console.log( + "-------------------------openPaymentSheet---------------------", + res + ); + if (res?.error?.code === "Canceled") { navigation?.goBack(); } else { - console.log('-----------------onSuccess call-----------------',onSuccess) + console.log( + "-----------------onSuccess call-----------------", + onSuccess + ); onSuccess?.(); } } catch (err) { @@ -63,7 +72,7 @@ export const PaymentScreen = (props: PaymentScreenProps) => { if (clientSecret) { initializePaymentSheet(); } - }, [clientSecret]), + }, [clientSecret]) ); return <>; diff --git a/src/screens/payment-screen/style.ts b/src/screens/payment-screen/style.ts index 225f5146b..8ee865dd4 100644 --- a/src/screens/payment-screen/style.ts +++ b/src/screens/payment-screen/style.ts @@ -1,6 +1,6 @@ -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {ThemeProps} from '@theme/theme'; -import {StyleSheet} from 'react-native'; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -13,7 +13,7 @@ export const createStyleSheet = (theme: ThemeProps) => { textColor: theme.colors.black, }, card: { - width: '100%', + width: "100%", height: verticalScale(50), marginVertical: verticalScale(30), }, diff --git a/src/screens/profile/about.tsx b/src/screens/profile/about.tsx index 4fbf91a9f..d6e3dca25 100644 --- a/src/screens/profile/about.tsx +++ b/src/screens/profile/about.tsx @@ -149,10 +149,10 @@ export const About = (props: AboutDataProps) => { const onCheckReleaseHideShow = () => { if (Platform.OS === "ios") { const isShowPaymentCheck = getData("isShowPaymentFlow"); - return isShowPaymentCheck - } else{ + return isShowPaymentCheck; + } else { const isShowPaymentCheckAndroid = getData("isShowPaymentFlowAndroid"); - return isShowPaymentCheckAndroid + return isShowPaymentCheckAndroid; } }; @@ -259,7 +259,6 @@ export const About = (props: AboutDataProps) => { } } - // ================= Cancle Subscription API ==================== async function cancleSubscriptionAPI() { @@ -336,7 +335,7 @@ export const About = (props: AboutDataProps) => { }; const memberShipClick = async (id: any) => { - console.log(id,'event detail'); + console.log(id, "event detail"); setTimeout(() => { setMemberModal(true); }, 1000); @@ -352,7 +351,7 @@ export const About = (props: AboutDataProps) => { setModalVisible(false); packageListAPI(); userProfileUpdate(); - } + }; const addCardModalHide = () => { addCardModal(false); @@ -787,12 +786,12 @@ export const About = (props: AboutDataProps) => { })} */} - + @@ -894,7 +893,13 @@ export const About = (props: AboutDataProps) => { - + { updateAnsBack(); diff --git a/src/screens/profile/index.tsx b/src/screens/profile/index.tsx index 17fd5eee8..470867c29 100644 --- a/src/screens/profile/index.tsx +++ b/src/screens/profile/index.tsx @@ -187,10 +187,10 @@ export const ProfileScreen = (props: ProfileScreenProps) => { const onCheckReleaseHideShow = () => { if (Platform.OS === "ios") { const isShowPaymentCheck = getData("isShowPaymentFlow"); - return isShowPaymentCheck - } else{ + return isShowPaymentCheck; + } else { const isShowPaymentCheckAndroid = getData("isShowPaymentFlowAndroid"); - return isShowPaymentCheckAndroid + return isShowPaymentCheckAndroid; } }; @@ -429,12 +429,12 @@ export const ProfileScreen = (props: ProfileScreenProps) => { LodingData(true); if (pic !== profileUri) { body.profile = profileUri; - } + } const res = await mutateAsync({ bodyParams: body, userId: user?.id }); if (res?.success) { navigation.goBack(); - }else{ + } else { Toast.show(res?.message, Toast.LONG, { backgroundColor: "black", }); diff --git a/src/screens/profile/membership-checkout-modal.tsx b/src/screens/profile/membership-checkout-modal.tsx index fb35b008b..6f8c2aa6e 100644 --- a/src/screens/profile/membership-checkout-modal.tsx +++ b/src/screens/profile/membership-checkout-modal.tsx @@ -26,22 +26,27 @@ import { API_URL, persistKeys } from "@network/constant"; import { useToken } from "@app-hooks/use-token"; import AsyncStorage from "@react-native-async-storage/async-storage"; import Toast from "react-native-simple-toast"; -import { addCard, buttonArrow, buttonArrowBlue, closeCard } from "@assets/images"; +import { + addCard, + buttonArrow, + buttonArrowBlue, + closeCard, +} from "@assets/images"; import { ButtonComponent } from "@components/button-component"; import { useFocusEffect } from "@react-navigation/native"; interface membershipModalProps { memberModal: boolean; onCancel?: () => void; - dataId:number | string; - successData?: () => void + dataId: number | string; + successData?: () => void; } export const MembershipCheckoutModal = (props: membershipModalProps) => { const { theme } = useAppTheme(); const { strings } = useStringsAndLabels(); const styles = createStyleSheet(theme); - const {memberModal, onCancel, dataId, successData} = props || {}; + const { memberModal, onCancel, dataId, successData } = props || {}; const [modalVisible, setModalVisible] = useState(false); // const [memberModal, setMemberModal] = useState(false); // const [postData, setDataEntries]: any = useState({}); @@ -68,25 +73,28 @@ export const MembershipCheckoutModal = (props: membershipModalProps) => { // const [tokens, setToken] = useState(""); const [cardExpmonth, cardExpMonth] = useState(""); const [cardExpyear, cardExpYears] = useState(""); - const [MemberShipTitle, setMemberShipTitle]:any = useState(); + const [MemberShipTitle, setMemberShipTitle]: any = useState(); useEffect(() => { - console.log(memberModal, '--------------memberModal12345---------------') + console.log(memberModal, "--------------memberModal12345---------------"); LogBox.ignoreAllLogs(); - memberShipCheckoutAPI() + memberShipCheckoutAPI(); }, []); // =================MemberShip Checkout API==================== async function memberShipCheckoutAPI() { const token = await AsyncStorage.getItem("token"); - console.log(token, '--------------------------') + console.log(token, "--------------------------"); try { - console.log(dataId, "---------------dataId dataId------------------------------------"); + console.log( + dataId, + "---------------dataId dataId------------------------------------" + ); const response = await fetch( API_URL + "/v1/subscriptions/packages/" + dataId + "/checkout", // API_URL + "/v1/subscriptions/packages/" + '655f484562030949923d50c3' + "/checkout", - + { method: "get", headers: new Headers({ @@ -101,7 +109,7 @@ export const MembershipCheckoutModal = (props: membershipModalProps) => { console.log("===========MemberShip checkout=============="); console.log(dataItems); // setDatacheckout(dataItem); - setMemberShipTitle(dataItems?.data) + setMemberShipTitle(dataItems?.data); monthlyPlanData(dataItems?.data?.plans[0]); yearlyPlanData(dataItems?.data?.plans[1]); monthlyPrice( @@ -113,75 +121,73 @@ export const MembershipCheckoutModal = (props: membershipModalProps) => { descriptionData(dataItems.data.description); addCardList(dataItems?.data?.card); console.log("=======================dsd==ds=d=========="); - console.log(monthlyPlan, '-------------monthlyPlan-----------------'); - console.log(yearlyPlan, '-------------yearlyPlan-------------'); + console.log(monthlyPlan, "-------------monthlyPlan-----------------"); + console.log(yearlyPlan, "-------------yearlyPlan-------------"); console.log(description); } catch (error) { console.error(error); } } + // ================= Purchase API ==================== - // ================= Purchase API ==================== - - async function onPurchaseAPI() { - LodingData(true); - if (isBilledMonthly) { - var purchesData: any = { - plan_id: monthlyPlan.plan_id, - price_id: monthlyPlan.price_id, - totalUnitsMonthly: monthPrice, - }; - } else if (!isBilledMonthly) { - var purchesData: any = { - plan_id: yearlyPlan.plan_id, - price_id: yearlyPlan.price_id, - totalUnitsMonthly: YerlyPrice, - }; - } - - console.log(purchesData); - - console.log(idPackage); - - try { - const response = await fetch( - API_URL + "/v1/subscriptions/" + dataId + "/purchase", - // API_URL + "/v1/subscriptions/" + idPackage + "/purchase", - { - method: "post", - headers: new Headers({ - Authorization: "Bearer " + token, - "Content-Type": "application/x-www-form-urlencoded", - }), - body: Object.keys(purchesData) - .map((key) => key + "=" + purchesData[key]) - .join("&"), - } - ); - const dataItem = await response.json(); - LodingData(false); - console.log("=========== Purchase API =============="); - console.log(dataItem); - if (dataItem.success == true) { - // packageListAPI(); - // userProfileUpdate(); - - successData?.(); - Toast.show(dataItem.message, Toast.LONG, { - backgroundColor: "black", - }); - } else { - Toast.show(dataItem.message, Toast.LONG, { - backgroundColor: "black", - }); + async function onPurchaseAPI() { + LodingData(true); + if (isBilledMonthly) { + var purchesData: any = { + plan_id: monthlyPlan.plan_id, + price_id: monthlyPlan.price_id, + totalUnitsMonthly: monthPrice, + }; + } else if (!isBilledMonthly) { + var purchesData: any = { + plan_id: yearlyPlan.plan_id, + price_id: yearlyPlan.price_id, + totalUnitsMonthly: YerlyPrice, + }; + } + + console.log(purchesData); + + console.log(idPackage); + + try { + const response = await fetch( + API_URL + "/v1/subscriptions/" + dataId + "/purchase", + // API_URL + "/v1/subscriptions/" + idPackage + "/purchase", + { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", + }), + body: Object.keys(purchesData) + .map((key) => key + "=" + purchesData[key]) + .join("&"), } - } catch (error) { - LodingData(false); - console.error(error); + ); + const dataItem = await response.json(); + LodingData(false); + console.log("=========== Purchase API =============="); + console.log(dataItem); + if (dataItem.success == true) { + // packageListAPI(); + // userProfileUpdate(); + + successData?.(); + Toast.show(dataItem.message, Toast.LONG, { + backgroundColor: "black", + }); + } else { + Toast.show(dataItem.message, Toast.LONG, { + backgroundColor: "black", + }); } + } catch (error) { + LodingData(false); + console.error(error); } - + } async function onCheckValidation() { LodingData(true); @@ -205,130 +211,129 @@ export const MembershipCheckoutModal = (props: membershipModalProps) => { } } - - // ======================Config API========================= - const ConfigListAPI = async () => { - const token = await AsyncStorage.getItem("token"); - try { - const response = await fetch(API_URL + "/v1/config/list", { - method: "get", - headers: new Headers({ - Authorization: "Bearer " + token, - "Content-Type": "application/x-www-form-urlencoded", - }), - }); - const dataItem = await response.json(); - console.log("-----------------add card config list------------"); - const keyId = dataItem?.data?.stripe?.stripePublicKey; - console.log(dataItem); - setTimeout(() => { - cardStripeAPI(keyId); - }, 2000); - setTimeout(() => { - LodingData(false); - }, 7000); - } catch (error) { - console.error(error); - } - }; - - // ======================Stripe API========================= - - async function cardStripeAPI(stripeId: any) { - const genCard: any = { - "card[number]": cardnumber, - "card[exp_month]": cardExpmonth, - "card[exp_year]": cardExpyear, - "card[cvc]": cardCvv, - }; - - console.log(genCard); - - const results = await fetch("https://api.stripe.com/v1/tokens", { - method: "post", - headers: { - Accept: "application/json", + // ======================Config API========================= + const ConfigListAPI = async () => { + const token = await AsyncStorage.getItem("token"); + try { + const response = await fetch(API_URL + "/v1/config/list", { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, "Content-Type": "application/x-www-form-urlencoded", - Authorization: "Bearer " + stripeId, - }, - body: Object.keys(genCard) - .map((key) => key + "=" + genCard[key]) - .join("&"), - }).then((response) => response.json()); - - const card_tok = results.id; - + }), + }); + const dataItem = await response.json(); + console.log("-----------------add card config list------------"); + const keyId = dataItem?.data?.stripe?.stripePublicKey; + console.log(dataItem); setTimeout(() => { - if (results.id) { - CreateCardAPI(card_tok); - console.log("============CreateCardAPI============"); - } - }, 3000); - - console.log("================card stripe api=================="); - console.log(results); - - if (results.error) { - Toast.show(results.error.message, Toast.LONG, { - backgroundColor: "black", - }); - } - - return; + cardStripeAPI(keyId); + }, 2000); + setTimeout(() => { + LodingData(false); + }, 7000); + } catch (error) { + console.error(error); } - - // ======================Create Card API========================= - async function CreateCardAPI(cardId: any) { - const token = await AsyncStorage.getItem("token"); - var cardtokenData: any = { - token: cardId, - }; - try { - const response = await fetch(API_URL + "/v1/subscriptions/cards/create", { - method: "post", - headers: new Headers({ - Authorization: "Bearer " + token, - "Content-Type": "application/x-www-form-urlencoded", - }), - body: Object.keys(cardtokenData) - .map((key) => key + "=" + cardtokenData[key]) - .join("&"), - }); - console.log(cardId); - const dataItem = await response.json(); - console.log("-----------------create card------------"); - console.log(dataItem); - cardNumberData(""); - cardExpMonth(""); - cardExpYears(""); - cardCVVData(""); - setDate(""); - memberShipCheckoutAPI(); - if (dataItem.success == true) { - addCardModal(false); - } - Toast.show(dataItem.message, Toast.LONG, { - backgroundColor: "black", - }); - } catch (error) { - console.error(error); + }; + + // ======================Stripe API========================= + + async function cardStripeAPI(stripeId: any) { + const genCard: any = { + "card[number]": cardnumber, + "card[exp_month]": cardExpmonth, + "card[exp_year]": cardExpyear, + "card[cvc]": cardCvv, + }; + + console.log(genCard); + + const results = await fetch("https://api.stripe.com/v1/tokens", { + method: "post", + headers: { + Accept: "application/json", + "Content-Type": "application/x-www-form-urlencoded", + Authorization: "Bearer " + stripeId, + }, + body: Object.keys(genCard) + .map((key) => key + "=" + genCard[key]) + .join("&"), + }).then((response) => response.json()); + + const card_tok = results.id; + + setTimeout(() => { + if (results.id) { + CreateCardAPI(card_tok); + console.log("============CreateCardAPI============"); } + }, 3000); + + console.log("================card stripe api=================="); + console.log(results); + + if (results.error) { + Toast.show(results.error.message, Toast.LONG, { + backgroundColor: "black", + }); } - const addCardModalHide = () => { - addCardModal(false); + return; + } + + // ======================Create Card API========================= + async function CreateCardAPI(cardId: any) { + const token = await AsyncStorage.getItem("token"); + var cardtokenData: any = { + token: cardId, + }; + try { + const response = await fetch(API_URL + "/v1/subscriptions/cards/create", { + method: "post", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", + }), + body: Object.keys(cardtokenData) + .map((key) => key + "=" + cardtokenData[key]) + .join("&"), + }); + console.log(cardId); + const dataItem = await response.json(); + console.log("-----------------create card------------"); + console.log(dataItem); cardNumberData(""); cardExpMonth(""); cardExpYears(""); cardCVVData(""); setDate(""); - }; + memberShipCheckoutAPI(); + if (dataItem.success == true) { + addCardModal(false); + } + Toast.show(dataItem.message, Toast.LONG, { + backgroundColor: "black", + }); + } catch (error) { + console.error(error); + } + } + + const addCardModalHide = () => { + addCardModal(false); + cardNumberData(""); + cardExpMonth(""); + cardExpYears(""); + cardCVVData(""); + setDate(""); + }; + + const onOpenModal = () => { + // addcardRef.current?.onOpenModal(); + addCardModal(true); + }; - const onOpenModal = () => { - // addcardRef.current?.onOpenModal(); - addCardModal(true); - }; - const memberShipHide = () => { onCancel?.(); // setMemberModal(false); @@ -607,7 +612,9 @@ export const MembershipCheckoutModal = (props: membershipModalProps) => { source={{ uri: MemberShipTitle?.role_image }} style={[styles.icon1]} /> - {MemberShipTitle?.title} + + {MemberShipTitle?.title} + { useFocusEffect( useCallback(() => { - console.log('--------------useFocusEffect getEventListAPI------------------'); + console.log( + "--------------useFocusEffect getEventListAPI------------------" + ); getEventListsAPI(); - }, [page]), + }, [page]) ); useFocusEffect( useCallback(() => { onPageLoad(false); - setPage(1); + setPage(1); setEvents([]); - }, []), + }, []) ); - const getEventListsAPI = async () => { const res = await mutateAsync({ queryParams: { limit: 15, page }, userId, }); - var dataTemp = [...events, ...res?.data.results]; + var dataTemp = [...events, ...res?.data.results]; setEvents(dataTemp); setTotalPages(res?.data?.totalPages); setCurrentPage(res?.data?.page); - if(events.length !== 0){ + if (events.length !== 0) { onPageLoad(true); } }; const onLoadMoreData = () => { if (totalPages !== currentPages) { - setPage(page + 1); + setPage(page + 1); } }; @@ -125,9 +126,11 @@ export const MyEvents = (props: MyEventsProps) => { }} onEndReachedThreshold={0.8} > - {events.length === 0 ? - {strings.noEventsFound}:<>} - + {events.length === 0 ? ( + {strings.noEventsFound} + ) : ( + <> + )} ); }; diff --git a/src/screens/profile/style.ts b/src/screens/profile/style.ts index db89ede37..2289a5cef 100644 --- a/src/screens/profile/style.ts +++ b/src/screens/profile/style.ts @@ -1,9 +1,8 @@ -import { height, width } from '@theme/device/device'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { ThemeProps } from '@theme/theme'; -import { getTopPadding } from '@utils/platform-padding'; -import { StyleSheet } from 'react-native'; - +import { height, width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { getTopPadding } from "@utils/platform-padding"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -20,9 +19,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(56), borderWidth: theme.borderWidth.borderWidth1, marginTop: verticalScale(100), - alignSelf: 'flex-start', + alignSelf: "flex-start", marginLeft: normalScale(7), - position: 'absolute', + position: "absolute", }, profile: { height: normalScale(112), @@ -30,10 +29,10 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(112), }, center: { - alignSelf: 'center', + alignSelf: "center", marginTop: verticalScale(2), marginLeft: normalScale(50), - alignItems: 'center', + alignItems: "center", }, name: { fontFamily: theme.fontType.medium, @@ -48,72 +47,71 @@ export const createStyleSheet = (theme: ThemeProps) => { borderColor: theme.colors.lightWhite, borderWidth: theme.borderWidth.borderWidth1, borderRadius: theme.borderRadius.radius12, - marginTop:5 + marginTop: 5, }, - userNameClass:{ - - flexDirection:'row', - marginLeft:50, + userNameClass: { + flexDirection: "row", + marginLeft: 50, }, - firstName:{ + firstName: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font18, color: theme.colors.darkBlack, marginBottom: verticalScale(4), width: normalScale(100), - borderColor:theme.colors.lightWhite, - borderRadius:theme.borderRadius.radius12, + borderColor: theme.colors.lightWhite, + borderRadius: theme.borderRadius.radius12, borderWidth: theme.borderWidth.borderWidth1, - padding:5, - marginTop:5, - marginHorizontal:5 - }, -lastName:{ - fontFamily: theme.fontType.medium, - fontSize: theme.fontSize.font18, - color: theme.colors.darkBlack, - marginBottom: verticalScale(4), - width: normalScale(100), - borderColor:theme.colors.lightWhite, - borderRadius:theme.borderRadius.radius12, - borderWidth: theme.borderWidth.borderWidth1, - padding:5, - marginTop:5, - marginHorizontal:5 -}, + padding: 5, + marginTop: 5, + marginHorizontal: 5, + }, + lastName: { + fontFamily: theme.fontType.medium, + fontSize: theme.fontSize.font18, + color: theme.colors.darkBlack, + marginBottom: verticalScale(4), + width: normalScale(100), + borderColor: theme.colors.lightWhite, + borderRadius: theme.borderRadius.radius12, + borderWidth: theme.borderWidth.borderWidth1, + padding: 5, + marginTop: 5, + marginHorizontal: 5, + }, des: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, - width:normalScale(150) + width: normalScale(150), }, payView: { backgroundColor: theme.colors.purpleDark, - alignSelf: 'flex-end', - flexDirection:'row', + alignSelf: "flex-end", + flexDirection: "row", borderRadius: theme.borderRadius.radius6, paddingVertical: verticalScale(2), paddingHorizontal: normalScale(8), marginLeft: normalScale(6), - marginVertical:10 + marginVertical: 10, }, - payoutIcon:{ - height:30, - width:30 + payoutIcon: { + height: 30, + width: 30, }, pay: { fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font12, color: theme.colors.white, - alignSelf:'center', - paddingLeft:10 + alignSelf: "center", + paddingLeft: 10, }, aboutView: { // marginTop: verticalScale(25), marginHorizontal: normalScale(6), }, input: { - backgroundColor: 'transparent', + backgroundColor: "transparent", borderColor: theme.colors.lightWhite, borderWidth: theme.borderWidth.borderWidth1, }, @@ -121,7 +119,7 @@ lastName:{ fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, - marginHorizontal:15 + marginHorizontal: 15, }, about: { fontFamily: theme.fontType.regular, @@ -140,37 +138,37 @@ lastName:{ marginHorizontal: normalScale(12), }, rowOnly: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", }, membership: { marginVertical: verticalScale(8), fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font18, color: theme.colors.darkBlack, - marginRight: 8 + marginRight: 8, }, skillAddImage: { - position: 'absolute', + position: "absolute", right: 6, height: 22, width: 22, marginVertical: verticalScale(16), }, skillCont: { - position: 'relative' + position: "relative", }, flexWrap: { - flexWrap: 'wrap', + flexWrap: "wrap", }, save: { height: normalScale(25), width: normalScale(25), }, buttonView: { - flexDirection: 'row', + flexDirection: "row", marginBottom: 8, - flexWrap: 'wrap', + flexWrap: "wrap", // flex:1 }, buttonViewTwo: { @@ -184,18 +182,17 @@ lastName:{ paddingHorizontal: normalScale(6), }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(12), }, - + modalContainer: { marginTop: verticalScale(20), - }, subPlayerContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.lightGreen, borderWidth: theme.borderWidth.borderWidth1, @@ -203,7 +200,7 @@ lastName:{ subEventContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.red, borderWidth: theme.borderWidth.borderWidth1, @@ -211,7 +208,7 @@ lastName:{ subOrgContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.yellow, borderWidth: theme.borderWidth.borderWidth1, @@ -219,13 +216,13 @@ lastName:{ subProviderContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.lightblue, borderWidth: theme.borderWidth.borderWidth1, }, addCardBorderContainer: { - position: 'absolute', + position: "absolute", left: 0, right: 0, bottom: 0, @@ -241,27 +238,27 @@ lastName:{ // flex: 1, }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13 + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, selectContainer: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginHorizontal: normalScale(24), marginTop: verticalScale(20), }, selectView: { paddingHorizontal: normalScale(8), paddingVertical: verticalScale(8), - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, selectedSelectView: { borderColor: theme.colors.lightPurple, @@ -281,7 +278,6 @@ lastName:{ button: { marginHorizontal: normalScale(44), marginTop: verticalScale(200), - }, noMoreTitle: { fontFamily: theme.fontType.bold, @@ -289,11 +285,11 @@ lastName:{ color: theme.colors.black, // marginTop:verticalScale(6), marginBottom: verticalScale(25), - alignSelf: 'center', + alignSelf: "center", }, loader: { height: verticalScale(450), - backgroundColor: 'transparent', + backgroundColor: "transparent", }, scrollView: { paddingBottom: verticalScale(200), @@ -317,32 +313,32 @@ lastName:{ playerStyle: { marginLeft: 20, marginRight: 20, - flexDirection: 'row', + flexDirection: "row", fontSize: theme.fontSize.font24, fontFamily: theme.fontType.regular, borderWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.white, }, playerbody: { - borderColor: theme.colors.black + borderColor: theme.colors.black, }, playerDescription: { - textAlign: 'center', + textAlign: "center", // alignSelf: 'center', margin: 20, fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, - color: theme.colors.black + color: theme.colors.black, }, postImageStyle: { height: 360, - width: 370 + width: 370, }, signUpStyle: { marginLeft: 80, marginRight: 80, marginTop: 10, - justifyContent: 'center', + justifyContent: "center", borderRadius: theme.borderRadius.radius10, height: 50, fontSize: theme.fontSize.font24, @@ -351,15 +347,15 @@ lastName:{ borderColor: theme.colors.black, }, playerText: { - textDecorationLine: 'underline', - textAlign: 'center', + textDecorationLine: "underline", + textAlign: "center", marginTop: 10, color: theme.colors.black, fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, }, cancleSubStyle: { - textAlign: 'center', + textAlign: "center", marginTop: 20, marginBottom: 20, color: theme.colors.black, @@ -372,19 +368,19 @@ lastName:{ fontSize: theme.fontSize.font14, }, addViewcard: { - flexDirection: 'row', - justifyContent: 'center', + flexDirection: "row", + justifyContent: "center", borderColor: theme.colors.black, borderWidth: theme.borderWidth.borderWidth1, borderRadius: theme.borderRadius.radius10, width: 120, padding: 5, marginLeft: 20, - marginTop: 15 + marginTop: 15, }, addImage: { height: 20, - width: 20 + width: 20, }, addCardContainer: { backgroundColor: theme.colors.lightBlueTwo, @@ -398,13 +394,13 @@ lastName:{ height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), marginLeft: 20, marginRight: 20, - marginTop: 8 + marginTop: 8, }, addCardTitle: { color: theme.colors.black, @@ -418,10 +414,10 @@ lastName:{ fontSize: theme.fontSize.font16, fontFamily: theme.fontType.regular, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginTop: 10, - marginBottom: 10 + marginBottom: 10, }, addCardInput: { color: theme.colors.black, @@ -429,7 +425,7 @@ lastName:{ fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", // margin: 10, marginLeft: 20, marginRight: 20, @@ -439,7 +435,7 @@ lastName:{ // paddingBottom:10, paddingLeft: 45, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardDateInput: { color: theme.colors.black, @@ -447,13 +443,13 @@ lastName:{ fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginRight: 20, marginBottom: 10, marginTop: 10, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardCVCInput: { color: theme.colors.black, @@ -461,34 +457,33 @@ lastName:{ fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginRight: 20, marginBottom: 10, marginTop: 10, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardLogo: { width: 25, height: 15, - position: 'absolute', + position: "absolute", top: 22, left: 30, // right:20, - zIndex: 11111 + zIndex: 11111, }, borderColor: { // borderColor: theme.colors.black, - borderWidth: theme.borderWidth.borderWidth1 + borderWidth: theme.borderWidth.borderWidth1, }, cardView: { - flexDirection: 'row', - justifyContent: 'space-between' + flexDirection: "row", + justifyContent: "space-between", }, subcriptionView: { - display: 'flex', - + display: "flex", }, imageComp: { height: normalScale(30), @@ -509,7 +504,7 @@ lastName:{ // width:'auto' }, packageDetailModal: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, @@ -525,44 +520,44 @@ lastName:{ maxHeight: verticalScale(600), }, packageModalMembership: { - position: 'absolute', + position: "absolute", // top: 210, bottom: 0, left: 0, right: 0, - height:'auto', + height: "auto", // backgroundColor: theme.colors.modalOverlay, borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(600), borderColor: theme.colors.lightPurple, - backgroundColor: 'rgba(255, 255, 255, 0.88)', + backgroundColor: "rgba(255, 255, 255, 0.88)", borderTopWidth: 3, borderLeftWidth: 3, borderRightWidth: 3, // flex: 1, - marginHorizontal: 10 + marginHorizontal: 10, }, imageActionSheet: { - position: 'absolute', + position: "absolute", // top: 310, bottom: 0, left: 0, right: 0, - height: 'auto', + height: "auto", // backgroundColor: theme.colors.modalOverlay, borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(600), borderColor: theme.colors.lightPurple, - backgroundColor: 'rgba(255, 255, 255, 0.88)', + backgroundColor: "rgba(255, 255, 255, 0.88)", borderTopWidth: 3, borderLeftWidth: 3, borderRightWidth: 3, flex: 1, - marginHorizontal: 10 + marginHorizontal: 10, }, gesture: { flex: 1, @@ -589,9 +584,9 @@ lastName:{ borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", backgroundColor: theme.colors.lightGreen, // marginRight: normalScale(8), shadowColor: theme.colors.black, @@ -614,9 +609,9 @@ lastName:{ borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, @@ -635,9 +630,9 @@ lastName:{ borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, @@ -652,15 +647,15 @@ lastName:{ elevation: 5, }, cardList: { - flexDirection: 'row', - marginLeft: 20 + flexDirection: "row", + marginLeft: 20, }, cardNum: { color: theme.colors.black, fontSize: theme.fontSize.font18, fontFamily: theme.fontType.regular, marginRight: 5, - marginBottom: 5 + marginBottom: 5, }, CardexpDate: { color: theme.colors.darkGrey, @@ -672,26 +667,26 @@ lastName:{ color: theme.colors.black, fontSize: theme.fontSize.font22, fontFamily: theme.fontType.regular, - fontWeight: '600', + fontWeight: "600", marginLeft: 20, - marginBottom: 10 + marginBottom: 10, }, dotclass: { color: theme.colors.black, fontSize: theme.fontSize.font18, fontFamily: theme.fontType.regular, marginRight: 5, - textAlign: 'center', + textAlign: "center", }, memberTitle: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font24, color: theme.colors.black, paddingHorizontal: normalScale(16), - alignSelf: 'center', + alignSelf: "center", }, purchesButton: { - marginTop: 50 + marginTop: 50, }, purchaseContainer: { backgroundColor: theme.colors.purple, @@ -705,11 +700,11 @@ lastName:{ height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), - marginHorizontal: 45 + marginHorizontal: 45, }, title: { fontFamily: theme.fontType.medium, @@ -722,15 +717,15 @@ lastName:{ marginLeft: normalScale(10), }, HeaderContainerIOS: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginTop: 60, - height:60 + height: 60, }, HeaderContainerAdroid: { - flexDirection: 'row', - justifyContent: 'space-between', - height:60 + flexDirection: "row", + justifyContent: "space-between", + height: 60, }, downIcon: { height: 24, @@ -739,87 +734,85 @@ lastName:{ saveContainer: { fontSize: 18, fontFamily: theme.fontType.regular, - fontWeight: '500', - color: 'black', - paddingTop:16, - height:60, + fontWeight: "500", + color: "black", + paddingTop: 16, + height: 60, width: 60, - }, MainContainer: { fontSize: 22, fontFamily: theme.fontType.regular, - fontWeight: '600', - color: 'black', - paddingTop:14 + fontWeight: "600", + color: "black", + paddingTop: 14, }, listContainer: { marginTop: 25, - marginBottom:20 + marginBottom: 20, }, questionsLbl: { fontSize: 16, fontFamily: theme.fontType.regular, - fontWeight: '600', + fontWeight: "600", marginLeft: 16, marginRight: 16, marginBottom: 14, - color: 'black', + color: "black", }, answerLbl: { fontSize: 16, fontFamily: theme.fontType.regular, - fontWeight: '400', + fontWeight: "400", marginLeft: 8, marginRight: 12, height: 110, // marginBottom: 10, - color: 'black', - flex: 1 + color: "black", + flex: 1, }, - dropDownView:{ - paddingLeft:16, - paddingTop:18, + dropDownView: { + paddingLeft: 16, + paddingTop: 18, height: 60, width: 60, - }, - memberShipCheckputContainer:{ + memberShipCheckputContainer: { borderRadius: theme.borderRadius.radius20, - paddingVertical: verticalScale(6), - paddingHorizontal: normalScale(6), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - marginRight: normalScale(8), - shadowColor: theme.colors.black, - shadowOpacity: theme.opacity.opacity15, - shadowRadius: theme.borderRadius.radius8, - shadowOffset: { - width: 0, - height: verticalScale(0), - }, - elevation: 5, - alignSelf: 'center', + paddingVertical: verticalScale(6), + paddingHorizontal: normalScale(6), + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + marginRight: normalScale(8), + shadowColor: theme.colors.black, + shadowOpacity: theme.opacity.opacity15, + shadowRadius: theme.borderRadius.radius8, + shadowOffset: { + width: 0, + height: verticalScale(0), + }, + elevation: 5, + alignSelf: "center", }, inputCont: { marginRight: 16, marginLeft: 16, - textAlign: 'left', - color: 'black' + textAlign: "left", + color: "black", }, ProfileUpdateCont: { - alignSelf: 'center', - color: '#91BAD4', + alignSelf: "center", + color: "#91BAD4", fontSize: 16, fontFamily: theme.fontType.regular, - fontWeight: '500', + fontWeight: "500", borderWidth: 1, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), height: 40, - borderColor: '#91BAD4', + borderColor: "#91BAD4", marginTop: 12, marginBottom: 24, }, @@ -827,58 +820,57 @@ lastName:{ answerDisplayCont: { fontSize: 14, fontFamily: theme.fontType.regular, - fontWeight: '400', + fontWeight: "400", marginLeft: 8, marginRight: 12, marginBottom: 12, flex: 1, - color: 'black' + color: "black", }, questionsDisplayLbl: { fontSize: 14, fontFamily: theme.fontType.regular, - fontWeight: '600', + fontWeight: "600", marginLeft: 8, marginRight: 12, marginBottom: 14, - color: 'black' + color: "black", }, closeCardCont: { height: 25, width: 25, - position: 'absolute', + position: "absolute", left: 10, - top: -11 + top: -11, }, - galleryText:{ - textAlign: 'center', + galleryText: { + textAlign: "center", fontSize: 18, - fontFamily: 'NotoSerif-Medium', - backgroundColor: '#A493B7', - color: 'white', + fontFamily: "NotoSerif-Medium", + backgroundColor: "#A493B7", + color: "white", padding: 10, margin: 10, }, - cameraText:{ - textAlign: 'center', + cameraText: { + textAlign: "center", fontSize: 18, - fontFamily: 'NotoSerif-Medium', - backgroundColor: '#A493B7', - color: 'white', + fontFamily: "NotoSerif-Medium", + backgroundColor: "#A493B7", + color: "white", padding: 10, margin: 10, }, - - + imageContainer: { height: 120, - overflow: 'hidden', + overflow: "hidden", borderBottomLeftRadius: theme.borderRadius.radius10, borderBottomRightRadius: theme.borderRadius.radius10, - alignItems: 'center', + alignItems: "center", paddingHorizontal: normalScale(14), - backgroundColor: theme.colors.headerColor + backgroundColor: theme.colors.headerColor, }, // row: { // flexDirection: 'row', @@ -889,30 +881,28 @@ lastName:{ image: { height: verticalScale(33), width: normalScale(242), - alignSelf: 'center', + alignSelf: "center", }, cityClass: { // textAlign: 'center', paddingVertical: 22, paddingHorizontal: 198, - fontWeight: '400', + fontWeight: "400", fontSize: 16, fontFamily: theme.fontType.regular, - color: theme.colors.white + color: theme.colors.white, }, - + // input: { // flex: 1, // height: 40, // justifyContent: "center" // }, - - arrowClass: { height: 25, width: 25, - position: 'absolute', + position: "absolute", top: 35, left: 16, }, @@ -929,15 +919,12 @@ lastName:{ bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, - - - HeaderContainerTwo: { // borderBottomLeftRadius: theme.borderRadius.radius10, // borderBottomRightRadius: theme.borderRadius.radius10, @@ -949,30 +936,30 @@ lastName:{ height: 150, }, row2: { - position: 'absolute', + position: "absolute", top: 60, left: 10, height: normalScale(37), width: normalScale(37), - zIndex:11111222222, - paddingLeft:4, - paddingTop:4 + zIndex: 11111222222, + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, color: theme.colors.white, - zIndex:11111222 + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -980,103 +967,102 @@ lastName:{ marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", bottom: 90, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, fontFamily: theme.fontType.regular, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, }, keyboardView: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, - top:0 + top: 0, }, keyboardViewTwo: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, // top:0 }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, right: 0, backgroundColor: theme.colors.modalOverlay, }, - containerGalleryModal:{ - position: 'absolute', + containerGalleryModal: { + position: "absolute", top: 470, bottom: 0, left: 0, right: 0, backgroundColor: theme.colors.modalOverlay, }, - deleteAccount:{ + deleteAccount: { fontSize: 16, fontFamily: theme.fontType.regular, - color:theme.colors.white, - backgroundColor:theme.colors.darkRed, - textAlign:'center', - padding:10, - paddingTop:16, - fontWeight: '600', - marginHorizontal:10, - marginBottom:8, - borderRadius:12, - height:55 + color: theme.colors.white, + backgroundColor: theme.colors.darkRed, + textAlign: "center", + padding: 10, + paddingTop: 16, + fontWeight: "600", + marginHorizontal: 10, + marginBottom: 8, + borderRadius: 12, + height: 55, }, gratiesImage: { height: 25, width: 25, - marginVertical:12 + marginVertical: 12, }, gratiesNumber: { fontSize: 18, fontFamily: theme.fontType.bold, color: theme.colors.black, - marginVertical:10, - alignSelf:'center', - marginLeft: 6 + marginVertical: 10, + alignSelf: "center", + marginLeft: 6, }, gratiesCont: { - flexDirection: 'row', + flexDirection: "row", paddingLeft: 30, - paddingRight:15, - justifyContent:'space-between', + paddingRight: 15, + justifyContent: "space-between", }, - payoutAndGratisCont:{ - flexDirection: 'row', - } - + payoutAndGratisCont: { + flexDirection: "row", + }, }); }; diff --git a/src/screens/recentProfile/about.tsx b/src/screens/recentProfile/about.tsx index 90280473e..eb811dbd3 100644 --- a/src/screens/recentProfile/about.tsx +++ b/src/screens/recentProfile/about.tsx @@ -1,5 +1,5 @@ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React, {useCallback, useEffect, useRef, useState} from 'react'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React, { useCallback, useEffect, useRef, useState } from "react"; import { Alert, Button, @@ -17,10 +17,10 @@ import { LogBox, KeyboardAvoidingView, Platform, -} from 'react-native'; -import {createStyleSheet} from './style'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {Pill} from '@components/pill'; +} from "react-native"; +import { createStyleSheet } from "./style"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { Pill } from "@components/pill"; import { eventWhite, gratitude, @@ -42,34 +42,34 @@ import { addGreen, onelogo, dummy, -} from '@assets/images'; -import {ModalRefProps} from '@components/modal-component'; -import {ImageComponent} from '@components/image-component'; -import {Input} from '@components/input'; -import {FlatListComponent} from '@components/flatlist-component'; +} from "@assets/images"; +import { ModalRefProps } from "@components/modal-component"; +import { ImageComponent } from "@components/image-component"; +import { Input } from "@components/input"; +import { FlatListComponent } from "@components/flatlist-component"; import { NavigationContainerRef, ParamListBase, useFocusEffect, -} from '@react-navigation/native'; -import {FlatList} from 'react-native-gesture-handler'; -import {usePackagePlans} from '@network/hooks/home-service-hooks/use-package-plans'; -import {Subscription} from '@components/subcription'; -import GestureRecognizer from 'react-native-swipe-gestures'; -import {useToken} from '@app-hooks/use-token'; -import {normalScale, verticalScale} from '@theme/device/normalize'; -import {useSelector} from 'react-redux'; -import {StoreType} from '@network/reducers/store'; -import {UserProfileState} from '@network/reducers/user-profile-reducer'; -import {navigations} from '@config/app-navigation/constant'; -import {Loader} from '@components/loader'; -import {ButtonComponent} from '@components/button-component'; -import Toast from 'react-native-simple-toast'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import {API_URL, persistKeys} from '@network/constant'; -import {height, width} from '@theme/device/device'; -import {useEditProfile} from '@network/hooks/user-service-hooks/use-edit-profile'; -import {ActivityIndicator} from 'react-native'; +} from "@react-navigation/native"; +import { FlatList } from "react-native-gesture-handler"; +import { usePackagePlans } from "@network/hooks/home-service-hooks/use-package-plans"; +import { Subscription } from "@components/subcription"; +import GestureRecognizer from "react-native-swipe-gestures"; +import { useToken } from "@app-hooks/use-token"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { useSelector } from "react-redux"; +import { StoreType } from "@network/reducers/store"; +import { UserProfileState } from "@network/reducers/user-profile-reducer"; +import { navigations } from "@config/app-navigation/constant"; +import { Loader } from "@components/loader"; +import { ButtonComponent } from "@components/button-component"; +import Toast from "react-native-simple-toast"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { API_URL, persistKeys } from "@network/constant"; +import { height, width } from "@theme/device/device"; +import { useEditProfile } from "@network/hooks/user-service-hooks/use-edit-profile"; +import { ActivityIndicator } from "react-native"; interface RecentaboutDataProps { ref: React.Ref | undefined; @@ -77,7 +77,7 @@ interface RecentaboutDataProps { skills: string[]; profileAnswers: any[]; idUser: string; - onEditProfile?: (data: {about?: string; skills?: string[]}) => void; + onEditProfile?: (data: { about?: string; skills?: string[] }) => void; navigation: NavigationContainerRef; route?: { params: { @@ -87,26 +87,26 @@ interface RecentaboutDataProps { } export const Recentabout = (props: RecentaboutDataProps) => { - const {theme} = useAppTheme(); - const {strings} = useStringsAndLabels(); + const { theme } = useAppTheme(); + const { strings } = useStringsAndLabels(); const styles = createStyleSheet(theme); - const {about, skills, profileAnswers, idUser, route, navigation} = + const { about, skills, profileAnswers, idUser, route, navigation } = props || {}; const [updatedAbout, setAbout] = useState(about); const [allSkills, setSkills] = useState(skills); - const [skillValue, setSkillValue]: any = useState(''); + const [skillValue, setSkillValue]: any = useState(""); const [isLoading, LodingData] = useState(false); - const [profileUri, setProfileUri] = useState(''); - const [updatedBio, setBio] = useState(''); + const [profileUri, setProfileUri] = useState(""); + const [updatedBio, setBio] = useState(""); const [recentUser, recentUserDetail]: any = useState([]); - const {token} = useToken(); - const {id} = route?.params ?? {}; + const { token } = useToken(); + const { id } = route?.params ?? {}; const [openQues, quesAnsModal] = useState(false); var [ansQueData, submitAnsState] = useState(profileAnswers); var [ansQueDataTwo, submitAnsStateTwo] = useState(profileAnswers); const {} = props || {}; useEffect(() => { - LodingData(true) + LodingData(true); userRecentProfileUpdate(); setAbout(about); setSkills(skills); @@ -114,29 +114,28 @@ export const Recentabout = (props: RecentaboutDataProps) => { // =================Update Answer API==================== - async function userRecentProfileUpdate() { - const token = await AsyncStorage.getItem('token'); - const userID = await AsyncStorage.getItem('recentUserId'); + const token = await AsyncStorage.getItem("token"); + const userID = await AsyncStorage.getItem("recentUserId"); try { const response = await fetch( - API_URL + '/v1/users/userprofile/'+userID, + API_URL + "/v1/users/userprofile/" + userID, { - method: 'get', + method: "get", headers: new Headers({ - Authorization: 'Bearer ' + token, - 'Content-Type': 'application/json', + Authorization: "Bearer " + token, + "Content-Type": "application/json", }), - }, + } ); const dataItem = await response.json(); submitAnsState(dataItem?.data?.profile_answers); recentUserDetail(dataItem?.data); setAbout(dataItem?.about); setSkills(dataItem?.skills); - LodingData(false) + LodingData(false); } catch (error) { - LodingData(false) + LodingData(false); console.error(error); } } @@ -145,27 +144,21 @@ export const Recentabout = (props: RecentaboutDataProps) => { quesAnsModal(false); }; - - const handleRemove = (id: any) => { - const newPeople = allSkills.filter(person => person !== id); + const newPeople = allSkills.filter((person) => person !== id); setSkills(newPeople); }; const onAddSkill = (text: any) => { - if (text !== '' && text !== undefined) { + if (text !== "" && text !== undefined) { setSkills([...allSkills, text]); - setSkillValue(''); + setSkillValue(""); } }; - const renderItem: ListRenderItem = ({item}) => ( - + const renderItem: ListRenderItem = ({ item }) => ( + ); useEffect(() => { @@ -174,20 +167,20 @@ export const Recentabout = (props: RecentaboutDataProps) => { function handleToggleYourList(name: any, jindex: any) { let newArr = ansQueDataTwo.map((item, index) => { - const target: Partial = {...item}; - delete target['question']; + const target: Partial = { ...item }; + delete target["question"]; if (index == jindex) { - return {...target, answer: name}; + return { ...target, answer: name }; } else { return target; } }); let newArrs = ansQueDataTwo.map((item, index) => { - const target: Partial = {...item}; + const target: Partial = { ...item }; if (index == jindex) { - return {...target, answer: name}; + return { ...target, answer: name }; } else { return target; } @@ -212,14 +205,15 @@ export const Recentabout = (props: RecentaboutDataProps) => { - - - NE - L o c a l - + + + NE + L o c a l + @@ -249,13 +243,13 @@ export const Recentabout = (props: RecentaboutDataProps) => { About - {recentUser?.about} + {recentUser?.about} {strings.skills} item.toString()} + keyExtractor={(item) => item.toString()} renderItem={renderItem} numColumns={100} showsHorizontalScrollIndicator={false} @@ -269,13 +263,13 @@ export const Recentabout = (props: RecentaboutDataProps) => { - Question & Answer List + Question & Answer List - + ( + renderItem={({ item }) => ( {item.length != 0 ? ( @@ -290,7 +284,8 @@ export const Recentabout = (props: RecentaboutDataProps) => { )} - )}> + )} + > diff --git a/src/screens/recentProfile/index.tsx b/src/screens/recentProfile/index.tsx index 37c1345d9..1b03f58a9 100644 --- a/src/screens/recentProfile/index.tsx +++ b/src/screens/recentProfile/index.tsx @@ -1,10 +1,13 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import {NavigationContainerRef, ParamListBase} from '@react-navigation/native'; -import React, {useEffect, useState} from 'react'; -import {createStyleSheet} from './style'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {Header} from '@components/header'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import React, { useEffect, useState } from "react"; +import { createStyleSheet } from "./style"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { Header } from "@components/header"; import { ImageBackground, Keyboard, @@ -17,43 +20,43 @@ import { Text, TouchableOpacity, View, -} from 'react-native'; -import {ImageComponent} from '@components/image-component'; -import {TabComponent} from '@components/tab-component'; -import {Recentabout} from './about'; -import {RecentMyEvents} from './my-events'; -import {useDispatch, useSelector} from 'react-redux'; +} from "react-native"; +import { ImageComponent } from "@components/image-component"; +import { TabComponent } from "@components/tab-component"; +import { Recentabout } from "./about"; +import { RecentMyEvents } from "./my-events"; +import { useDispatch, useSelector } from "react-redux"; import { UserProfileState, onSetCoverImage, -} from '@network/reducers/user-profile-reducer'; -import {StoreType} from '@network/reducers/store'; -import {useLogout} from '@app-hooks/use-logout'; -import {Loader} from '@components/loader'; -import {launchCamera, launchImageLibrary} from 'react-native-image-picker'; -import {Input} from '@components/input'; -import {useEditProfile} from '@network/hooks/user-service-hooks/use-edit-profile'; -import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'; -import {Search, arrowLeft, bell, dummy, onelogo} from '@assets/images'; -import {PERMISSIONS, request} from 'react-native-permissions'; -import {Alert} from 'react-native'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import {useToken} from '@app-hooks/use-token'; -import {TextInput} from 'react-native-gesture-handler'; -import {verticalScale} from '@theme/device/normalize'; -import {getTopPadding} from '@utils/platform-padding'; -import {Image} from 'react-native'; -import {height} from '@theme/device/device'; -import {BottomSheet} from 'react-native-elements'; -import GestureRecognizer from 'react-native-swipe-gestures'; -import ImagePicker from 'react-native-image-crop-picker'; -import { API_URL } from '@network/constant'; +} from "@network/reducers/user-profile-reducer"; +import { StoreType } from "@network/reducers/store"; +import { useLogout } from "@app-hooks/use-logout"; +import { Loader } from "@components/loader"; +import { launchCamera, launchImageLibrary } from "react-native-image-picker"; +import { Input } from "@components/input"; +import { useEditProfile } from "@network/hooks/user-service-hooks/use-edit-profile"; +import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; +import { Search, arrowLeft, bell, dummy, onelogo } from "@assets/images"; +import { PERMISSIONS, request } from "react-native-permissions"; +import { Alert } from "react-native"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { useToken } from "@app-hooks/use-token"; +import { TextInput } from "react-native-gesture-handler"; +import { verticalScale } from "@theme/device/normalize"; +import { getTopPadding } from "@utils/platform-padding"; +import { Image } from "react-native"; +import { height } from "@theme/device/device"; +import { BottomSheet } from "react-native-elements"; +import GestureRecognizer from "react-native-swipe-gestures"; +import ImagePicker from "react-native-image-crop-picker"; +import { API_URL } from "@network/constant"; interface UserData { id: string; bio: string; name: string; - pic: string; + pic: string; status: string; about: string; skills: string[]; @@ -68,23 +71,23 @@ interface RecentProfileScreenProps { } export const RecentProfileScreen = (props: RecentProfileScreenProps) => { - const {theme} = useAppTheme(); - const {strings} = useStringsAndLabels(); + const { theme } = useAppTheme(); + const { strings } = useStringsAndLabels(); const styles = createStyleSheet(theme); - const {navigation} = props || {}; + const { navigation } = props || {}; const [selectedTab, setSelectedTab] = useState(0); - const [profileUri, setProfileUri] = useState(''); - const [updatedBio, setBio] = useState(''); + const [profileUri, setProfileUri] = useState(""); + const [updatedBio, setBio] = useState(""); const [isLoading, LodingData] = useState(false); var [recentUser, submitAnsState] = useState(); var [ansQueDataTwo, submitAnsStateTwo] = useState(); - const {user} = useSelector( - state => state.userProfileReducer, - ) as {user: UserData}; - const {about, bio, name, pic, skills, status, id, profile_answers} = + const { user } = useSelector( + (state) => state.userProfileReducer + ) as { user: UserData }; + const { about, bio, name, pic, skills, status, id, profile_answers } = user || {}; const dispatch = useDispatch(); - const {token} = useToken(); + const { token } = useToken(); useEffect(() => { setBio(bio); setProfileUri(pic); @@ -93,7 +96,7 @@ export const RecentProfileScreen = (props: RecentProfileScreenProps) => { useEffect(() => { userProfileUpdate(); return () => { - dispatch(onSetCoverImage('')); + dispatch(onSetCoverImage("")); }; }, []); @@ -101,32 +104,31 @@ export const RecentProfileScreen = (props: RecentProfileScreenProps) => { navigation.goBack(); }; - async function userProfileUpdate() { try { - const response = await fetch(API_URL + '/v1/users/userprofile/5f61a3b16f61450a2bb888e8', { - method: 'get', - headers: new Headers({ - 'Authorization': 'Bearer ' + token, - 'Content-Type': 'application/x-www-form-urlencoded' - }) - }); + const response = await fetch( + API_URL + "/v1/users/userprofile/5f61a3b16f61450a2bb888e8", + { + method: "get", + headers: new Headers({ + Authorization: "Bearer " + token, + "Content-Type": "application/x-www-form-urlencoded", + }), + } + ); const dataItem = await response.json(); - submitAnsState(dataItem?.data) + submitAnsState(dataItem?.data); - const {success, data} = dataItem || {}; + const { success, data } = dataItem || {}; if (success) { - const { - about, bio, name, pic, skills, status, id, profile_answers - } = data || {}; - + const { about, bio, name, pic, skills, status, id, profile_answers } = + data || {}; } } catch (error) { console.error(error); } } - return ( @@ -141,7 +143,9 @@ export const RecentProfileScreen = (props: RecentProfileScreenProps) => { ref={undefined} /> )} - {selectedTab === 1 && } + {selectedTab === 1 && ( + + )} ); diff --git a/src/screens/recentProfile/my-events.tsx b/src/screens/recentProfile/my-events.tsx index 707f05f9e..ed64ef7cf 100644 --- a/src/screens/recentProfile/my-events.tsx +++ b/src/screens/recentProfile/my-events.tsx @@ -1,18 +1,21 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import {useAppTheme} from '@app-hooks/use-app-theme'; -import React, {useEffect, useState} from 'react'; -import {createStyleSheet} from './style'; -import {ListRenderItem, ScrollView, View} from 'react-native'; -import {EventList} from '@components/event-list'; +import { useAppTheme } from "@app-hooks/use-app-theme"; +import React, { useEffect, useState } from "react"; +import { createStyleSheet } from "./style"; +import { ListRenderItem, ScrollView, View } from "react-native"; +import { EventList } from "@components/event-list"; import { Result, useEventLists, -} from '@network/hooks/home-service-hooks/use-event-lists'; -import {FlatListComponent} from '@components/flatlist-component'; -import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels'; -import {Loader} from '@components/loader'; -import { NavigationContainerRef, ParamListBase } from '@react-navigation/native'; -import { navigations } from '@config/app-navigation/constant'; +} from "@network/hooks/home-service-hooks/use-event-lists"; +import { FlatListComponent } from "@components/flatlist-component"; +import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels"; +import { Loader } from "@components/loader"; +import { + NavigationContainerRef, + ParamListBase, +} from "@react-navigation/native"; +import { navigations } from "@config/app-navigation/constant"; interface RecentMyEventsProps { userId: string; @@ -20,13 +23,13 @@ interface RecentMyEventsProps { } export const RecentMyEvents = (props: RecentMyEventsProps) => { - const {theme} = useAppTheme(); + const { theme } = useAppTheme(); const styles = createStyleSheet(theme); - const {strings} = useStringsAndLabels(); - const {userId,navigation} = props || {}; + const { strings } = useStringsAndLabels(); + const { userId, navigation } = props || {}; const [events, setEvents] = useState([]); const [totalPages, setTotalPages] = useState(0); - const {mutateAsync, isLoading} = useEventLists(); + const { mutateAsync, isLoading } = useEventLists(); const [page, setPage] = useState(1); useEffect(() => { @@ -35,11 +38,11 @@ export const RecentMyEvents = (props: RecentMyEventsProps) => { const getEventLists = async () => { const res = await mutateAsync({ - queryParams: {limit: 10, page}, + queryParams: { limit: 10, page }, userId, }); - setEvents(prevData => [...prevData, ...(res?.data?.results || [])]); + setEvents((prevData) => [...prevData, ...(res?.data?.results || [])]); setTotalPages(res?.data?.totalPages); }; @@ -47,11 +50,12 @@ export const RecentMyEvents = (props: RecentMyEventsProps) => { setPage(page + 1); }; - const renderItem: ListRenderItem = ({item}) => { - const {name} = item || {}; + const renderItem: ListRenderItem = ({ item }) => { + const { name } = item || {}; - return onNavigate(item)} data={item} />; - + return ( + onNavigate(item)} data={item} /> + ); }; const onNavigate = (item: Result) => { @@ -74,7 +78,7 @@ export const RecentMyEvents = (props: RecentMyEventsProps) => { renderItem={renderItem} data={events} onLoadMoreData={onLoadMoreData} - emptyComponentData={{title: strings.noEventsFound}} + emptyComponentData={{ title: strings.noEventsFound }} totalPages={totalPages} currentPage={page} dataLength={events.length} diff --git a/src/screens/recentProfile/style.ts b/src/screens/recentProfile/style.ts index dcd5319db..eb6843da8 100644 --- a/src/screens/recentProfile/style.ts +++ b/src/screens/recentProfile/style.ts @@ -1,9 +1,8 @@ -import { height, width } from '@theme/device/device'; -import { normalScale, verticalScale } from '@theme/device/normalize'; -import { ThemeProps } from '@theme/theme'; -import { getTopPadding } from '@utils/platform-padding'; -import { StyleSheet } from 'react-native'; - +import { height, width } from "@theme/device/device"; +import { normalScale, verticalScale } from "@theme/device/normalize"; +import { ThemeProps } from "@theme/theme"; +import { getTopPadding } from "@utils/platform-padding"; +import { StyleSheet } from "react-native"; export const createStyleSheet = (theme: ThemeProps) => { return StyleSheet.create({ @@ -20,20 +19,20 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: normalScale(56), borderWidth: theme.borderWidth.borderWidth1, marginTop: verticalScale(100), - alignSelf: 'flex-start', + alignSelf: "flex-start", marginLeft: normalScale(7), - position: 'absolute', + position: "absolute", }, profile: { height: normalScale(112), width: normalScale(112), borderRadius: normalScale(112), }, - center: { - alignSelf: 'center', + center: { + alignSelf: "center", marginTop: verticalScale(2), marginLeft: normalScale(50), - alignItems: 'center', + alignItems: "center", }, name: { fontFamily: theme.fontType.medium, @@ -56,7 +55,7 @@ export const createStyleSheet = (theme: ThemeProps) => { }, payView: { backgroundColor: theme.colors.lightPurple, - alignSelf: 'flex-start', + alignSelf: "flex-start", borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), @@ -73,14 +72,14 @@ export const createStyleSheet = (theme: ThemeProps) => { marginHorizontal: normalScale(6), }, input: { - backgroundColor: 'transparent', + backgroundColor: "transparent", // borderColor: theme.colors.lightWhite, // borderWidth: theme.borderWidth.borderWidth1, fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font14, color: theme.colors.black, - padding:15, - borderRadius:10 + padding: 15, + borderRadius: 10, }, about: { fontFamily: theme.fontType.regular, @@ -99,37 +98,37 @@ export const createStyleSheet = (theme: ThemeProps) => { marginHorizontal: normalScale(12), }, rowOnly: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", }, membership: { marginVertical: verticalScale(8), fontFamily: theme.fontType.medium, fontSize: theme.fontSize.font18, color: theme.colors.darkBlack, - marginRight: 8 + marginRight: 8, }, skillAddImage: { - position: 'absolute', + position: "absolute", right: 6, height: 22, width: 22, marginVertical: verticalScale(16), }, skillCont: { - position: 'relative' + position: "relative", }, flexWrap: { - flexWrap: 'wrap', + flexWrap: "wrap", }, save: { height: normalScale(25), width: normalScale(25), }, buttonView: { - flexDirection: 'row', + flexDirection: "row", marginBottom: 8, - flexWrap: 'wrap', + flexWrap: "wrap", // flex:1 }, buttonViewTwo: { @@ -143,18 +142,17 @@ export const createStyleSheet = (theme: ThemeProps) => { paddingHorizontal: normalScale(6), }, row: { - flexDirection: 'row', + flexDirection: "row", marginTop: verticalScale(12), }, - + modalContainer: { marginTop: verticalScale(20), - }, subPlayerContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.lightGreen, borderWidth: theme.borderWidth.borderWidth1, @@ -162,7 +160,7 @@ export const createStyleSheet = (theme: ThemeProps) => { subEventContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.red, borderWidth: theme.borderWidth.borderWidth1, @@ -170,7 +168,7 @@ export const createStyleSheet = (theme: ThemeProps) => { subOrgContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.yellow, borderWidth: theme.borderWidth.borderWidth1, @@ -178,13 +176,13 @@ export const createStyleSheet = (theme: ThemeProps) => { subProviderContainer: { marginLeft: verticalScale(7), marginRight: verticalScale(7), - backgroundColor: 'white', + backgroundColor: "white", opacity: 0.8, borderColor: theme.colors.lightblue, borderWidth: theme.borderWidth.borderWidth1, }, addCardBorderContainer: { - position: 'absolute', + position: "absolute", left: 0, right: 0, bottom: 0, @@ -201,19 +199,19 @@ export const createStyleSheet = (theme: ThemeProps) => { // flex: 1, }, pillStyle: { - alignSelf: 'center', + alignSelf: "center", }, selectContainer: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginHorizontal: normalScale(24), marginTop: verticalScale(20), }, selectView: { paddingHorizontal: normalScale(8), paddingVertical: verticalScale(8), - alignItems: 'center', - justifyContent: 'center', + alignItems: "center", + justifyContent: "center", }, selectedSelectView: { borderColor: theme.colors.lightPurple, @@ -233,14 +231,13 @@ export const createStyleSheet = (theme: ThemeProps) => { button: { marginHorizontal: normalScale(44), marginTop: verticalScale(200), - }, eventContainer: { paddingHorizontal: normalScale(22), }, loader: { height: verticalScale(450), - backgroundColor: 'transparent', + backgroundColor: "transparent", }, scrollView: { paddingBottom: verticalScale(200), @@ -260,32 +257,32 @@ export const createStyleSheet = (theme: ThemeProps) => { playerStyle: { marginLeft: 20, marginRight: 20, - flexDirection: 'row', + flexDirection: "row", fontSize: theme.fontSize.font24, fontFamily: theme.fontType.regular, borderWidth: theme.borderWidth.borderWidth1, borderColor: theme.colors.white, }, playerbody: { - borderColor: theme.colors.black + borderColor: theme.colors.black, }, playerDescription: { - textAlign: 'center', + textAlign: "center", // alignSelf: 'center', margin: 20, fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, - color: theme.colors.black + color: theme.colors.black, }, postImageStyle: { height: 360, - width: 370 + width: 370, }, signUpStyle: { marginLeft: 80, marginRight: 80, marginTop: 10, - justifyContent: 'center', + justifyContent: "center", borderRadius: theme.borderRadius.radius10, height: 50, fontSize: theme.fontSize.font24, @@ -294,15 +291,15 @@ export const createStyleSheet = (theme: ThemeProps) => { borderColor: theme.colors.black, }, playerText: { - textDecorationLine: 'underline', - textAlign: 'center', + textDecorationLine: "underline", + textAlign: "center", marginTop: 10, color: theme.colors.black, fontSize: theme.fontSize.font14, fontFamily: theme.fontType.regular, }, cancleSubStyle: { - textAlign: 'center', + textAlign: "center", marginTop: 20, marginBottom: 20, color: theme.colors.black, @@ -315,19 +312,19 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font14, }, addViewcard: { - flexDirection: 'row', - justifyContent: 'center', + flexDirection: "row", + justifyContent: "center", borderColor: theme.colors.black, borderWidth: theme.borderWidth.borderWidth1, borderRadius: theme.borderRadius.radius10, width: 120, padding: 5, marginLeft: 20, - marginTop: 15 + marginTop: 15, }, addImage: { height: 20, - width: 20 + width: 20, }, addCardContainer: { backgroundColor: theme.colors.lightBlueTwo, @@ -341,13 +338,13 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), marginLeft: 20, marginRight: 20, - marginTop: 8 + marginTop: 8, }, addCardTitle: { color: theme.colors.black, @@ -361,10 +358,10 @@ export const createStyleSheet = (theme: ThemeProps) => { fontSize: theme.fontSize.font16, fontFamily: theme.fontType.regular, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginTop: 10, - marginBottom: 10 + marginBottom: 10, }, addCardInput: { color: theme.colors.black, @@ -372,7 +369,7 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", // margin: 10, marginLeft: 20, marginRight: 20, @@ -382,7 +379,7 @@ export const createStyleSheet = (theme: ThemeProps) => { // paddingBottom:10, paddingLeft: 45, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardDateInput: { color: theme.colors.black, @@ -390,13 +387,13 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginRight: 20, marginBottom: 10, marginTop: 10, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardCVCInput: { color: theme.colors.black, @@ -404,34 +401,33 @@ export const createStyleSheet = (theme: ThemeProps) => { fontFamily: theme.fontType.regular, backgroundColor: theme.colors.lightgrayTwo, fontWeight: "400", - textAlign: 'left', + textAlign: "left", marginLeft: 20, marginRight: 20, marginBottom: 10, marginTop: 10, padding: 10, - borderRadius: theme.borderRadius.radius10 + borderRadius: theme.borderRadius.radius10, }, addCardLogo: { width: 25, height: 15, - position: 'absolute', + position: "absolute", top: 22, left: 30, // right:20, - zIndex: 11111 + zIndex: 11111, }, borderColor: { // borderColor: theme.colors.black, - borderWidth: theme.borderWidth.borderWidth1 + borderWidth: theme.borderWidth.borderWidth1, }, cardView: { - flexDirection: 'row', - justifyContent: 'space-between' + flexDirection: "row", + justifyContent: "space-between", }, subcriptionView: { - display: 'flex', - + display: "flex", }, imageComp: { height: normalScale(30), @@ -452,7 +448,7 @@ export const createStyleSheet = (theme: ThemeProps) => { // width:'auto' }, packageDetailModal: { - position: 'absolute', + position: "absolute", top: 470, bottom: 0, left: 0, @@ -461,7 +457,7 @@ export const createStyleSheet = (theme: ThemeProps) => { borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), borderColor: theme.colors.lightGreen, - backgroundColor: 'rgba(255, 255, 255, 0.4)', + backgroundColor: "rgba(255, 255, 255, 0.4)", borderTopWidth: 4, borderLeftWidth: 4, borderRightWidth: 4, @@ -469,44 +465,44 @@ export const createStyleSheet = (theme: ThemeProps) => { // flex: 1 }, packageModalMembership: { - position: 'absolute', + position: "absolute", // top: 210, bottom: 0, left: 0, right: 0, - height:'auto', + height: "auto", // backgroundColor: theme.colors.modalOverlay, borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(600), borderColor: theme.colors.lightPurple, - backgroundColor: 'rgba(255, 255, 255, 0.88)', + backgroundColor: "rgba(255, 255, 255, 0.88)", borderTopWidth: 3, borderLeftWidth: 3, borderRightWidth: 3, // flex: 1, - marginHorizontal: 10 + marginHorizontal: 10, }, imageActionSheet: { - position: 'absolute', + position: "absolute", // top: 310, bottom: 0, left: 0, right: 0, - height: 'auto', + height: "auto", // backgroundColor: theme.colors.modalOverlay, borderTopRightRadius: theme.borderRadius.radius16, borderTopLeftRadius: theme.borderRadius.radius16, paddingVertical: verticalScale(20), maxHeight: verticalScale(600), borderColor: theme.colors.lightPurple, - backgroundColor: 'rgba(255, 255, 255, 0.88)', + backgroundColor: "rgba(255, 255, 255, 0.88)", borderTopWidth: 3, borderLeftWidth: 3, borderRightWidth: 3, flex: 1, - marginHorizontal: 10 + marginHorizontal: 10, }, gesture: { flex: 1, @@ -533,9 +529,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', + flexDirection: "row", + justifyContent: "center", + alignItems: "center", backgroundColor: theme.colors.lightGreen, // marginRight: normalScale(8), shadowColor: theme.colors.black, @@ -558,9 +554,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, @@ -579,9 +575,9 @@ export const createStyleSheet = (theme: ThemeProps) => { borderRadius: theme.borderRadius.radius20, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", marginRight: normalScale(8), shadowColor: theme.colors.black, shadowOpacity: theme.opacity.opacity15, @@ -596,15 +592,15 @@ export const createStyleSheet = (theme: ThemeProps) => { elevation: 5, }, cardList: { - flexDirection: 'row', - marginLeft: 20 + flexDirection: "row", + marginLeft: 20, }, cardNum: { color: theme.colors.black, fontSize: theme.fontSize.font18, fontFamily: theme.fontType.regular, marginRight: 5, - marginBottom: 5 + marginBottom: 5, }, CardexpDate: { color: theme.colors.darkGrey, @@ -616,26 +612,26 @@ export const createStyleSheet = (theme: ThemeProps) => { color: theme.colors.black, fontSize: theme.fontSize.font22, fontFamily: theme.fontType.regular, - fontWeight: '600', + fontWeight: "600", marginLeft: 20, - marginBottom: 10 + marginBottom: 10, }, dotclass: { color: theme.colors.black, fontSize: theme.fontSize.font18, fontFamily: theme.fontType.regular, marginRight: 5, - textAlign: 'center', + textAlign: "center", }, memberTitle: { fontFamily: theme.fontType.regular, fontSize: theme.fontSize.font24, color: theme.colors.black, paddingHorizontal: normalScale(16), - alignSelf: 'center', + alignSelf: "center", }, purchesButton: { - marginTop: 50 + marginTop: 50, }, purchaseContainer: { backgroundColor: theme.colors.purple, @@ -649,11 +645,11 @@ export const createStyleSheet = (theme: ThemeProps) => { height: verticalScale(0), }, elevation: 5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', + justifyContent: "space-between", + flexDirection: "row", + alignItems: "center", paddingHorizontal: normalScale(16), - marginHorizontal: 45 + marginHorizontal: 45, }, title: { fontFamily: theme.fontType.medium, @@ -666,10 +662,10 @@ export const createStyleSheet = (theme: ThemeProps) => { marginLeft: normalScale(10), }, HeaderContainer: { - flexDirection: 'row', - justifyContent: 'space-between', + flexDirection: "row", + justifyContent: "space-between", marginTop: 40, - marginHorizontal: 14 + marginHorizontal: 14, }, downIcon: { marginTop: 4, @@ -679,15 +675,14 @@ export const createStyleSheet = (theme: ThemeProps) => { saveContainer: { fontSize: 18, fontFamily: theme.fontType.regular, - fontWeight: '500', - color: 'black' - + fontWeight: "500", + color: "black", }, MainContainer: { fontSize: 22, fontFamily: theme.fontType.regular, - fontWeight: '600', - color: 'black' + fontWeight: "600", + color: "black", }, listContainer: { marginTop: 25, @@ -695,81 +690,80 @@ export const createStyleSheet = (theme: ThemeProps) => { questionsLbl: { fontSize: 16, fontFamily: theme.fontType.regular, - fontWeight: '600', + fontWeight: "600", marginLeft: 8, marginRight: 12, marginBottom: 14, - color: 'black', + color: "black", }, answerLbl: { fontSize: 16, fontFamily: theme.fontType.regular, - fontWeight: '400', + fontWeight: "400", marginLeft: 8, marginRight: 12, height: 110, // marginBottom: 10, - color: 'black', - flex: 1 + color: "black", + flex: 1, }, inputCont: { marginRight: 12, marginLeft: 8, - textAlign: 'left', - color: 'black' + textAlign: "left", + color: "black", }, ProfileUpdateCont: { - textAlign: 'center', - color: '#91BAD4', + textAlign: "center", + color: "#91BAD4", fontSize: 16, fontFamily: theme.fontType.regular, - fontWeight: '500', + fontWeight: "500", borderWidth: 1, paddingVertical: verticalScale(8), paddingHorizontal: normalScale(8), height: 40, - borderColor: '#91BAD4', + borderColor: "#91BAD4", marginHorizontal: 60, marginTop: 12, - marginBottom: 24 + marginBottom: 24, }, answerDisplayCont: { fontSize: 14, fontFamily: theme.fontType.regular, - fontWeight: '400', + fontWeight: "400", marginLeft: 8, marginRight: 12, marginBottom: 12, flex: 1, - color: 'black' + color: "black", }, questionsDisplayLbl: { fontSize: 14, fontFamily: theme.fontType.regular, - fontWeight: '600', + fontWeight: "600", marginLeft: 8, marginRight: 12, marginBottom: 14, - color: 'black' + color: "black", }, closeCardCont: { height: 25, width: 25, - position: 'absolute', + position: "absolute", left: 10, - top: -11 + top: -11, }, - - + imageContainer: { height: 120, - overflow: 'hidden', + overflow: "hidden", borderBottomLeftRadius: theme.borderRadius.radius10, borderBottomRightRadius: theme.borderRadius.radius10, - alignItems: 'center', + alignItems: "center", paddingHorizontal: normalScale(14), - backgroundColor: theme.colors.headerColor + backgroundColor: theme.colors.headerColor, }, // row: { // flexDirection: 'row', @@ -780,30 +774,28 @@ export const createStyleSheet = (theme: ThemeProps) => { image: { height: verticalScale(33), width: normalScale(242), - alignSelf: 'center', + alignSelf: "center", }, cityClass: { // textAlign: 'center', paddingVertical: 22, paddingHorizontal: 198, - fontWeight: '400', + fontWeight: "400", fontSize: 16, fontFamily: theme.fontType.regular, - color: theme.colors.white + color: theme.colors.white, }, - + // input: { // flex: 1, // height: 40, // justifyContent: "center" // }, - - arrowClass: { height: 25, width: 25, - position: 'absolute', + position: "absolute", top: 35, left: 16, }, @@ -820,24 +812,20 @@ export const createStyleSheet = (theme: ThemeProps) => { bellIcon: { height: 22, width: 22, - position: 'absolute', + position: "absolute", right: 0, zIndex: 11111122, - borderRadius: 100 + borderRadius: 100, }, localText: { - textAlign: 'center', + textAlign: "center", fontSize: 14, - fontWeight: '400', - color: 'white', - position:'relative', - bottom:13, - + fontWeight: "400", + color: "white", + position: "relative", + bottom: 13, }, - - - HeaderContainerTwo: { // borderBottomLeftRadius: theme.borderRadius.radius10, // borderBottomRightRadius: theme.borderRadius.radius10, @@ -846,30 +834,30 @@ export const createStyleSheet = (theme: ThemeProps) => { // position: 'relative', }, row2: { - position: 'absolute', + position: "absolute", top: 60, left: 10, height: normalScale(37), width: normalScale(37), - zIndex:11111222222, - paddingLeft:4, - paddingTop:4 + zIndex: 11111222222, + paddingLeft: 4, + paddingTop: 4, }, arrowLeft: { height: normalScale(22), width: normalScale(22), }, searchContainer: { - backgroundColor: 'rgba(255, 255, 255, 0.1)', + backgroundColor: "rgba(255, 255, 255, 0.1)", height: 35, width: 100, borderRadius: 10, - flexDirection: 'row', + flexDirection: "row", marginLeft: 8, - position: 'absolute', + position: "absolute", bottom: 20, color: theme.colors.white, - zIndex:11111222 + zIndex: 11111222, }, searchInput: { flexShrink: 1, @@ -877,58 +865,57 @@ export const createStyleSheet = (theme: ThemeProps) => { marginRight: 5, height: 35, width: 120, - color: theme.colors.white + color: theme.colors.white, }, searchIcon: { height: 15, width: 15, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainer: { - flexDirection: 'row', - justifyContent: 'center', - position: 'relative', + flexDirection: "row", + justifyContent: "center", + position: "relative", top: 50, }, oneContainerImage: { height: 60, width: 60, marginTop: 10, - marginLeft: 5 + marginLeft: 5, }, oneContainerText: { - textAlign: 'center', + textAlign: "center", fontSize: 60, fontFamily: theme.fontType.regular, - fontWeight: '400', + fontWeight: "400", color: theme.colors.white, marginLeft: 2, }, keyboardView: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, - top:0 + top: 0, }, keyboardViewTwo: { - position: 'absolute', + position: "absolute", bottom: 0, left: 0, right: 0, // top:0 }, - containerGallery:{ - position: 'absolute', + containerGallery: { + position: "absolute", top: 0, bottom: 0, left: 0, right: 0, backgroundColor: theme.colors.modalOverlay, - } - + }, }); }; diff --git a/src/screens/signUp/index.tsx b/src/screens/signUp/index.tsx index 7fd39870d..c6622312f 100644 --- a/src/screens/signUp/index.tsx +++ b/src/screens/signUp/index.tsx @@ -196,7 +196,6 @@ export const SignUp = (props: SignUpProps) => { } const onSignUp = () => { - if (user.firstName.length === 0) { Toast.show("Enter your First Name", Toast.LONG, { backgroundColor: "black", @@ -223,7 +222,6 @@ export const SignUp = (props: SignUpProps) => { includeBase64: true, cropping: true, }).then((image) => { - if (image) { var fileNameTwo = image?.filename ?? ""; LodingData(true); diff --git a/src/theme/colors.ts b/src/theme/colors.ts index 9d0c56906..493639b9d 100644 --- a/src/theme/colors.ts +++ b/src/theme/colors.ts @@ -1,38 +1,38 @@ export const colors = { - white: '#FFFFFF', - black: '#000000', - grey: '#D1D1D1', - red: '#DB9791', - lightBlack: '#333333', - darkGrey: '#535353', - purple: '#684F85', - lightPurple: '#A493B7', - darkBlack: '#120D26', - yellow: '#E3C384', - modalOverlay: 'rgba(255, 255, 255, 0.6)', - lightGrey: '#B6B6B6', - blue: 'rgba(17, 56, 98, 0.83)', - green: '#238530', - lightWhite: '#E4DFDF', - greyLine: '#9B9B9B', - lightGreen: '#A5C4AA', - lightRed: '#EAB9B4', - darkGreen: '#C9EAB4', - lightblue: '#91BAD4', - choco:"#BC9D82", - lightBlueTwo :"#0E80E8", - sky:"#54C1FF", - lightgrayTwo:'#E8E8E8', - darkRed:'#6E1111', - darkyellow:'#BF820A', - greenBdr:'#159A12', - redTwo:'#C60000', - darkenBlack:'#353535', - gray:'#7E7E7E', - lightGray:'#EDEDED', - appColor:'#003333', - headerColor:'#003333', - footerColor:'#003333', - splashColor:'#003333', - purpleDark:'#8058AE' + white: "#FFFFFF", + black: "#000000", + grey: "#D1D1D1", + red: "#DB9791", + lightBlack: "#333333", + darkGrey: "#535353", + purple: "#684F85", + lightPurple: "#A493B7", + darkBlack: "#120D26", + yellow: "#E3C384", + modalOverlay: "rgba(255, 255, 255, 0.6)", + lightGrey: "#B6B6B6", + blue: "rgba(17, 56, 98, 0.83)", + green: "#238530", + lightWhite: "#E4DFDF", + greyLine: "#9B9B9B", + lightGreen: "#A5C4AA", + lightRed: "#EAB9B4", + darkGreen: "#C9EAB4", + lightblue: "#91BAD4", + choco: "#BC9D82", + lightBlueTwo: "#0E80E8", + sky: "#54C1FF", + lightgrayTwo: "#E8E8E8", + darkRed: "#6E1111", + darkyellow: "#BF820A", + greenBdr: "#159A12", + redTwo: "#C60000", + darkenBlack: "#353535", + gray: "#7E7E7E", + lightGray: "#EDEDED", + appColor: "#003333", + headerColor: "#003333", + footerColor: "#003333", + splashColor: "#003333", + purpleDark: "#8058AE", }; diff --git a/src/theme/device/device.js b/src/theme/device/device.js index ea22795d7..09f5a538a 100644 --- a/src/theme/device/device.js +++ b/src/theme/device/device.js @@ -1,6 +1,6 @@ -import {Dimensions, Platform} from 'react-native'; +import { Dimensions, Platform } from "react-native"; -const {width, height} = Dimensions.get('window'); +const { width, height } = Dimensions.get("window"); export const BASE_DIMENSIONS = Platform?.isPad ? { @@ -12,4 +12,4 @@ export const BASE_DIMENSIONS = Platform?.isPad height: 812, }; -export {width, height}; +export { width, height }; diff --git a/src/theme/device/normalize.tsx b/src/theme/device/normalize.tsx index 88c004d76..0c75622ac 100644 --- a/src/theme/device/normalize.tsx +++ b/src/theme/device/normalize.tsx @@ -1,4 +1,4 @@ -import {BASE_DIMENSIONS, height, width} from './device'; +import { BASE_DIMENSIONS, height, width } from "./device"; const scale = width / BASE_DIMENSIONS.width; @@ -19,4 +19,10 @@ const moderateScale = (size: number, factor = 0.5) => const lineHeightScale = (fontSize: number, factor = 1.2) => Math.ceil(normalizedHeight(fontSize * factor)); -export {normalScale, verticalScale, moderateScale, lineHeightScale, normalize}; +export { + normalScale, + verticalScale, + moderateScale, + lineHeightScale, + normalize, +}; diff --git a/src/theme/fonts.ts b/src/theme/fonts.ts index fe187ddcb..4ebdd5193 100644 --- a/src/theme/fonts.ts +++ b/src/theme/fonts.ts @@ -1,14 +1,14 @@ -import {moderateScale, normalize, normalScale} from './device/normalize'; +import { moderateScale, normalize, normalScale } from "./device/normalize"; const type = { - bold: 'NotoSerif-Bold', - light: 'NotoSerif-Light', - medium: 'NotoSerif-Medium', - regular: 'NotoSerif-Regular', - semiBold: 'NotoSerif-SemiBold', - thin: 'NotoSerif-Thin', - extraBold: 'NotoSerif-ExtraBold', - extraLight: 'NotoSerif-ExtraLight', + bold: "NotoSerif-Bold", + light: "NotoSerif-Light", + medium: "NotoSerif-Medium", + regular: "NotoSerif-Regular", + semiBold: "NotoSerif-SemiBold", + thin: "NotoSerif-Thin", + extraBold: "NotoSerif-ExtraBold", + extraLight: "NotoSerif-ExtraLight", }; const size = { @@ -72,4 +72,4 @@ const borderRadius = { radius64: moderateScale(64), }; -export {type, size, opacity, borderWidth, borderRadius}; +export { type, size, opacity, borderWidth, borderRadius }; diff --git a/src/theme/index.ts b/src/theme/index.ts index d91179041..4283c37dc 100644 --- a/src/theme/index.ts +++ b/src/theme/index.ts @@ -1,7 +1,7 @@ -import {light} from '@assets/constants'; -import {colors} from './colors'; -import {borderRadius, borderWidth, opacity, size, type} from './fonts'; -import {ThemeProps} from './theme'; +import { light } from "@assets/constants"; +import { colors } from "./colors"; +import { borderRadius, borderWidth, opacity, size, type } from "./fonts"; +import { ThemeProps } from "./theme"; const defaultTheme: ThemeProps = { fontType: type, @@ -12,7 +12,7 @@ const defaultTheme: ThemeProps = { borderWidth, }; -export const getTheme = (mode: 'light' | 'dark') => { +export const getTheme = (mode: "light" | "dark") => { if (mode === light) { return defaultTheme; } diff --git a/src/theme/theme.d.ts b/src/theme/theme.d.ts index 70cc4b204..6b33390ad 100644 --- a/src/theme/theme.d.ts +++ b/src/theme/theme.d.ts @@ -29,7 +29,6 @@ export interface ThemeProps { font36: number; font40: number; font64: number; - }; colors: { white: string; @@ -52,22 +51,22 @@ export interface ThemeProps { lightRed: string; darkGreen: string; lightblue: string; - choco:string; - lightBlueTwo:string; - sky:string; - lightgrayTwo:string; - darkRed:string; - darkyellow:string; - greenBdr:string; - redTwo:string; - darkenBlack:string; - gray:string; - lightGray:string; - appColor:string; - headerColor:string; - footerColor:string; - splashColor:string; - purpleDark:string; + choco: string; + lightBlueTwo: string; + sky: string; + lightgrayTwo: string; + darkRed: string; + darkyellow: string; + greenBdr: string; + redTwo: string; + darkenBlack: string; + gray: string; + lightGray: string; + appColor: string; + headerColor: string; + footerColor: string; + splashColor: string; + purpleDark: string; }; opacity: { opacity15: number; diff --git a/src/utils/common.ts b/src/utils/common.ts index 9f1a73e12..27661ae44 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,3 +1,3 @@ export const formatPrice = (price: string) => { - return `$${price?.replace('USD', '')}`; + return `$${price?.replace("USD", "")}`; }; diff --git a/src/utils/internet-connection-handle.tsx b/src/utils/internet-connection-handle.tsx index 54c59acd0..f84f537fd 100644 --- a/src/utils/internet-connection-handle.tsx +++ b/src/utils/internet-connection-handle.tsx @@ -1,13 +1,13 @@ -import React from 'react'; -import {useInternetConnectionHandle} from '@app-hooks/use-internet-connection-handle'; -import NetInfo from '@react-native-community/netinfo'; -import {useEffect} from 'react'; +import React from "react"; +import { useInternetConnectionHandle } from "@app-hooks/use-internet-connection-handle"; +import NetInfo from "@react-native-community/netinfo"; +import { useEffect } from "react"; export const InternetConnectionHandle = () => { - const {checkConnectivity} = useInternetConnectionHandle(); + const { checkConnectivity } = useInternetConnectionHandle(); useEffect(() => { - const unsubscribe = NetInfo.addEventListener(state => { + const unsubscribe = NetInfo.addEventListener((state) => { checkConnectivity(state?.isConnected || false); }); diff --git a/src/utils/platform-padding.tsx b/src/utils/platform-padding.tsx index 6050e54da..e8f00375c 100644 --- a/src/utils/platform-padding.tsx +++ b/src/utils/platform-padding.tsx @@ -1,10 +1,10 @@ -import {Platform} from 'react-native'; +import { Platform } from "react-native"; export const getBottomPadding = (padding: number) => - Platform.OS === 'ios' ? padding + 40 : padding; + Platform.OS === "ios" ? padding + 40 : padding; export const getTopPadding = (padding: number) => - Platform.OS === 'ios' ? padding + 40 : padding; + Platform.OS === "ios" ? padding + 40 : padding; export const getPlaformSpecificData = (androidData: number, iosData: number) => - Platform.OS === 'ios' ? iosData : androidData; + Platform.OS === "ios" ? iosData : androidData; diff --git a/src/utils/stripe.ts b/src/utils/stripe.ts index cdf7b5394..935cdafad 100644 --- a/src/utils/stripe.ts +++ b/src/utils/stripe.ts @@ -1,6 +1,5 @@ -import { STRIPE_PUBLIC_KEY } from '@network/constant'; -import {initStripe} from '@stripe/stripe-react-native'; - +import { STRIPE_PUBLIC_KEY } from "@network/constant"; +import { initStripe } from "@stripe/stripe-react-native"; const stripeConfig = { publishableKey: STRIPE_PUBLIC_KEY, diff --git a/tsconfig.json b/tsconfig.json index 41cf5b913..a2df2da8c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,10 +23,10 @@ "@screens/*": ["src/screens/*"], "@network/*": ["src/network/*"], "@app-hooks/*": ["src/app-hooks/*"], - "@store/*": ["src/store/*"], + "@store/*": ["src/store/*"] }, "noEmit": true, "target": "esnext" }, "exclude": ["node_modules", "babel.config.js", "metro.config.js"] -} \ No newline at end of file +}