Skip to content

Commit

Permalink
feat(ClipboardButton): add view property (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raubzeug authored Feb 2, 2024
1 parent d52a7bd commit e316289
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/ClipboardButton/ClipboardButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import {Button} from '../Button';
import type {ButtonProps} from '../Button';
import type {ButtonProps, ButtonView} from '../Button';
import {ClipboardIcon} from '../ClipboardIcon';
import {CopyToClipboard} from '../CopyToClipboard';
import {CopyToClipboardStatus} from '../CopyToClipboard/types';
Expand All @@ -25,6 +25,8 @@ export interface ClipboardButtonProps
interface ClipboardButtonComponentProps extends QAProps {
/** Icon size in pixels */
size?: number;
/** View of a button */
view?: ButtonView;
/** Element CSS class */
className?: string;
status: CopyToClipboardStatus;
Expand All @@ -44,6 +46,7 @@ const DEFAULT_TIMEOUT = 1000;

const ClipboardButtonComponent = (props: ClipboardButtonComponentProps) => {
const {
view = 'flat',
size = DEFAULT_ICON_SIZE,
className,
qa,
Expand All @@ -68,10 +71,10 @@ const ClipboardButtonComponent = (props: ClipboardButtonComponentProps) => {
>
<Button
ref={buttonRef}
view="flat"
className={b(null, className)}
qa={qa}
onClick={onClick}
view={view}
>
<Button.Icon>
<ClipboardIcon status={status} size={size} className={b('icon')} />
Expand Down

0 comments on commit e316289

Please sign in to comment.