{
borderBottomColor: 'grey',
}}
>
- | {title} |
+ {title} |
{
>
Autofill Current Page
-
)
}
diff --git a/src/Popup/Pages/ConnectionPage/index.tsx b/src/Popup/Pages/ConnectionPage/index.tsx
index dbdd81d..3317ee2 100644
--- a/src/Popup/Pages/ConnectionPage/index.tsx
+++ b/src/Popup/Pages/ConnectionPage/index.tsx
@@ -48,11 +48,6 @@ const ConnectionPage = ({ tab, ipData }: ConnectionPageProps) => {
noBorder
/>
-
)
}
diff --git a/src/Popup/Pages/SystemPage/index.tsx b/src/Popup/Pages/LocationPage/index.tsx
similarity index 77%
rename from src/Popup/Pages/SystemPage/index.tsx
rename to src/Popup/Pages/LocationPage/index.tsx
index 481f76b..b06a72d 100644
--- a/src/Popup/Pages/SystemPage/index.tsx
+++ b/src/Popup/Pages/LocationPage/index.tsx
@@ -6,17 +6,18 @@ import detachDebugger from '../../../utils/detachDebugger'
import countryLocales from '../../../utils/countryLocales'
import { ipData } from '../../../types'
import configurations from '../../../utils/configurations'
-import CheckBox from '../../Components/CheckBox'
import FooterLink from '../../Components/FooterLink'
+import Table from '../../Components/Table'
+import TableRow from '../../Components/TableRow'
-interface SystemPageProps {
+interface LocationPageProps {
tab: string
ipData?: ipData
geolocation?: GeolocationCoordinates
}
-const SystemPage = ({ tab, ipData, geolocation }: SystemPageProps) => {
- const [systemType, setSystemType] = useState('')
+const LocationPage = ({ tab, ipData, geolocation }: LocationPageProps) => {
+ const [locationType, setLocationType] = useState('')
const [timezone, setTimezone] = useState('')
const [locale, setLocale] = useState('')
const [lat, setLatitude] = useState('')
@@ -27,9 +28,9 @@ const SystemPage = ({ tab, ipData, geolocation }: SystemPageProps) => {
useEffect(() => {
chrome.storage.local.get(
- ['systemType', 'configuration', 'timezone', 'locale', 'lat', 'lon'],
+ ['locationType', 'configuration', 'timezone', 'locale', 'lat', 'lon'],
(storage) => {
- if (!storage.systemType || storage.systemType === 'default') {
+ if (!storage.locationType || storage.locationType === 'default') {
setTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone)
setLocale(Intl.DateTimeFormat().resolvedOptions().locale)
if (geolocation) {
@@ -37,7 +38,7 @@ const SystemPage = ({ tab, ipData, geolocation }: SystemPageProps) => {
setLongitude(`${geolocation.longitude}`)
}
}
- if (storage.systemType === 'matchIp' && ipData) {
+ if (storage.locationType === 'matchIp' && ipData) {
setTimezone(ipData.timezone)
setLocale(countryLocales[ipData.countryCode].locale)
setLatitude(`${ipData.lat}`)
@@ -48,24 +49,24 @@ const SystemPage = ({ tab, ipData, geolocation }: SystemPageProps) => {
lat: ipData.lat,
lon: ipData.lon,
})
- } else if (storage.systemType === 'custom') {
+ } else if (storage.locationType === 'custom') {
storage.configuration && setConfiguration(storage.configuration)
storage.timezone && setTimezone(storage.timezone)
storage.locale && setLocale(storage.locale)
storage.lat && setLatitude(storage.lat)
storage.lon && setLongitude(storage.lon)
}
- storage.systemType
- ? setSystemType(storage.systemType)
- : setSystemType('default')
+ storage.locationType
+ ? setLocationType(storage.locationType)
+ : setLocationType('default')
}
)
}, [geolocation, ipData])
const changeType = (e: ChangeEvent) => {
detachDebugger()
- setSystemType(e.target.value)
- chrome.storage.local.set({ systemType: e.target.value })
+ setLocationType(e.target.value)
+ chrome.storage.local.set({ locationType: e.target.value })
if (e.target.value === 'default') {
setTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone)
@@ -129,18 +130,26 @@ const SystemPage = ({ tab, ipData, geolocation }: SystemPageProps) => {
}
const changeInputText = () => {
- if (systemType !== 'custom' || configuration !== 'custom') {
+ if (locationType !== 'custom' || configuration !== 'custom') {
setConfiguration('custom')
- setSystemType('custom')
+ setLocationType('custom')
chrome.storage.local.set({
configuration: 'custom',
- systemType: 'custom',
+ locationType: 'custom',
})
}
}
+ const getFlagEmoji = (countryCode: string) => {
+ const codePoints = countryCode
+ .toUpperCase()
+ .split('')
+ .map((char) => 127397 + char.charCodeAt(0))
+ return String.fromCodePoint(...codePoints)
+ }
+
return (
-
+
{
>
- {systemType === 'custom' && (
+ {locationType === 'matchIp' && (
+
+ )}
+ {locationType === 'custom' && (
<>
)
}
-export default SystemPage
+export default LocationPage
diff --git a/src/Popup/Pages/UserAgentPage/index.tsx b/src/Popup/Pages/UserAgentPage/index.tsx
index a157098..b0948bb 100644
--- a/src/Popup/Pages/UserAgentPage/index.tsx
+++ b/src/Popup/Pages/UserAgentPage/index.tsx
@@ -3,9 +3,7 @@ import { Box, Label, Radio, Flex, Select } from 'theme-ui'
import DebouncedInput from '../../Components/DebouncedInput'
import userAgents from '../../../utils/userAgents'
import detachDebugger from '../../../utils/detachDebugger'
-import attachCurrentTab from '../../../utils/attachCurrentTab'
import Page from '../../Components/Page'
-import CheckBox from '../../Components/CheckBox'
import FooterLink from '../../Components/FooterLink'
interface UserAgentPageProps {
@@ -64,7 +62,7 @@ const UserAgentPage = ({ tab }: UserAgentPageProps) => {
platform: userAgents[e.target.value]['platform'],
operatingSystem: e.target.value,
})
- await attachCurrentTab()
+ // await attachCurrentTab()
}
const changeBrowser = (e: ChangeEvent) => {
@@ -176,10 +174,7 @@ const UserAgentPage = ({ tab }: UserAgentPageProps) => {
onChange={changeTextInput}
mb="12px"
/>
- {userAgentType !== 'default' && (
-
- )}
-
+
)
}
diff --git a/src/Popup/Pages/WebRtcPage/index.tsx b/src/Popup/Pages/WebRtcPage/index.tsx
index df1d132..4099162 100644
--- a/src/Popup/Pages/WebRtcPage/index.tsx
+++ b/src/Popup/Pages/WebRtcPage/index.tsx
@@ -60,7 +60,6 @@ const WebRtcPage = ({ tab }: SystemPageProps) => {
webRtcPolicy={webRtcPolicy}
onChange={changeRadioValue}
/>
-
)
}
diff --git a/src/Popup/Popup.tsx b/src/Popup/Popup.tsx
index 1896205..327bf8b 100644
--- a/src/Popup/Popup.tsx
+++ b/src/Popup/Popup.tsx
@@ -3,14 +3,14 @@ import { ThemeProvider, Flex, Box } from 'theme-ui'
import { theme } from '../theme'
import {
Wifi,
- HardDrive,
+ MapPin,
FileText,
MessageSquare,
Globe,
Settings,
} from 'react-feather'
import TabItem from './TabItem'
-import SystemPage from './Pages/SystemPage'
+import LocationPage from './Pages/LocationPage'
import UserAgentPage from './Pages/UserAgentPage'
import SettingsPage from './Pages/SettingsPage'
import AutofillPage from './Pages/AutofillPage'
@@ -24,7 +24,7 @@ import OtherOptionsPage from './Pages/OtherOptionsPage'
import addresses from '../utils/addresses'
const Popup = () => {
- const [tab, setTab] = useState('autofill')
+ const [tab, setTab] = useState('location')
const [ipData, setIpData] = useState()
// const [reverseGeocoding, setReverseGeocoding] = useState(undefined)
const [geolocation, setGeolocation] = useState()
@@ -69,17 +69,17 @@ const Popup = () => {
flexDirection: 'column',
}}
>
- setTab('connection')}
- />
+ /> */}
setTab('system')}
+ Icon={MapPin}
+ active={tab === 'location'}
+ onClick={() => setTab('location')}
/>
- setTab('autofill')}
@@ -88,7 +88,7 @@ const Popup = () => {
Icon={MessageSquare}
active={tab === 'webRtc'}
onClick={() => setTab('webRtc')}
- />
+ /> */}
{
-
+
|