Skip to content

Commit 9b8a5d0

Browse files
committed
change UX for host permission
1 parent 2f84357 commit 9b8a5d0

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/popup/main.tsx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,24 @@ const Popup = () => {
171171
>
172172
Codecov
173173
</a>
174-
<button
175-
onClick={handleSave}
176-
disabled={isDone || isFormInvalid || isError}
177-
className="btn btn-ghost text-white"
178-
>
179-
{isDone ? "Done" : isError ? "Error" : "Save"}
180-
</button>
174+
<div className="space-x-2">
175+
{useSelfHosted && !isDone && (
176+
<button
177+
onClick={requestHostPermission}
178+
disabled={isUrlPermissionGranted}
179+
className="btn btn-ghost text-white"
180+
>
181+
Grant Permission
182+
</button>
183+
)}
184+
<button
185+
onClick={handleSave}
186+
disabled={isDone || isFormInvalid || isError}
187+
className="btn btn-ghost text-white"
188+
>
189+
{isDone ? "Done" : isError ? "Error" : "Save"}
190+
</button>
191+
</div>
181192
{/*<div className="pr-4">*/}
182193
{/* <FontAwesomeIcon icon={faCircleNotch} spin color="white" size="xl" />*/}
183194
{/*</div>*/}
@@ -219,19 +230,7 @@ const Popup = () => {
219230
value={codecovUrl}
220231
onChange={handleTextChange(setCodecovUrl)}
221232
/>
222-
<button
223-
disabled={isUrlPermissionGranted}
224-
className="btn btn-square btn-ghost"
225-
onClick={requestHostPermission}
226-
>
227-
<FontAwesomeIcon icon={faSquareCheck} size="xl" />
228-
</button>
229233
</div>
230-
<label className="label">
231-
<span className="label-text-alt">
232-
You must click the checkbox and allow permissions
233-
</span>
234-
</label>
235234
{isUrlError && (
236235
<label className="label">
237236
<span className="label-text-alt text-red-500">

0 commit comments

Comments
 (0)