Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
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
vicotor
frontend
Commits
38ad4c79
Commit
38ad4c79
authored
Sep 09, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor button theme
parent
b9b8ee0d
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
92 additions
and
57 deletions
+92
-57
Button.ts
theme/components/Button.ts
+85
-37
ApiKeyForm.tsx
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
+0
-1
ProfileMenuContent.tsx
ui/blocks/profileMenu/ProfileMenuContent.tsx
+1
-1
CustomAbiForm.tsx
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
+0
-1
ApiKeys.tsx
ui/pages/ApiKeys.tsx
+0
-1
CustomAbi.tsx
ui/pages/CustomAbi.tsx
+0
-1
Watchlist.tsx
ui/pages/Watchlist.tsx
+0
-1
AddressForm.tsx
ui/privateTags/AddressModal/AddressForm.tsx
+0
-1
PrivateAddressTags.tsx
ui/privateTags/PrivateAddressTags.tsx
+0
-1
PrivateTransactionTags.tsx
ui/privateTags/PrivateTransactionTags.tsx
+0
-1
TransactionForm.tsx
ui/privateTags/TransactionModal/TransactionForm.tsx
+0
-1
PublicTagsData.tsx
ui/publicTags/PublicTagsData.tsx
+0
-1
PublicTagFormAddressInput.tsx
ui/publicTags/PublicTagsForm/PublicTagFormAddressInput.tsx
+2
-2
PublicTagsForm.tsx
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
+1
-2
CopyToClipboard.tsx
ui/shared/CopyToClipboard.tsx
+1
-1
DeleteModal.tsx
ui/shared/DeleteModal.tsx
+0
-1
TableItemActionButtons.tsx
ui/shared/TableItemActionButtons.tsx
+2
-2
AddressForm.tsx
ui/watchlist/AddressModal/AddressForm.tsx
+0
-1
No files found.
theme/components/Button.ts
View file @
38ad4c79
import
{
defineStyle
,
defineStyleConfig
}
from
'
@chakra-ui/styled-system
'
;
import
{
defineStyle
,
defineStyleConfig
}
from
'
@chakra-ui/styled-system
'
;
import
{
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
{
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
{
runIfFn
}
from
'
@chakra-ui/utils
'
;
const
variantPrimary
=
defineStyle
({
const
variantSolid
=
defineStyle
((
props
)
=>
{
bg
:
'
blue.600
'
,
const
{
colorScheme
:
c
}
=
props
;
color
:
'
white
'
,
fontWeight
:
600
,
if
(
c
===
'
gray
'
)
{
_hover
:
{
const
bg
=
mode
(
`gray.100`
,
`whiteAlpha.200`
)(
props
);
bg
:
'
blue.400
'
,
return
{
bg
,
_hover
:
{
bg
:
mode
(
`gray.200`
,
`whiteAlpha.300`
)(
props
),
_disabled
:
{
bg
,
},
},
_active
:
{
bg
:
mode
(
`gray.300`
,
`whiteAlpha.400`
)(
props
)
},
};
}
const
bg
=
`
${
c
}
.600`
;
const
color
=
'
white
'
;
const
hoverBg
=
`
${
c
}
.400`
;
const
activeBg
=
`
${
c
}
.700`
;
return
{
bg
,
color
,
_hover
:
{
bg
:
hoverBg
,
_disabled
:
{
bg
,
},
},
_disabled
:
{
_disabled
:
{
bg
:
'
blue.600
'
,
opacity
:
0.2
,
},
},
},
_active
:
{
bg
:
activeBg
},
_disabled
:
{
fontWeight
:
600
,
opacity
:
0.2
,
};
},
});
});
const
variantSecondary
=
defineStyle
((
props
)
=>
{
const
variantOutline
=
defineStyle
((
props
)
=>
{
const
{
colorScheme
:
c
}
=
props
;
const
isGrayTheme
=
c
===
'
gray
'
||
c
===
'
gray-dark
'
;
const
color
=
isGrayTheme
?
mode
(
'
blackAlpha.800
'
,
'
whiteAlpha.800
'
)(
props
)
:
mode
(
`
${
c
}
.600`
,
`
${
c
}
.300`
)(
props
);
const
borderColor
=
isGrayTheme
?
mode
(
'
gray.200
'
,
'
gray.600
'
)(
props
)
:
mode
(
`
${
c
}
.600`
,
`
${
c
}
.300`
)(
props
);
const
activeBg
=
isGrayTheme
?
mode
(
'
blue.50
'
,
'
gray.600
'
)(
props
)
:
mode
(
`
${
c
}
.50`
,
'
gray.600
'
)(
props
);
const
activeColor
=
(()
=>
{
if
(
c
===
'
gray
'
)
{
return
mode
(
'
blue.400
'
,
'
gray.50
'
)(
props
);
}
if
(
c
===
'
gray-dark
'
)
{
return
mode
(
'
blue.700
'
,
'
gray.50
'
)(
props
);
}
return
'
blue.400
'
;
})();
return
{
return
{
color
:
mode
(
'
blue.600
'
,
'
blue.300
'
)(
props
),
color
,
fontWeight
:
600
,
fontWeight
:
props
.
fontWeight
||
600
,
borderColor
:
mode
(
'
blue.600
'
,
'
blue.300
'
)(
props
),
borderWidth
:
props
.
borderWidth
||
'
2px
'
,
border
:
'
2px solid
'
,
borderStyle
:
'
solid
'
,
borderColor
,
bg
:
'
transparent
'
,
_hover
:
{
_hover
:
{
color
:
'
blue.400
'
,
color
:
'
blue.400
'
,
borderColor
:
'
blue.400
'
,
borderColor
:
'
blue.400
'
,
bg
:
'
transparent
'
,
_active
:
{
bg
:
props
.
isActive
?
activeBg
:
'
transparent
'
,
borderColor
:
props
.
isActive
?
activeBg
:
'
blue.400
'
,
color
:
props
.
isActive
?
activeColor
:
'
blue.400
'
,
},
},
},
_disabled
:
{
_disabled
:
{
opacity
:
0.2
,
opacity
:
0.2
,
},
},
_active
:
{
bg
:
activeBg
,
borderColor
:
activeBg
,
color
:
activeColor
,
},
};
};
});
});
const
variantIcon
=
defineStyle
((
props
)
=>
{
const
variantSimple
=
defineStyle
((
props
)
=>
{
const
outline
=
runIfFn
(
variantOutline
,
props
);
return
{
return
{
color
:
mode
(
'
blue.600
'
,
'
blue.300
'
)(
props
)
,
color
:
outline
.
color
,
_hover
:
{
_hover
:
{
color
:
mode
(
'
blue.400
'
,
'
blue.200
'
)(
props
)
,
color
:
outline
.
_hover
.
color
,
},
},
};
};
});
});
const
variantIconBorder
=
defineStyle
({
color
:
'
blue.600
'
,
borderColor
:
'
blue.600
'
,
border
:
'
2px solid
'
,
_hover
:
{
color
:
'
blue.400
'
,
borderColor
:
'
blue.400
'
,
},
_disabled
:
{
opacity
:
0.2
,
},
});
const
variants
=
{
const
variants
=
{
primary
:
variantPrimary
,
solid
:
variantSolid
,
secondary
:
variantSecondary
,
outline
:
variantOutline
,
icon
:
variantIcon
,
simple
:
variantSimple
,
iconBorder
:
variantIconBorder
,
};
};
const
baseStyle
=
defineStyle
({
const
baseStyle
=
defineStyle
({
fontWeight
:
'
normal
'
,
fontWeight
:
600
,
borderRadius
:
'
base
'
,
borderRadius
:
'
base
'
,
});
});
...
@@ -97,6 +140,11 @@ const Button = defineStyleConfig({
...
@@ -97,6 +140,11 @@ const Button = defineStyleConfig({
baseStyle
,
baseStyle
,
variants
,
variants
,
sizes
,
sizes
,
defaultProps
:
{
variant
:
'
solid
'
,
size
:
'
md
'
,
colorScheme
:
'
blue
'
,
},
});
});
export
default
Button
;
export
default
Button
;
ui/apiKey/ApiKeyModal/ApiKeyForm.tsx
View file @
38ad4c79
...
@@ -142,7 +142,6 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
...
@@ -142,7 +142,6 @@ const ApiKeyForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
!
isValid
}
disabled=
{
!
isValid
}
isLoading=
{
mutation
.
isLoading
}
isLoading=
{
mutation
.
isLoading
}
...
...
ui/blocks/profileMenu/ProfileMenuContent.tsx
View file @
38ad4c79
...
@@ -40,7 +40,7 @@ const ProfileMenuContent = ({ name, nickname, email }: Props) => {
...
@@ -40,7 +40,7 @@ const ProfileMenuContent = ({ name, nickname, email }: Props) => {
</
VStack
>
</
VStack
>
</
Box
>
</
Box
>
<
Box
mt=
{
2
}
pt=
{
3
}
borderTopColor=
{
borderColor
}
borderTopWidth=
"1px"
{
...
getDefaultTransitionProps
()
}
>
<
Box
mt=
{
2
}
pt=
{
3
}
borderTopColor=
{
borderColor
}
borderTopWidth=
"1px"
{
...
getDefaultTransitionProps
()
}
>
<
Button
size=
"sm"
width=
"full"
variant=
"
secondary
"
>
Sign Out
</
Button
>
<
Button
size=
"sm"
width=
"full"
variant=
"
outline
"
>
Sign Out
</
Button
>
</
Box
>
</
Box
>
</
Box
>
</
Box
>
);
);
...
...
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
View file @
38ad4c79
...
@@ -168,7 +168,6 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
...
@@ -168,7 +168,6 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
!
isValid
}
disabled=
{
!
isValid
}
isLoading=
{
mutation
.
isLoading
}
isLoading=
{
mutation
.
isLoading
}
...
...
ui/pages/ApiKeys.tsx
View file @
38ad4c79
...
@@ -106,7 +106,6 @@ const ApiKeysPage: React.FC = () => {
...
@@ -106,7 +106,6 @@ const ApiKeysPage: React.FC = () => {
{
Boolean
(
data
.
length
)
&&
list
}
{
Boolean
(
data
.
length
)
&&
list
}
<
Stack
marginTop=
{
8
}
spacing=
{
5
}
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Stack
marginTop=
{
8
}
spacing=
{
5
}
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
apiKeyModalProps
.
onOpen
}
onClick=
{
apiKeyModalProps
.
onOpen
}
disabled=
{
!
canAdd
}
disabled=
{
!
canAdd
}
...
...
ui/pages/CustomAbi.tsx
View file @
38ad4c79
...
@@ -100,7 +100,6 @@ const CustomAbiPage: React.FC = () => {
...
@@ -100,7 +100,6 @@ const CustomAbiPage: React.FC = () => {
{
data
.
length
>
0
&&
list
}
{
data
.
length
>
0
&&
list
}
<
HStack
marginTop=
{
8
}
spacing=
{
5
}
>
<
HStack
marginTop=
{
8
}
spacing=
{
5
}
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
customAbiModalProps
.
onOpen
}
onClick=
{
customAbiModalProps
.
onOpen
}
>
>
...
...
ui/pages/Watchlist.tsx
View file @
38ad4c79
...
@@ -97,7 +97,6 @@ const WatchList: React.FC = () => {
...
@@ -97,7 +97,6 @@ const WatchList: React.FC = () => {
{
Boolean
(
data
?.
length
)
&&
list
}
{
Boolean
(
data
?.
length
)
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
addressModalProps
.
onOpen
}
onClick=
{
addressModalProps
.
onOpen
}
>
>
...
...
ui/privateTags/AddressModal/AddressForm.tsx
View file @
38ad4c79
...
@@ -117,7 +117,6 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
...
@@ -117,7 +117,6 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
!
isValid
}
disabled=
{
!
isValid
}
isLoading=
{
pending
}
isLoading=
{
pending
}
...
...
ui/privateTags/PrivateAddressTags.tsx
View file @
38ad4c79
...
@@ -99,7 +99,6 @@ const PrivateAddressTags = () => {
...
@@ -99,7 +99,6 @@ const PrivateAddressTags = () => {
{
Boolean
(
addressTagsData
?.
length
)
&&
list
}
{
Boolean
(
addressTagsData
?.
length
)
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
addressModalProps
.
onOpen
}
onClick=
{
addressModalProps
.
onOpen
}
>
>
...
...
ui/privateTags/PrivateTransactionTags.tsx
View file @
38ad4c79
...
@@ -99,7 +99,6 @@ const PrivateTransactionTags = () => {
...
@@ -99,7 +99,6 @@ const PrivateTransactionTags = () => {
{
Boolean
(
transactionTagsData
.
length
)
&&
list
}
{
Boolean
(
transactionTagsData
.
length
)
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
transactionModalProps
.
onOpen
}
onClick=
{
transactionModalProps
.
onOpen
}
>
>
...
...
ui/privateTags/TransactionModal/TransactionForm.tsx
View file @
38ad4c79
...
@@ -116,7 +116,6 @@ const TransactionForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) =>
...
@@ -116,7 +116,6 @@ const TransactionForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) =>
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
!
isValid
}
disabled=
{
!
isValid
}
isLoading=
{
pending
}
isLoading=
{
pending
}
...
...
ui/publicTags/PublicTagsData.tsx
View file @
38ad4c79
...
@@ -95,7 +95,6 @@ const PublicTagsData = ({ changeToFormScreen, onTagDelete }: Props) => {
...
@@ -95,7 +95,6 @@ const PublicTagsData = ({ changeToFormScreen, onTagDelete }: Props) => {
{
data
.
length
>
0
&&
list
}
{
data
.
length
>
0
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
changeToForm
}
onClick=
{
changeToForm
}
>
>
...
...
ui/publicTags/PublicTagsForm/PublicTagFormAddressInput.tsx
View file @
38ad4c79
...
@@ -55,7 +55,7 @@ export default function PublicTagFormAction({ control, index, fieldsLength, erro
...
@@ -55,7 +55,7 @@ export default function PublicTagFormAction({ control, index, fieldsLength, erro
{
fieldsLength
>
1
&&
(
{
fieldsLength
>
1
&&
(
<
IconButton
<
IconButton
aria
-
label=
"delete"
aria
-
label=
"delete"
variant=
"
iconBorder
"
variant=
"
outline
"
w=
"30px"
w=
"30px"
h=
"30px"
h=
"30px"
onClick=
{
onRemoveFieldClick
(
index
)
}
onClick=
{
onRemoveFieldClick
(
index
)
}
...
@@ -65,7 +65,7 @@ export default function PublicTagFormAction({ control, index, fieldsLength, erro
...
@@ -65,7 +65,7 @@ export default function PublicTagFormAction({ control, index, fieldsLength, erro
{
index
===
fieldsLength
-
1
&&
fieldsLength
<
MAX_INPUTS_NUM
&&
(
{
index
===
fieldsLength
-
1
&&
fieldsLength
<
MAX_INPUTS_NUM
&&
(
<
IconButton
<
IconButton
aria
-
label=
"add"
aria
-
label=
"add"
variant=
"
iconBorder
"
variant=
"
outline
"
w=
"30px"
w=
"30px"
h=
"30px"
h=
"30px"
onClick=
{
onAddFieldClick
}
onClick=
{
onAddFieldClick
}
...
...
ui/publicTags/PublicTagsForm/PublicTagsForm.tsx
View file @
38ad4c79
...
@@ -231,7 +231,6 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
...
@@ -231,7 +231,6 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
<
HStack
spacing=
{
6
}
>
<
HStack
spacing=
{
6
}
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
onClick=
{
handleSubmit
(
onSubmit
)
}
disabled=
{
!
isValid
}
disabled=
{
!
isValid
}
isLoading=
{
mutation
.
isLoading
}
isLoading=
{
mutation
.
isLoading
}
...
@@ -240,7 +239,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
...
@@ -240,7 +239,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
</
Button
>
</
Button
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"
secondary
"
variant=
"
outline
"
onClick=
{
changeToData
}
onClick=
{
changeToData
}
disabled=
{
mutation
.
isLoading
}
disabled=
{
mutation
.
isLoading
}
>
>
...
...
ui/shared/CopyToClipboard.tsx
View file @
38ad4c79
...
@@ -22,7 +22,7 @@ const CopyToClipboard = ({ text }: {text: string}) => {
...
@@ -22,7 +22,7 @@ const CopyToClipboard = ({ text }: {text: string}) => {
icon=
{
<
CopyIcon
/>
}
icon=
{
<
CopyIcon
/>
}
w=
"20px"
w=
"20px"
h=
"20px"
h=
"20px"
variant=
"
icon
"
variant=
"
simple
"
display=
"inline-block"
display=
"inline-block"
flexShrink=
{
0
}
flexShrink=
{
0
}
onClick=
{
onCopy
}
onClick=
{
onCopy
}
...
...
ui/shared/DeleteModal.tsx
View file @
38ad4c79
...
@@ -65,7 +65,6 @@ const DeleteModal: React.FC<Props> = ({
...
@@ -65,7 +65,6 @@ const DeleteModal: React.FC<Props> = ({
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
<
Button
variant=
"primary"
size=
"lg"
size=
"lg"
onClick=
{
onDeleteClick
}
onClick=
{
onDeleteClick
}
isLoading=
{
mutation
.
isLoading
}
isLoading=
{
mutation
.
isLoading
}
...
...
ui/shared/TableItemActionButtons.tsx
View file @
38ad4c79
...
@@ -18,7 +18,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick }: Props) => {
...
@@ -18,7 +18,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick }: Props) => {
<
Tooltip
label=
"Edit"
>
<
Tooltip
label=
"Edit"
>
<
IconButton
<
IconButton
aria
-
label=
"edit"
aria
-
label=
"edit"
variant=
"
icon
"
variant=
"
simple
"
w=
"30px"
w=
"30px"
h=
"30px"
h=
"30px"
onClick=
{
onEditClick
}
onClick=
{
onEditClick
}
...
@@ -29,7 +29,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick }: Props) => {
...
@@ -29,7 +29,7 @@ const TableItemActionButtons = ({ onEditClick, onDeleteClick }: Props) => {
<
Tooltip
label=
"Delete"
>
<
Tooltip
label=
"Delete"
>
<
IconButton
<
IconButton
aria
-
label=
"delete"
aria
-
label=
"delete"
variant=
"
icon
"
variant=
"
simple
"
w=
"30px"
w=
"30px"
h=
"30px"
h=
"30px"
onClick=
{
onDeleteClick
}
onClick=
{
onDeleteClick
}
...
...
ui/watchlist/AddressModal/AddressForm.tsx
View file @
38ad4c79
...
@@ -187,7 +187,6 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
...
@@ -187,7 +187,6 @@ const AddressForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
size=
"lg"
size=
"lg"
variant=
"primary"
onClick=
{
handleSubmit
(
onSubmit
)
}
onClick=
{
handleSubmit
(
onSubmit
)
}
isLoading=
{
pending
}
isLoading=
{
pending
}
disabled=
{
!
isValid
}
disabled=
{
!
isValid
}
...
...
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