Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[To delete]: New results dynamic link for testing #1097

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion components/Forms/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ interface ButtonProps {
style: 'primary' | 'secondary' | 'supertask' | 'danger' | 'link'
custom?: string
href?: string
imgHref?: string
text: string
type?: ButtonType
locale?: string
onClick?: React.MouseEventHandler<HTMLButtonElement>
disabled?: boolean
ariaLabel?: string
attributes?: any
alt?: string
}

type ButtonType = 'submit' | 'reset' | 'button'
Expand All @@ -32,13 +34,15 @@ export const Button: React.FC<ButtonProps> = ({
style,
custom = '',
href,
imgHref,
text,
type = 'button',
locale,
onClick,
disabled,
ariaLabel,
attributes,
alt = 'Image alt',
}) => {
const btnStyle = BUTTON_STYLES[style]

Expand All @@ -47,7 +51,7 @@ export const Button: React.FC<ButtonProps> = ({
return href ? (
<Link href={href} locale={locale}>
<a className={classes} aria-label={ariaLabel} {...attributes}>
{text}
{imgHref && <img src={imgHref} alt={alt} className="pr-3" />} {text}
</a>
</Link>
) : (
Expand All @@ -60,6 +64,7 @@ export const Button: React.FC<ButtonProps> = ({
aria-label={ariaLabel}
{...attributes}
>
{imgHref && <img src={imgHref} alt={alt} className="pr-3" />}
{text}
</button>
)
Expand Down
Loading
Loading