added scroll bars to whitelist and deleted comments
This commit is contained in:
parent
5424307e9e
commit
c084a61a7a
1 changed files with 5 additions and 26 deletions
|
|
@ -1,13 +1,7 @@
|
||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { Box, Label, Input, Flex, Button, Close, Field } from 'theme-ui'
|
import { Box, Input, Flex, Button, Close } from 'theme-ui'
|
||||||
import LocationInput from './LocationInput'
|
|
||||||
import ConfigurationSelect from './ConfigurationSelect'
|
|
||||||
import IPData from './IPData'
|
|
||||||
import getIP from '../../utils/getIP'
|
|
||||||
|
|
||||||
const WhitelistPage = ({ tab }: any) => {
|
const WhitelistPage = ({ tab }: any) => {
|
||||||
const [ip, setIP] = useState(null)
|
|
||||||
const [configuration, setConfiguration] = useState('default')
|
|
||||||
const [currentUrl, setCurrentUrl] = useState('')
|
const [currentUrl, setCurrentUrl] = useState('')
|
||||||
const [whitelist, setWhitelist] = useState<string[]>([])
|
const [whitelist, setWhitelist] = useState<string[]>([])
|
||||||
|
|
||||||
|
|
@ -39,10 +33,6 @@ const WhitelistPage = ({ tab }: any) => {
|
||||||
!whitelist.includes(e.target.url.value) &&
|
!whitelist.includes(e.target.url.value) &&
|
||||||
setWhitelist((prevWhitelist) => [...prevWhitelist, e.target.url.value])
|
setWhitelist((prevWhitelist) => [...prevWhitelist, e.target.url.value])
|
||||||
// detachDebugger()
|
// detachDebugger()
|
||||||
// chrome.storage.sync.set({ [type]: e.target.value })
|
|
||||||
// setCurrentUrl(e.target.value)
|
|
||||||
// chrome.storage.sync.set({ configuration: 'custom' })
|
|
||||||
// setConfiguration('custom')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -55,21 +45,8 @@ const WhitelistPage = ({ tab }: any) => {
|
||||||
>
|
>
|
||||||
<Box sx={{ fontSize: '20px', mb: '12px' }}>Whitelist</Box>
|
<Box sx={{ fontSize: '20px', mb: '12px' }}>Whitelist</Box>
|
||||||
<Flex as="form" onSubmit={(e) => handleSubmit(e)}>
|
<Flex as="form" onSubmit={(e) => handleSubmit(e)}>
|
||||||
<Input
|
<Input name="url" defaultValue={currentUrl} spellCheck="false" />
|
||||||
name="url"
|
<Button sx={{ height: '28px', flexShrink: 0, ml: '8px' }}>Add</Button>
|
||||||
defaultValue={currentUrl}
|
|
||||||
// onChange={changeTextValue}
|
|
||||||
spellCheck="false"
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
// onClick={() => {
|
|
||||||
// // setWhitelist((prevWhitelist) => [...prevWhitelist, currentUrl])
|
|
||||||
// // detachDebugger()
|
|
||||||
// }}
|
|
||||||
sx={{ height: '28px', flexShrink: 0, ml: '8px' }}
|
|
||||||
>
|
|
||||||
Add
|
|
||||||
</Button>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
{whitelist.length ? (
|
{whitelist.length ? (
|
||||||
<Box
|
<Box
|
||||||
|
|
@ -79,6 +56,8 @@ const WhitelistPage = ({ tab }: any) => {
|
||||||
borderColor: 'grey',
|
borderColor: 'grey',
|
||||||
p: '2px 8px',
|
p: '2px 8px',
|
||||||
my: '8px',
|
my: '8px',
|
||||||
|
maxHeight: '260px',
|
||||||
|
overflow: 'auto',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{whitelist.map((element, index) => {
|
{whitelist.map((element, index) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue