-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align add discount with rest links (#4958)
* Align add discount with rest links * Add changeset * Remove not used component * Add button link * Add changeset * Rm douplicated changeset
- Loading branch information
Showing
4 changed files
with
72 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
You can now see Add discount align with rest of content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Button, ButtonProps, vars } from "@saleor/macaw-ui-next"; | ||
import React from "react"; | ||
|
||
interface ButtonLinkProps extends ButtonProps { | ||
children: React.ReactNode; | ||
onClick?: React.MouseEventHandler; | ||
underline?: boolean; | ||
} | ||
|
||
export const ButtonLink = ({ | ||
children, | ||
disabled, | ||
onClick, | ||
underline, | ||
...props | ||
}: ButtonLinkProps) => { | ||
const color = disabled | ||
? vars.colors.text.defaultDisabled | ||
: vars.colors.text.accent1; | ||
|
||
const handleClick = (event: React.MouseEvent) => { | ||
if (disabled || !onClick) { | ||
return; | ||
} | ||
|
||
onClick(event); | ||
}; | ||
|
||
return ( | ||
<Button | ||
variant="tertiary" | ||
onClick={handleClick} | ||
__backgroundColor="transparent" | ||
textDecoration={{ | ||
default: underline ? "underline" : "none", | ||
hover: "underline", | ||
focus: "underline", | ||
}} | ||
cursor={disabled ? "not-allowed" : "pointer"} | ||
style={{ | ||
textUnderlineOffset: vars.spacing[1], | ||
padding: 0, | ||
color, | ||
fontWeight: 400, | ||
textDecorationColor: color, | ||
}} | ||
{...props} | ||
> | ||
{children} | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./ButtonLink"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters