-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Improve button link usage #5409
Changes from all commits
e1512c1
9a7810a
ab7a9d2
533995e
83dc7ab
c18da8f
d6ac6f1
3c27c32
b3361e5
44c7184
8a98959
85f2831
93ff830
90f6c88
fdd5bb1
137a9ba
532cdb2
f2dfd06
e710faf
3e24e0c
0caf343
b281eff
c07546e
907f37c
8afaa37
31ee6b0
8c49157
169761c
646ed3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,10 @@ strong { | |
cursor: pointer; | ||
} | ||
|
||
.clickable:disabled { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure there's an action to take, yet, but I have mixed feelings about this. Anything can take the classname There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about |
||
cursor: not-allowed; | ||
} | ||
|
||
.resize-vertical { | ||
resize: vertical !important; | ||
transition: height 0s !important; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
.edit-in-place span { | ||
.edit-in-place { | ||
white-space: pre-line; | ||
display: inline-block; | ||
|
||
p { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.edit-in-place span.editable { | ||
display: inline-block; | ||
cursor: pointer; | ||
} | ||
|
||
.edit-in-place span.editable:hover { | ||
background: @redash-yellow; | ||
border-radius: @redash-radius; | ||
} | ||
.editable { | ||
display: inline-block; | ||
cursor: pointer; | ||
|
||
.edit-in-place.active input, | ||
.edit-in-place.active textarea { | ||
display: inline-block; | ||
} | ||
&:hover { | ||
background: @redash-yellow; | ||
border-radius: @redash-radius; | ||
} | ||
} | ||
|
||
.edit-in-place { | ||
display: inline-block; | ||
&.active input, | ||
&.active textarea { | ||
display: inline-block; | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import Button, { ButtonProps as AntdButtonProps } from "antd/lib/button"; | ||
|
||
interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "role"> { | ||
href: string; | ||
} | ||
|
||
interface ButtonProps extends AntdButtonProps { | ||
href: string; | ||
} | ||
|
||
function DefaultLinkComponent({ children, ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>) { | ||
return <a {...props}>{children}</a>; | ||
} | ||
|
||
Link.Component = DefaultLinkComponent; | ||
|
||
function Link({ tabIndex = 0, ...props }: LinkProps) { | ||
return <Link.Component tabIndex={tabIndex} {...props} />; | ||
} | ||
|
||
// Ant Button will render an <a> if href is present. | ||
function DefaultButtonLinkComponent(props: ButtonProps) { | ||
return <Button {...props} />; | ||
} | ||
|
||
ButtonLink.Component = DefaultButtonLinkComponent; | ||
|
||
function ButtonLink(props: ButtonProps) { | ||
return <ButtonLink.Component {...props} />; | ||
} | ||
|
||
Link.Button = ButtonLink; | ||
|
||
export default Link; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaving a comment here so we can keep a discussion in the thread.
Is there any chance we can break this PR into even smaller PRs? It looks like there are quite a few styling changes, as well as component updates. I'm having trouble determining how best to QA / ensure there are no regressions.
Do you have another proposal? I don't want to stonewall you or anything, but I don want to make sure I can limit the number of iterations / time spent verifying changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's complicated. I did think about it, but the thing is that this PR resulted in a lot of visual changes, which I had to solve in order to be mergeable. What is sort of possible but somewhat weird is having the fixes for those in master before we merge it. LMK what is your opinion on that.
An alternative is to review those last commits primarily, since they are where the styling changes are amassed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we just did one button type at a time?