Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
da8884d8
Unverified
Commit
da8884d8
authored
Feb 15, 2022
by
Zach Pomerantz
Committed by
GitHub
Feb 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: action prop warning (#3304)
parent
79bdc0c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ActionButton.tsx
src/lib/components/ActionButton.tsx
+3
-3
No files found.
src/lib/components/ActionButton.tsx
View file @
da8884d8
...
@@ -45,13 +45,13 @@ const actionCss = css`
...
@@ -45,13 +45,13 @@ const actionCss = css`
}
}
`
`
export
const
Overlay
=
styled
(
Row
)
<
{
action
?
:
boolean
}
>
`
export
const
Overlay
=
styled
(
Row
)
<
{
hasAction
:
boolean
}
>
`
border-radius:
${({
theme
})
=>
theme
.
borderRadius
}
em;
border-radius:
${({
theme
})
=>
theme
.
borderRadius
}
em;
flex-direction: row-reverse;
flex-direction: row-reverse;
min-height: 3.5em;
min-height: 3.5em;
transition: padding 0.25s ease-out;
transition: padding 0.25s ease-out;
${({
action
})
=>
a
ction
&&
actionCss
}
${({
hasAction
})
=>
hasA
ction
&&
actionCss
}
`
`
export
interface
Action
{
export
interface
Action
{
...
@@ -72,7 +72,7 @@ export interface ActionButtonProps {
...
@@ -72,7 +72,7 @@ export interface ActionButtonProps {
export
default
function
ActionButton
({
color
=
'
accent
'
,
disabled
,
action
,
onClick
,
children
}:
ActionButtonProps
)
{
export
default
function
ActionButton
({
color
=
'
accent
'
,
disabled
,
action
,
onClick
,
children
}:
ActionButtonProps
)
{
const
textColor
=
useMemo
(()
=>
(
color
===
'
accent
'
&&
!
disabled
?
'
onAccent
'
:
'
currentColor
'
),
[
color
,
disabled
])
const
textColor
=
useMemo
(()
=>
(
color
===
'
accent
'
&&
!
disabled
?
'
onAccent
'
:
'
currentColor
'
),
[
color
,
disabled
])
return
(
return
(
<
Overlay
a
ction=
{
Boolean
(
action
)
}
flex
align=
"stretch"
>
<
Overlay
hasA
ction=
{
Boolean
(
action
)
}
flex
align=
"stretch"
>
<
StyledButton
color=
{
color
}
disabled=
{
disabled
}
onClick=
{
action
?
action
.
onClick
:
onClick
}
>
<
StyledButton
color=
{
color
}
disabled=
{
disabled
}
onClick=
{
action
?
action
.
onClick
:
onClick
}
>
<
ThemedText
.
TransitionButton
buttonSize=
{
action
?
'
medium
'
:
'
large
'
}
color=
{
textColor
}
>
<
ThemedText
.
TransitionButton
buttonSize=
{
action
?
'
medium
'
:
'
large
'
}
color=
{
textColor
}
>
{
action
?
action
.
children
:
children
}
{
action
?
action
.
children
:
children
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment