MCPcopy Create free account
hub / github.com/Exafunction/codeium-chrome / Options

Function Options

src/component/Options.tsx:139–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137};
138
139const Options = () => {
140 const tokenRef = createRef<HTMLInputElement>();
141 const portalUrlRef = createRef<HTMLInputElement>();
142 const [portalUrlText, setPortalUrlText] = useState('');
143 useEffect(() => {
144 (async () => {
145 setPortalUrlText((await getStorageItem('portalUrl')) ?? '');
146 })();
147 }, []);
148 return (
149 <Box sx={{ width: '100%', maxWidth: 400, bgcolor: 'background.paper' }}>
150 <Typography variant="body2">
151 <SettingsIcon
152 fontSize="small"
153 sx={{
154 verticalAlign: 'bottom',
155 marginRight: '0.2em',
156 marginLeft: '0.4em',
157 bottom: '-0.1em',
158 }}
159 />{' '}
160 Edit telemetry settings at the{' '}
161 <Link href="https://codeium.com/profile" target="_blank">
162 Codeium website
163 <OpenInNewIcon
164 fontSize="small"
165 sx={{
166 verticalAlign: 'bottom',
167 }}
168 />
169 </Link>
170 </Typography>
171 <Divider
172 sx={{
173 padding: '0.5em',
174 }}
175 />
176 <Box sx={{ my: 2, mx: 2 }}>
177 <Typography variant="h6"> Alternative ways to log in </Typography>
178 <TextField
179 id="token"
180 label="Token"
181 variant="standard"
182 fullWidth
183 type="password"
184 inputRef={tokenRef}
185 />
186 <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
187 <Button variant="text" onClick={openTokenPage} sx={{ textTransform: 'none' }}>
188 Get Token <OpenInNewIcon />
189 </Button>
190
191 <Button
192 variant="text"
193 onClick={async () => {
194 // get token from input
195 const token = tokenRef.current?.value;
196 await chrome.runtime.sendMessage({ type: 'manual', token: token });

Callers

nothing calls this directly

Calls 2

getStorageItemFunction · 0.90
setStorageItemFunction · 0.90

Tested by

no test coverage detected