Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/components/custom/email-content-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Kbd, KbdGroup } from '@/components/ui/kbd';
import { useHasKeyboard } from '@/hooks/use-has-keyboard';
import { useModifierKeys } from '@/hooks/use-modifier-keys';
import { sampleEmailHtml } from '@/lib/sample-email-html';
import { cn } from '@/lib/utils';

type EmailInputProps = {
placeholder?: string;
Expand Down Expand Up @@ -87,9 +88,14 @@ export function EmailContentInput({ onChange, placeholder = 'Paste your HTML ema
onClick={fillSample}
tooltip="Fill input with sample email HTML for quick compatibility preview"
aria-label="Fill input with sample email HTML for quick compatibility preview"
className={cn('space-x-0.5 transition-colors', isFocused && hasKeyboard && 'pl-1.5')}
>
{isFocused && hasKeyboard && (
<KbdGroup className="mr-2">
<KbdGroup
onClick={() => {
return fillSample();
}}
>
<Kbd>{mod}</Kbd>
<Kbd>{shift}</Kbd>
<Kbd>E</Kbd>
Expand All @@ -111,13 +117,15 @@ export function EmailContentInput({ onChange, placeholder = 'Paste your HTML ema
onFocus={() => {
return setIsFocused(true);
}}
onBlur={() => {
return setIsFocused(false);
}}
style={{
fontSize: '13px',
height: '100%',
}}
onBlur={() => {
return setTimeout(() => {
return setIsFocused(false);
}, 200);
}}
basicSetup={{
autocompletion: true,
bracketMatching: true,
Expand Down
13 changes: 11 additions & 2 deletions src/components/custom/tooltip-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ type TooltipButtonProps = {
tooltip: string;
onClick: () => void;
onMouseEnter?: () => void;
} & Pick<ComponentProps<typeof Button>, 'variant' | 'size' | 'disabled' | 'aria-label'>;
} & Pick<ComponentProps<typeof Button>, 'variant' | 'size' | 'disabled' | 'aria-label' | 'className'>;

export function TooltipButton({
'aria-label': ariaLabel = '',
children,
className = '',
delayDuration = 500,
disabled = false,
onClick,
Expand All @@ -28,7 +29,15 @@ export function TooltipButton({
return (
<Tooltip delayDuration={delayDuration}>
<TooltipTrigger asChild onMouseEnter={onMouseEnter}>
<Button ref={ref} size={size} variant={variant} onClick={onClick} disabled={disabled} aria-label={ariaLabel}>
<Button
ref={ref}
size={size}
variant={variant}
onClick={onClick}
disabled={disabled}
className={className}
aria-label={ariaLabel}
>
{children}
</Button>
</TooltipTrigger>
Expand Down