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
ed382509
Commit
ed382509
authored
Sep 08, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag refactor
parent
f28efafa
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
23 deletions
+78
-23
Badge.ts
theme/components/Badge.ts
+40
-0
Tag.ts
theme/components/Tag.ts
+28
-15
index.ts
theme/components/index.ts
+2
-0
AddressTagListItem.tsx
ui/privateTags/AddressTagTable/AddressTagListItem.tsx
+1
-1
AddressTagTableItem.tsx
ui/privateTags/AddressTagTable/AddressTagTableItem.tsx
+1
-1
TransactionTagListItem.tsx
...rivateTags/TransactionTagTable/TransactionTagListItem.tsx
+1
-1
TransactionTagTableItem.tsx
...ivateTags/TransactionTagTable/TransactionTagTableItem.tsx
+1
-1
PublicTagListItem.tsx
ui/publicTags/PublicTagTable/PublicTagListItem.tsx
+1
-1
PublicTagTableItem.tsx
ui/publicTags/PublicTagTable/PublicTagTableItem.tsx
+1
-1
WatchListItem.tsx
ui/watchlist/WatchlistTable/WatchListItem.tsx
+1
-1
WatchListTableItem.tsx
ui/watchlist/WatchlistTable/WatchListTableItem.tsx
+1
-1
No files found.
theme/components/Badge.ts
0 → 100644
View file @
ed382509
import
{
defineStyle
,
defineStyleConfig
}
from
'
@chakra-ui/styled-system
'
;
import
{
mode
,
transparentize
}
from
'
@chakra-ui/theme-tools
'
;
const
baseStyle
=
defineStyle
({
fontSize
:
'
xs
'
,
borderRadius
:
'
sm
'
,
fontWeight
:
'
bold
'
,
});
const
variantSubtle
=
defineStyle
((
props
)
=>
{
const
{
colorScheme
:
c
,
theme
}
=
props
;
const
darkBg
=
transparentize
(
`
${
c
}
.200`
,
0.16
)(
theme
);
if
(
c
===
'
gray
'
)
{
return
{
bg
:
mode
(
'
blackAlpha.100
'
,
'
whiteAlpha.400
'
)(
props
),
color
:
mode
(
'
gray.600
'
,
'
gray.50
'
)(
props
),
};
}
return
{
bg
:
mode
(
`
${
c
}
.50`
,
darkBg
)(
props
),
color
:
mode
(
`
${
c
}
.500`
,
`
${
c
}
.200`
)(
props
),
};
});
const
variants
=
{
subtle
:
variantSubtle
,
};
const
Badge
=
defineStyleConfig
({
baseStyle
,
variants
,
defaultProps
:
{
variant
:
'
subtle
'
,
colorScheme
:
'
gray
'
,
},
});
export
default
Badge
;
theme/components/Tag.ts
View file @
ed382509
...
@@ -3,34 +3,41 @@ import {
...
@@ -3,34 +3,41 @@ import {
createMultiStyleConfigHelpers
,
createMultiStyleConfigHelpers
,
defineStyle
,
defineStyle
,
}
from
'
@chakra-ui/styled-system
'
;
}
from
'
@chakra-ui/styled-system
'
;
import
{
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
getDefaultTransitionProps
from
'
../utils/getDefaultTransitionProps
'
;
import
Badge
from
'
./Badge
'
;
const
transitionProps
=
getDefaultTransitionProps
();
const
{
defineMultiStyleConfig
,
definePartsStyle
}
=
const
{
defineMultiStyleConfig
,
definePartsStyle
}
=
createMultiStyleConfigHelpers
(
parts
.
keys
);
createMultiStyleConfigHelpers
(
parts
.
keys
);
import
getDefaultTransitionProps
from
'
../utils/getDefaultTransitionProps
'
;
const
variants
=
{
subtle
:
definePartsStyle
((
props
)
=>
({
const
variantGray
=
definePartsStyle
((
props
)
=>
{
container
:
Badge
.
variants
?.
subtle
(
props
),
const
transitionProps
=
getDefaultTransitionProps
();
})),
};
return
{
const
sizes
=
{
md
:
definePartsStyle
({
container
:
{
container
:
{
bg
:
mode
(
'
blackAlpha.100
'
,
'
whiteAlpha.400
'
)(
props
),
minH
:
6
,
color
:
mode
(
'
gray.600
'
,
'
gray.50
'
)(
props
),
minW
:
6
,
...
transitionProps
,
fontSize
:
'
sm
'
,
px
:
2
,
py
:
'
2px
'
,
},
},
};
label
:
{
});
lineHeight
:
5
,
},
const
variants
=
{
}),
gray
:
variantGray
,
};
};
const
baseStyleContainer
=
defineStyle
({
const
baseStyleContainer
=
defineStyle
({
display
:
'
inline-
block
'
,
display
:
'
inline-
flex
'
,
overflow
:
'
hidden
'
,
overflow
:
'
hidden
'
,
textOverflow
:
'
ellipsis
'
,
textOverflow
:
'
ellipsis
'
,
borderRadius
:
'
sm
'
,
borderRadius
:
'
sm
'
,
...
transitionProps
,
});
});
const
baseStyle
=
definePartsStyle
({
const
baseStyle
=
definePartsStyle
({
...
@@ -40,6 +47,12 @@ const baseStyle = definePartsStyle({
...
@@ -40,6 +47,12 @@ const baseStyle = definePartsStyle({
const
Tag
=
defineMultiStyleConfig
({
const
Tag
=
defineMultiStyleConfig
({
baseStyle
,
baseStyle
,
variants
,
variants
,
sizes
,
defaultProps
:
{
size
:
'
md
'
,
variant
:
'
subtle
'
,
colorScheme
:
'
gray
'
,
},
});
});
export
default
Tag
;
export
default
Tag
;
theme/components/index.ts
View file @
ed382509
import
Alert
from
'
./Alert
'
;
import
Alert
from
'
./Alert
'
;
import
Badge
from
'
./Badge
'
;
import
Button
from
'
./Button
'
;
import
Button
from
'
./Button
'
;
import
Checkbox
from
'
./Checkbox
'
;
import
Checkbox
from
'
./Checkbox
'
;
import
Drawer
from
'
./Drawer
'
;
import
Drawer
from
'
./Drawer
'
;
...
@@ -19,6 +20,7 @@ import Tooltip from './Tooltip';
...
@@ -19,6 +20,7 @@ import Tooltip from './Tooltip';
const
components
=
{
const
components
=
{
Alert
,
Alert
,
Badge
,
Button
,
Button
,
Checkbox
,
Checkbox
,
Drawer
,
Drawer
,
...
...
ui/privateTags/AddressTagTable/AddressTagListItem.tsx
View file @
ed382509
...
@@ -28,7 +28,7 @@ const AddressTagListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -28,7 +28,7 @@ const AddressTagListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
<
AddressSnippet
address=
{
item
.
address_hash
}
/>
<
AddressSnippet
address=
{
item
.
address_hash
}
/>
<
HStack
spacing=
{
3
}
mt=
{
4
}
>
<
HStack
spacing=
{
3
}
mt=
{
4
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
item
.
name
}
{
item
.
name
}
</
Tag
>
</
Tag
>
</
HStack
>
</
HStack
>
...
...
ui/privateTags/AddressTagTable/AddressTagTableItem.tsx
View file @
ed382509
...
@@ -33,7 +33,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -33,7 +33,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
TruncatedTextTooltip
label=
{
item
.
name
}
>
<
TruncatedTextTooltip
label=
{
item
.
name
}
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
item
.
name
}
{
item
.
name
}
</
Tag
>
</
Tag
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
...
...
ui/privateTags/TransactionTagTable/TransactionTagListItem.tsx
View file @
ed382509
...
@@ -28,7 +28,7 @@ const TransactionTagListItem = ({ item, onEditClick, onDeleteClick }: Props) =>
...
@@ -28,7 +28,7 @@ const TransactionTagListItem = ({ item, onEditClick, onDeleteClick }: Props) =>
<
TransactionSnippet
hash=
{
item
.
transaction_hash
}
/>
<
TransactionSnippet
hash=
{
item
.
transaction_hash
}
/>
<
HStack
spacing=
{
3
}
mt=
{
4
}
>
<
HStack
spacing=
{
3
}
mt=
{
4
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
item
.
name
}
{
item
.
name
}
</
Tag
>
</
Tag
>
</
HStack
>
</
HStack
>
...
...
ui/privateTags/TransactionTagTable/TransactionTagTableItem.tsx
View file @
ed382509
...
@@ -33,7 +33,7 @@ const TransactionTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) =>
...
@@ -33,7 +33,7 @@ const TransactionTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) =>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
Tooltip
label=
{
item
.
name
}
>
<
Tooltip
label=
{
item
.
name
}
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
item
.
name
}
{
item
.
name
}
</
Tag
>
</
Tag
>
</
Tooltip
>
</
Tooltip
>
...
...
ui/publicTags/PublicTagTable/PublicTagListItem.tsx
View file @
ed382509
...
@@ -35,7 +35,7 @@ const PublicTagListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -35,7 +35,7 @@ const PublicTagListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
{
item
.
tags
.
split
(
'
;
'
).
map
((
tag
)
=>
{
{
item
.
tags
.
split
(
'
;
'
).
map
((
tag
)
=>
{
return
(
return
(
<
TruncatedTextTooltip
label=
{
tag
}
key=
{
tag
}
>
<
TruncatedTextTooltip
label=
{
tag
}
key=
{
tag
}
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
tag
}
{
tag
}
</
Tag
>
</
Tag
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
...
...
ui/publicTags/PublicTagTable/PublicTagTableItem.tsx
View file @
ed382509
...
@@ -40,7 +40,7 @@ const PublicTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -40,7 +40,7 @@ const PublicTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
{
item
.
tags
.
split
(
'
;
'
).
map
((
tag
)
=>
{
{
item
.
tags
.
split
(
'
;
'
).
map
((
tag
)
=>
{
return
(
return
(
<
TruncatedTextTooltip
label=
{
tag
}
key=
{
tag
}
>
<
TruncatedTextTooltip
label=
{
tag
}
key=
{
tag
}
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
tag
}
{
tag
}
</
Tag
>
</
Tag
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
...
...
ui/watchlist/WatchlistTable/WatchListItem.tsx
View file @
ed382509
...
@@ -48,7 +48,7 @@ const WatchListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -48,7 +48,7 @@ const WatchListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
<
WatchListAddressItem
item=
{
item
}
/>
<
WatchListAddressItem
item=
{
item
}
/>
<
HStack
spacing=
{
3
}
mt=
{
6
}
>
<
HStack
spacing=
{
3
}
mt=
{
6
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
item
.
name
}
{
item
.
name
}
</
Tag
>
</
Tag
>
</
HStack
>
</
HStack
>
...
...
ui/watchlist/WatchlistTable/WatchListTableItem.tsx
View file @
ed382509
...
@@ -72,7 +72,7 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -72,7 +72,7 @@ const WatchlistTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
<
Td
><
WatchListAddressItem
item=
{
item
}
/></
Td
>
<
Td
><
WatchListAddressItem
item=
{
item
}
/></
Td
>
<
Td
>
<
Td
>
<
TruncatedTextTooltip
label=
{
item
.
name
}
>
<
TruncatedTextTooltip
label=
{
item
.
name
}
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
<
Tag
>
{
item
.
name
}
{
item
.
name
}
</
Tag
>
</
Tag
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
...
...
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