Skip to content

Commit

Permalink
fix: made top-level compoinent into button
Browse files Browse the repository at this point in the history
  • Loading branch information
numbap committed Feb 17, 2023
1 parent 84b84c3 commit 60d66cd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { Image } from "../Image/Image";
export function Button(props) {
const style = "ds-btn-" + props.styling;
return props.href === "no ref" ? (
<div
role="button"
tabIndex={0}
onKeyUp={props.onClick}
<button
className={`ds-flex ds-flex-row ${style} focus:ds-ring focus:ds-ring-offset-4 ${props.className} `}
onClick={props.onClick}
type={props.type}
Expand All @@ -17,18 +14,18 @@ export function Button(props) {
{...props.attributes}
>
{props.icon && !props.iconEnd ? (
<div className="ds-grid ds-place-items-center ds-h-8 ds-w-8">
<span className="ds-grid ds-place-items-center ds-h-8 ds-w-8">
<Image className="ds-pr-2" src={props.icon} alt={props.iconAltText} />
</div>
</span>
) : undefined}
{props.text}
{props.children}
{props.icon && props.iconEnd ? (
<div className="ds-grid ds-place-items-center ds-h-8 ds-w-8">
<span className="ds-grid ds-place-items-center ds-h-8 ds-w-8">
<Image className="ds-pl-2" src={props.icon} alt={props.iconAltText} />
</div>
</span>
) : undefined}
</div>
</button>
) : (
<a
href={props.href}
Expand Down

0 comments on commit 60d66cd

Please sign in to comment.