Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
468e7f6
feature: integrated clarity in the admin
ufumerfarooq67 Sep 24, 2025
c395b1c
feature: integrated clarity in the customer web
ufumerfarooq67 Sep 24, 2025
19e85a8
feature: added clarity in store and rider app
ufumerfarooq67 Sep 25, 2025
cdf40e1
Merge pull request #1666 from enatega/main
ufumerfarooq67 Sep 26, 2025
b38379b
fix: fixed order issue in rider
ufumerfarooq67 Sep 26, 2025
54db3b0
fix: location issue - v3
ufumerfarooq67 Sep 26, 2025
ac5f73b
added platform specific splash
ufumerfarooq67 Sep 29, 2025
038f688
Merge pull request #1681 from enatega/main
ufumerfarooq67 Sep 30, 2025
e061430
fix: added new clarity script to web
ufumerfarooq67 Oct 2, 2025
92eafef
fix: added new clarity script to admin
ufumerfarooq67 Oct 2, 2025
a26166d
fix: fixed all stores issues and - [ ] https://github.com/enatega/foo…
ufumerfarooq67 Oct 2, 2025
934bbce
fix: commented demo username in customer app
ufumerfarooq67 Oct 2, 2025
2c3ddb2
fix: commented requestTrackingPermissions
ufumerfarooq67 Oct 2, 2025
e80c80f
fix: commented requestTrackingPermissions
ufumerfarooq67 Oct 2, 2025
3f328a0
Merge pull request #1691 from enatega/main
ufumerfarooq67 Oct 2, 2025
1b99cc6
fix: added new clarity script to admin
ufumerfarooq67 Oct 3, 2025
b2f5db8
Merge branch 'main-with-clarity' of github.com:enatega/food-delivery-…
ufumerfarooq67 Oct 3, 2025
487ba09
fix: integrated optmized most order, nearby stores and nearby store c…
ufumerfarooq67 Oct 3, 2025
a1fe637
fix: added missing logo in the restaurant card previe field fragment
ufumerfarooq67 Oct 3, 2025
7e64e68
fix: modified the fields in the RestuarantPreview fragment
ufumerfarooq67 Oct 3, 2025
a783fab
Merge branch 'main-with-clarity' into main
charles-aric Oct 3, 2025
db45646
Bump eslint-plugin-prettier in /enatega-multivendor-web
dependabot[bot] Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions enatega-multivendor-admin/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getMessages } from 'next-intl/server';
import Script from 'next/script';

// ✅ Add metadata export for favicon
export const metadata = {
Expand All @@ -22,6 +23,18 @@ export default async function RootLayout({

return (
<html lang={locale}>
<head>
{/* Microsoft Clarity */}
<Script id="microsoft-clarity" strategy="afterInteractive">
{`
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "tjqxrz689j");
`}
</Script>
</head>
<body>
<NextIntlClientProvider messages={messages}>
{children}
Expand Down
11 changes: 9 additions & 2 deletions enatega-multivendor-app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import './i18next'
import * as SplashScreen from 'expo-splash-screen'
import TextDefault from './src/components/Text/TextDefault/TextDefault'
import { ErrorBoundary } from './src/components/ErrorBoundary'
import * as Clarity from '@microsoft/react-native-clarity';


// LogBox.ignoreLogs([
// // 'Warning: ...',
Expand All @@ -42,6 +44,11 @@ import { ErrorBoundary } from './src/components/ErrorBoundary'
// ]) // Ignore log notification by message
// LogBox.ignoreAllLogs() // Ignore all log notifications


Clarity.initialize('mcdyi6urgs', {
logLevel: Clarity.LogLevel.Verbose, // Note: Use "LogLevel.Verbose" value while testing to debug initialization issues.
});

Notifications.setNotificationHandler({
handleNotification: async (notification) => {
return {
Expand Down Expand Up @@ -127,9 +134,9 @@ export default function App() {
}, [location])

// For Permission
useEffect(() => {
/* useEffect(() => {
requestTrackingPermissions()
}, [])
}, []) */

// For Sentry
// useEffect(() => {
Expand Down
14 changes: 12 additions & 2 deletions enatega-multivendor-app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "Enatega Multi",
"scheme": "enategamultivendor",
"version": "1.0.96",
"version": "1.0.97",
"description": "Enatega is a starter kit food ordering app built in React Native using Expo for IOS and Android. It's made keeping good aesthetics in mind as well keeping the best coding practices in mind. Its fully customisable to easily help you in your next food delivery project. https://market.nativebase.io/view/react-native-food-delivery-backend-app",
"slug": "enategamultivendor",
"owner": "ninjas_code",
Expand All @@ -23,6 +23,11 @@
"assetBundlePatterns": ["**/*"],
"userInterfaceStyle": "automatic",
"ios": {
"splash": {
"image": "./assets/splash.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"entitlements": {
"com.apple.developer.networking.wifi-info": true
},
Expand Down Expand Up @@ -53,10 +58,15 @@
"androidCollapsedTitle": "Enatega Multivendor"
},
"android": {
"versionCode": 96,
"versionCode": 97,
"package": "com.enatega.multivendor",
"userInterfaceStyle": "automatic",
"googleServicesFile": "./google-services.json",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "cover",
"backgroundColor": "#ffffff"
},
"config": {
"googleMaps": {
"apiKey": "AIzaSyCcm7_Wd7uvmC9YnYLu2JHGWPt6z1MaL1E"
Expand Down
20 changes: 20 additions & 0 deletions enatega-multivendor-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions enatega-multivendor-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@babel/plugin-transform-object-rest-spread": "^7.23.4",
"@babel/plugin-transform-optional-catch-binding": "^7.23.4",
"@expo/vector-icons": "^14.1.0",
"@microsoft/react-native-clarity": "^4.3.3",
"@react-native-async-storage/async-storage": "2.1.2",
"@react-native-community/datetimepicker": "8.4.1",
"@react-native-community/netinfo": "11.4.1",
Expand Down
24 changes: 24 additions & 0 deletions enatega-multivendor-app/src/apollo/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,30 @@ export const restaurantPreviewFragment = gql`
}
}
`

export const RESTAURANTS_CARD_FRAGMENT = gql`
fragment RestaurantCardPreviewFields on RestaurantCardPreview {
_id
name
image
logo
slug
shopType
deliveryTime
reviewAverage
cuisines
openingTimes {
day
times {
startTime
endTime
}
}
isAvailable
isActive
}
`;

export const profile = `
query{
profile{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class ErrorBoundary extends Component {
}

static getDerivedStateFromError(error) {
console.log(error)
return { hasError: true, error };
}

Expand Down
7 changes: 3 additions & 4 deletions enatega-multivendor-app/src/context/Location.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ const GET_ZONES = gql`
export const LocationContext = createContext()

export const LocationProvider = ({ children }) => {
const { permission } = useWatchLocation()

const [location, setLocation] = useState(null)
const [cities, setCities] = useState([])
const [permissionState, setPermissionState] = useState(null)
const [isConnected, setIsConnected] = useState(false)
const { loading, error, data, refetch } = useQuery(GET_ZONES)

useEffect(() => {
setPermissionState(permission)
}, [permission])
// useEffect(() => {
// setPermissionState(permission)
// }, [permission])

useEffect(() => {
if (location) {
Expand Down
6 changes: 3 additions & 3 deletions enatega-multivendor-app/src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ function BottomTabNavigator() {

function AppContainer() {
const client = useApolloClient()
const { permissionState } = useContext(LocationContext)
const { location, permission } = useWatchLocation()
const { permissionState, location } = useContext(LocationContext)
const lastNotificationResponse = Notifications.useLastNotificationResponse()
const handleNotification = useCallback(
async (response) => {
Expand All @@ -304,6 +303,7 @@ function AppContainer() {
}
}, [lastNotificationResponse])

console.log({ permissionState, location })

return (
<SafeAreaProvider>
Expand All @@ -312,7 +312,7 @@ function AppContainer() {
navigationService.setGlobalRef(ref)
}}
>
{!permissionState?.granted ? <LocationStack /> : <MainNavigator />}
{!permissionState?.granted || !location ? <LocationStack /> : <MainNavigator />}

{/* {<LocationStack />}
<MainNavigator /> */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import useWatchLocation from '../../ui/hooks/useWatchLocation'

export default function CurrentLocation() {
const Analytics = analytics()
const { onRequestPermission } = useWatchLocation()
// const [permissionState, setPermissionState] = useState(permission)
const { permission, onRequestPermission } = useWatchLocation()
const { t, i18n } = useTranslation()
const [loading, setLoading] = useState(false)
const [isCheckingZone, setIsCheckingZone] = useState(false)
Expand Down Expand Up @@ -97,25 +96,66 @@ export default function CurrentLocation() {
}, 100)
}

async function checkCityMatch(new_location = null) {
console.log('calling checkCityMatch', new_location)
const cl_p = new_location || currentLocation
if (!cl_p || !cities.length) return
// console.log("Checking city match for location:", currentLocation);
// console.log("Cities list:", cities);

console.log({ cl_p })

setIsCheckingZone(true)

const matchingCity = checkLocationInCities(cl_p, filterCities())
if (matchingCity) {
try {
const response = await getAddress(cl_p.latitude, cl_p.longitude)
// console.log("Fetched Address Data:", response);
const locationData = {
label: 'Location',
deliveryAddress: response.formattedAddress,
latitude: cl_p.latitude,
longitude: cl_p.longitude,
city: response.city
}

setLocation(locationData)
setTimeout(() => {
setIsCheckingZone(false)
navigation.navigate('Main')
}, 100)
} catch (error) {
// console.error('Error getting address:', error)
setIsCheckingZone(false)
}
} else {
// console.warn("No matching city found for this location.");
setIsCheckingZone(false)
}
}

async function getCurrentLocationOnStart() {
console.log('calling getCurrentLocationOnStart', permissionState)
setLoading(true)

// Handle permission request result
if (!permissionState) return

if (!permissionState?.granted && permissionState?.status !== 'granted') {
if (!permissionState?.granted) {
console.log('Location permission not granted')
return
}

// Permission is granted, continue with location logic
const { error, coords } = await getCurrentLocation()

setLoading(true)

const { error, coords, message } = await getCurrentLocation()
if (error) {
// console.log("Location error:",message, error)
setLoading(false)
return
}

// console.log("Fetched Location:", coords);
const userLocation = {
latitude: coords.latitude,
Expand All @@ -134,7 +174,6 @@ export default function CurrentLocation() {

// ❌ Permanently denied (cannot ask again)
if (!permission_response?.canAskAgain) {
console.log('sadahsdjkasdhajksh')
// Optionally prompt user to open settings
if (Platform.OS === 'ios') {
Linking.openURL('app-settings:') // iOS deep link to app settings
Expand Down Expand Up @@ -163,44 +202,9 @@ export default function CurrentLocation() {

useEffect(() => {
getCurrentLocationOnStart()
}, [permissionState])
}, [permissionState, permission])

useEffect(() => {
async function checkCityMatch() {
if (!currentLocation || !cities.length) return
// console.log("Checking city match for location:", currentLocation);
// console.log("Cities list:", cities);

setIsCheckingZone(true)

const matchingCity = checkLocationInCities(currentLocation, filterCities())
if (matchingCity) {
try {
const response = await getAddress(currentLocation.latitude, currentLocation.longitude)
// console.log("Fetched Address Data:", response);
const locationData = {
label: 'Location',
deliveryAddress: response.formattedAddress,
latitude: currentLocation.latitude,
longitude: currentLocation.longitude,
city: response.city
}

setLocation(locationData)
setTimeout(() => {
setIsCheckingZone(false)
navigation.navigate('Main')
}, 100)
} catch (error) {
// console.error('Error getting address:', error)
setIsCheckingZone(false)
}
} else {
// console.warn("No matching city found for this location.");
setIsCheckingZone(false)
}
}

checkCityMatch()
}, [currentLocation, cities])

Expand Down
Loading