diff options
Diffstat (limited to 'packages/renderer/src/components/locationBar/LocationTextField.tsx')
-rw-r--r-- | packages/renderer/src/components/locationBar/LocationTextField.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/renderer/src/components/locationBar/LocationTextField.tsx b/packages/renderer/src/components/locationBar/LocationTextField.tsx index 30953de..85cf794 100644 --- a/packages/renderer/src/components/locationBar/LocationTextField.tsx +++ b/packages/renderer/src/components/locationBar/LocationTextField.tsx | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | import FilledInput from '@mui/material/FilledInput'; | 21 | import FilledInput from '@mui/material/FilledInput'; |
22 | import { styled } from '@mui/material/styles'; | 22 | import { styled } from '@mui/material/styles'; |
23 | import { SecurityLabelKind } from '@sophie/shared'; | ||
23 | import { autorun } from 'mobx'; | 24 | import { autorun } from 'mobx'; |
24 | import { observer } from 'mobx-react-lite'; | 25 | import { observer } from 'mobx-react-lite'; |
25 | import React, { useCallback, useEffect, useState } from 'react'; | 26 | import React, { useCallback, useEffect, useState } from 'react'; |
@@ -30,7 +31,6 @@ import GoButton from './GoButton'; | |||
30 | import LocationOverlayInput from './LocationOverlayInput'; | 31 | import LocationOverlayInput from './LocationOverlayInput'; |
31 | import SecurityLabel from './SecurityLabel'; | 32 | import SecurityLabel from './SecurityLabel'; |
32 | import UrlOverlay from './UrlOverlay'; | 33 | import UrlOverlay from './UrlOverlay'; |
33 | import splitUrl from './splitUrl'; | ||
34 | 34 | ||
35 | const LocationTextFieldRoot = styled(FilledInput, { | 35 | const LocationTextFieldRoot = styled(FilledInput, { |
36 | name: 'LocationTextField', | 36 | name: 'LocationTextField', |
@@ -75,8 +75,6 @@ function LocationTextField({ | |||
75 | [setInputFocused], | 75 | [setInputFocused], |
76 | ); | 76 | ); |
77 | 77 | ||
78 | const splitResult = splitUrl(service?.currentUrl); | ||
79 | |||
80 | return ( | 78 | return ( |
81 | <LocationTextFieldRoot | 79 | <LocationTextFieldRoot |
82 | inputComponent={LocationOverlayInput} | 80 | inputComponent={LocationOverlayInput} |
@@ -84,7 +82,12 @@ function LocationTextField({ | |||
84 | 'aria-label': 'Location', | 82 | 'aria-label': 'Location', |
85 | spellCheck: false, | 83 | spellCheck: false, |
86 | overlayVisible: !inputFocused && !changed, | 84 | overlayVisible: !inputFocused && !changed, |
87 | overlay: <UrlOverlay splitResult={splitResult} />, | 85 | overlay: ( |
86 | <UrlOverlay | ||
87 | url={service?.currentUrl ?? ''} | ||
88 | alert={service?.hasSecurityLabelWarning ?? false} | ||
89 | /> | ||
90 | ), | ||
88 | }} | 91 | }} |
89 | inputRef={inputRefCallback} | 92 | inputRef={inputRefCallback} |
90 | onFocus={() => setInputFocused(true)} | 93 | onFocus={() => setInputFocused(true)} |
@@ -114,8 +117,8 @@ function LocationTextField({ | |||
114 | disableUnderline | 117 | disableUnderline |
115 | startAdornment={ | 118 | startAdornment={ |
116 | <SecurityLabel | 119 | <SecurityLabel |
120 | kind={service?.securityLabel ?? SecurityLabelKind.Empty} | ||
117 | changed={changed} | 121 | changed={changed} |
118 | splitResult={splitResult} | ||
119 | position="start" | 122 | position="start" |
120 | /> | 123 | /> |
121 | } | 124 | } |