Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bd6064b52 |
@@ -1,6 +1,5 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
import axios from 'axios'
|
|
||||||
|
|
||||||
function Default({ children }) {
|
function Default({ children }) {
|
||||||
// dark mode setup
|
// dark mode setup
|
||||||
@@ -13,32 +12,6 @@ function Default({ children }) {
|
|||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const country = queryParams.get("cnt")?.toUpperCase();
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
const getLocation = () => {
|
|
||||||
if (navigator.geolocation) {
|
|
||||||
navigator.geolocation.getCurrentPosition(
|
|
||||||
(data) => {
|
|
||||||
const pos = data.coords;
|
|
||||||
const position = {
|
|
||||||
lat: pos.latitude,
|
|
||||||
long: pos.longitude,
|
|
||||||
};
|
|
||||||
axios.get(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${position.lat}&lon=${position.long}&zoom=18&addressdetails=1`).then(res =>{
|
|
||||||
localStorage.setItem("myloc", res?.data?.address?.country);
|
|
||||||
// console.log('LOC', res?.data?.address?.country)
|
|
||||||
// localStorage.setItem("myloc", JSON.stringify(position));
|
|
||||||
}).catch(err => {
|
|
||||||
console.log('ERR', err)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
localStorage.setItem("myloc", JSON.stringify('not supported'));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
localStorage.setItem("myloc", JSON.stringify('not supported'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||||
setTheme("dark");
|
setTheme("dark");
|
||||||
@@ -66,10 +39,6 @@ function Default({ children }) {
|
|||||||
}
|
}
|
||||||
},[countryMode])
|
},[countryMode])
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
getLocation()
|
|
||||||
},[])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode }}>
|
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode }}>
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ export default function RightSideBar({ myJobList }) {
|
|||||||
{/* name */}
|
{/* name */}
|
||||||
<div>
|
<div>
|
||||||
<p className="text-thin-light-gray text-base font-medium">
|
<p className="text-thin-light-gray text-base font-medium">
|
||||||
<NavLink to="/offer-interest">Offers Interest</NavLink>
|
<NavLink to="/offer-interest">Interest</NavLink>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{/* action */}
|
{/* action */}
|
||||||
|
|||||||
@@ -1588,9 +1588,6 @@ class usersService {
|
|||||||
// Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig
|
// Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig
|
||||||
// Axios.defaults.withCredentials = true;
|
// Axios.defaults.withCredentials = true;
|
||||||
//debugger;
|
//debugger;
|
||||||
if(localStorage && localStorage.getItem('myloc')){
|
|
||||||
reqData.loc = localStorage.getItem('myloc')
|
|
||||||
}
|
|
||||||
return Axios.post(endPoint, reqData)
|
return Axios.post(endPoint, reqData)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user