Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

fix(desktop): close settings from the pane header, not the section list

Luis Ortiz9cc7b8cf8185
diff --git a/apps/desktop/src/renderer/SettingsPanel.tsx b/apps/desktop/src/renderer/SettingsPanel.tsx
index da13560..818a8ba 100644
--- a/apps/desktop/src/renderer/SettingsPanel.tsx
+++ b/apps/desktop/src/renderer/SettingsPanel.tsx
@@ -3,6 +3,7 @@ import { i18n } from '@mimik/core/env';
import { CURSOR_STYLES } from '@mimik/core/screenshot/types';
import AiSettings from '@mimik/ui/shared/AiSettings';
import { useKeyCheck } from '@mimik/ui/shared/key-status';
+import { X } from 'lucide-react';
import { useEffect, useState } from 'react';
import type { CaptureSettings, CaptureShortcuts } from '../main/capture/settings';
import ShortcutRecorder from './ShortcutRecorder';
@@ -83,17 +84,24 @@ export default function SettingsPanel({ onClose }: { onClose(): void }) {
{i18n.t(item.labelKey)}
</button>
))}
- <button
- type="button"
- onClick={onClose}
- className="mt-3 flex h-9 w-full items-center rounded-[9px] px-3 text-left text-sm text-muted-foreground hover:bg-secondary/60"
- >
- {i18n.t('common_close')}
- </button>
</nav>
<div className="min-w-0 flex-1 overflow-y-auto px-10 py-8">
<div className="mx-auto flex max-w-[640px] flex-col gap-5">
+ <div className="flex items-center border-b border-secondary pb-4">
+ <h2 className="mr-auto text-base font-semibold text-foreground">
+ {i18n.t(SECTIONS.find((item) => item.id === section)?.labelKey ?? 'settings_title')}
+ </h2>
+ <button
+ type="button"
+ aria-label={i18n.t('common_close')}
+ onClick={onClose}
+ className="rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"
+ >
+ <X size={17} />
+ </button>
+ </div>
+
{section === 'ai' && <AiSettings keyCheck={keyCheck} />}
{section === 'capture' && settings && (