diff --git a/src/pages/Popup/IPData.tsx b/src/pages/Popup/IPData.tsx index 3b64370..d51550c 100644 --- a/src/pages/Popup/IPData.tsx +++ b/src/pages/Popup/IPData.tsx @@ -18,7 +18,7 @@ interface IPDataProps { const IPData = ({ ip, setIP }: IPDataProps) => { return ( - + {ip && `${ip.query} ${getFlagEmoji(ip.countryCode)}`} { diff --git a/src/pages/Popup/LocationPage.tsx b/src/pages/Popup/LocationPage.tsx index 2af0781..d27e322 100644 --- a/src/pages/Popup/LocationPage.tsx +++ b/src/pages/Popup/LocationPage.tsx @@ -23,8 +23,6 @@ const LocationPage = ({ tab }: any) => { return ( diff --git a/src/pages/Popup/Main.jsx b/src/pages/Popup/Main.jsx deleted file mode 100644 index 46c47fc..0000000 --- a/src/pages/Popup/Main.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { useState, useEffect } from 'react' -import Navbar from './Navbar' -import IPData from './IPData' -import ProfileSelect from './ConfigurationSelect' -import DebugSettings from './LocationInput' -import UserAgentSettings from './UserAgentSettings' - -const getIP = () => - fetch('http://ip-api.com/json/') - .then((response) => response.json()) - .then((ipData) => { - chrome.storage.sync.set({ ipData }) - return ipData - }) - -const Popup = () => { - const [ip, setIP] = useState(null) - const [profile, setProfile] = useState('default') - - useEffect(() => { - chrome.storage.sync.get(['profile', 'ipData'], (result) => { - result.profile && setProfile(result.profile) - if (result.ipData) { - setIP(result.ipData) - } else { - Promise.resolve(getIP()).then((ipData) => setIP(ipData)) - } - }) - }, []) - - return ( - - - - - - - - - - - - Current tab won't be fully spoofed until after first or second reload. - - - - ) -} - -export default Popup diff --git a/src/pages/Popup/Popup.tsx b/src/pages/Popup/Popup.tsx index 81d0966..8cadfc0 100644 --- a/src/pages/Popup/Popup.tsx +++ b/src/pages/Popup/Popup.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react' -import { ThemeProvider, Flex, Box } from 'theme-ui' +import { ThemeProvider, Flex, Box, Text } from 'theme-ui' import { theme } from '../../theme' import { MapPin, Globe, ExternalLink } from 'react-feather' import TabItem from './TabItem' @@ -40,17 +40,19 @@ const Popup = () => { onClick={() => window.open('https://vytal.io')} /> - + - - Current tab won't be fully spoofed until after reload - + Current tab won't be fully spoofed until after reload. + diff --git a/src/pages/Popup/UserAgentPage.tsx b/src/pages/Popup/UserAgentPage.tsx index 146a89a..a20a75a 100644 --- a/src/pages/Popup/UserAgentPage.tsx +++ b/src/pages/Popup/UserAgentPage.tsx @@ -60,8 +60,6 @@ const UserAgentPage = ({ tab }: any) => { return ( diff --git a/src/pages/Popup/UserAgentSettings.js b/src/pages/Popup/UserAgentSettings.js deleted file mode 100644 index bf4049a..0000000 --- a/src/pages/Popup/UserAgentSettings.js +++ /dev/null @@ -1,106 +0,0 @@ -import React, { useState, useEffect } from 'react' -import userAgents from '../../utils/userAgents' -import detachDebugger from '../../utils/detachDebugger' - -const UserAgentSettings = () => { - const [userAgent, setUserAgent] = useState('') - const [randomUA, setRandomUA] = useState(false) - const [interval, setInterval] = useState(60) - - useEffect(() => { - chrome.storage.sync.get(['userAgent', 'randomUA', 'interval'], (result) => { - result.interval && setInterval(result.interval) - - result.randomUA && setRandomUA(true) - - if (result.userAgent) { - setUserAgent(result.userAgent) - } - }) - }, []) - - const changeUserAgent = (e) => { - detachDebugger() - chrome.storage.sync.set({ userAgent: e.target.value }) - setUserAgent(e.target.value) - } - - const randomize = (e) => { - detachDebugger() - const randomUserAgent = - userAgents[Math.floor(Math.random() * userAgents.length)] - chrome.storage.sync.set({ - userAgent: e.target.checked ? randomUserAgent : null, - randomUA: e.target.checked, - }) - e.target.checked ? setUserAgent(randomUserAgent) : setUserAgent('') - setRandomUA(e.target.checked) - if (parseInt(interval)) { - chrome.alarms.create('userAgentAlarm', { - delayInMinutes: parseInt(interval), - periodInMinutes: parseInt(interval), - }) - } - } - - const changeInterval = (e) => { - chrome.storage.sync.set({ interval: e.target.value }) - setInterval(e.target.value) - if (parseInt(e.target.value)) { - chrome.alarms.create('userAgentAlarm', { - delayInMinutes: parseInt(e.target.value), - periodInMinutes: parseInt(e.target.value), - }) - } - } - - return ( - <> - - - User Agent - - - - - Randomize every - - - - minutes - - - > - ) -} - -export default UserAgentSettings diff --git a/src/theme.ts b/src/theme.ts index 555f098..b84a696 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -53,19 +53,6 @@ export const theme: Theme = { bg: 'primaryDark', }, }, - power: { - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - py: '12px', - px: '16px', - color: 'background', - borderRadius: '50%', - cursor: 'pointer', - // '&:hover': { - // bg: 'primaryDark', - // }, - }, close: { cursor: 'pointer', color: 'text',