Skip to content

Commit 5e3b9bb

Browse files
committed
Improve UX of "runbook trust warning"
1 parent 07fbd59 commit 5e3b9bb

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

web/src/components/MDXContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function MDXContainer({ content, className }: MDXContainerProps) {
8888
<Admonition
8989
type="warning"
9090
title="**Make sure you trust this Runbook!**"
91-
confirmationText="I trust this Runbook and understand the security implications"
91+
confirmationText="I trust this Runbook"
9292
allowPermanentHide={true}
9393
storageKey="security-banner"
9494
>

web/src/components/mdx/Admonition/Admonition.tsx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,17 @@ export function Admonition({
143143
</div>
144144

145145
{confirmationText && (
146-
<div className="">
147-
<label className="flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity bg-gray-100 border border-gray-200 rounded-sm p-2 mt-2 -translate-x-2 w-fit text-gray-500">
148-
<input
149-
type="checkbox"
150-
checked={isConfirmed}
151-
onChange={(e) => handleConfirmationChange(e.target.checked)}
152-
className="cursor-pointer"
153-
/>
154-
<span className="text-sm">
155-
<InlineMarkdown>{confirmationText}</InlineMarkdown>
156-
</span>
157-
</label>
146+
<div className="mt-3">
147+
<button
148+
onClick={() => handleConfirmationChange(true)}
149+
disabled={isConfirmed}
150+
className="px-4 py-2 text-sm font-medium bg-yellow-600 text-white rounded-md hover:bg-yellow-700 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"
151+
>
152+
<InlineMarkdown>{confirmationText}</InlineMarkdown>
153+
</button>
158154

159155
{allowPermanentHide && storageKey && (
160-
<div className="mt-3 mb-1">
156+
<div className="mt-3">
161157
<label className={`flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity opacity-80`}>
162158
<input
163159
type="checkbox"

0 commit comments

Comments
 (0)