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
48595715
Commit
48595715
authored
Apr 12, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile view
parent
80d2518b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
60 deletions
+139
-60
VerifiedAddresses.tsx
ui/pages/VerifiedAddresses.tsx
+3
-2
VerifiedAddressesListItem.tsx
ui/verifiedAddresses/VerifiedAddressesListItem.tsx
+51
-6
VerifiedAddressesStatus.tsx
ui/verifiedAddresses/VerifiedAddressesStatus.tsx
+30
-0
VerifiedAddressesTable.tsx
ui/verifiedAddresses/VerifiedAddressesTable.tsx
+1
-0
VerifiedAddressesTableItem.tsx
ui/verifiedAddresses/VerifiedAddressesTableItem.tsx
+19
-52
VerifiedAddressesTokenSnippet.tsx
ui/verifiedAddresses/VerifiedAddressesTokenSnippet.tsx
+35
-0
No files found.
ui/pages/VerifiedAddresses.tsx
View file @
48595715
...
@@ -130,10 +130,11 @@ const VerifiedAddresses = () => {
...
@@ -130,10 +130,11 @@ const VerifiedAddresses = () => {
const
content
=
addressesQuery
.
data
?.
verifiedAddresses
?
(
const
content
=
addressesQuery
.
data
?.
verifiedAddresses
?
(
<>
<>
<
Show
below=
"lg"
key=
"content-mobile"
ssr=
{
false
}
>
<
Show
below=
"lg"
key=
"content-mobile"
ssr=
{
false
}
>
{
data
.
verifiedAddresses
.
map
((
item
)
=>
(
{
addressesQuery
.
data
.
verifiedAddresses
.
map
((
item
)
=>
(
<
VerifiedAddressesListItem
<
VerifiedAddressesListItem
key=
{
item
.
contractAddress
}
key=
{
item
.
contractAddress
}
item=
{
item
}
item=
{
item
}
application=
{
applicationsQuery
.
data
?.
submissions
?.
find
(({
tokenAddress
})
=>
tokenAddress
===
item
.
contractAddress
)
}
onAdd=
{
handleItemAdd
}
onAdd=
{
handleItemAdd
}
onEdit=
{
handleItemEdit
}
onEdit=
{
handleItemEdit
}
/>
/>
...
@@ -190,4 +191,4 @@ const VerifiedAddresses = () => {
...
@@ -190,4 +191,4 @@ const VerifiedAddresses = () => {
);
);
};
};
export
default
VerifiedAddresses
;
export
default
React
.
memo
(
VerifiedAddresses
)
;
ui/verifiedAddresses/VerifiedAddressesListItem.tsx
View file @
48595715
import
{
Link
}
from
'
@chakra-ui/react
'
;
import
{
Icon
,
IconButton
,
Link
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
VerifiedAddress
}
from
'
types/api/account
'
;
import
type
{
TokenInfoApplication
,
VerifiedAddress
}
from
'
types/api/account
'
;
import
editIcon
from
'
icons/edit.svg
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
import
VerifiedAddressesStatus
from
'
./VerifiedAddressesStatus
'
;
import
VerifiedAddressesTokenSnippet
from
'
./VerifiedAddressesTokenSnippet
'
;
interface
Props
{
interface
Props
{
item
:
VerifiedAddress
;
item
:
VerifiedAddress
;
application
:
TokenInfoApplication
|
undefined
;
onAdd
:
(
address
:
string
)
=>
void
;
onAdd
:
(
address
:
string
)
=>
void
;
onEdit
:
(
item
:
VerifiedAddress
)
=>
void
;
onEdit
:
(
address
:
string
)
=>
void
;
}
}
const
VerifiedAddressesListItem
=
({
item
,
onAdd
}:
Props
)
=>
{
const
VerifiedAddressesListItem
=
({
item
,
application
,
onAdd
,
onEdit
}:
Props
)
=>
{
const
handleAddClick
=
React
.
useCallback
(()
=>
{
const
handleAddClick
=
React
.
useCallback
(()
=>
{
onAdd
(
item
.
contractAddress
);
onAdd
(
item
.
contractAddress
);
},
[
item
,
onAdd
]);
},
[
item
,
onAdd
]);
const
handleEditClick
=
React
.
useCallback
(()
=>
{
onEdit
(
item
.
contractAddress
);
},
[
item
,
onEdit
]);
return
(
return
(
<
ListItemMobileGrid
.
Container
>
<
ListItemMobileGrid
.
Container
>
<
ListItemMobileGrid
.
Label
>
Address
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
>
Address
</
ListItemMobileGrid
.
Label
>
...
@@ -25,9 +35,44 @@ const VerifiedAddressesListItem = ({ item, onAdd }: Props) => {
...
@@ -25,9 +35,44 @@ const VerifiedAddressesListItem = ({ item, onAdd }: Props) => {
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
>
Token Info
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
>
Token Info
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
py=
{
application
?
'
3px
'
:
'
5px
'
}
display=
"flex"
alignItems=
"center"
>
<
Link
onClick=
{
handleAddClick
}
>
Add details
</
Link
>
{
application
?
(
<>
<
VerifiedAddressesTokenSnippet
application=
{
application
}
/>
<
Tooltip
label=
"Edit"
>
<
IconButton
aria
-
label=
"edit"
variant=
"simple"
boxSize=
{
5
}
borderRadius=
"none"
flexShrink=
{
0
}
onClick=
{
handleEditClick
}
icon=
{
<
Icon
as=
{
editIcon
}
/>
}
/>
</
Tooltip
>
</>
)
:
(
<
Link
onClick=
{
handleAddClick
}
>
Add details
</
Link
>
)
}
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
{
application
&&
(
<>
<
ListItemMobileGrid
.
Label
>
Status
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
VerifiedAddressesStatus
status=
{
application
.
status
}
/>
</
ListItemMobileGrid
.
Value
>
</>
)
}
{
application
&&
(
<>
<
ListItemMobileGrid
.
Label
>
Date
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
{
dayjs
(
application
.
updatedAt
).
format
(
'
MMM DD, YYYY
'
)
}
</
ListItemMobileGrid
.
Value
>
</>
)
}
</
ListItemMobileGrid
.
Container
>
</
ListItemMobileGrid
.
Container
>
);
);
};
};
...
...
ui/verifiedAddresses/VerifiedAddressesStatus.tsx
0 → 100644
View file @
48595715
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInfoApplication
}
from
'
types/api/account
'
;
interface
Props
{
status
?:
TokenInfoApplication
[
'
status
'
];
}
const
VerifiedAddressesStatus
=
({
status
}:
Props
)
=>
{
switch
(
status
)
{
case
'
IN_PROCESS
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
>
In progress
</
chakra
.
span
>;
}
case
'
APPROVED
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
color=
"green.500"
>
Approved
</
chakra
.
span
>;
}
case
'
UPDATE_REQUIRED
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
color=
"orange.500"
>
Waiting for update
</
chakra
.
span
>;
}
case
'
REJECTED
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
color=
"red.500"
>
Rejected
</
chakra
.
span
>;
}
default
:
return
null
;
}
};
export
default
VerifiedAddressesStatus
;
ui/verifiedAddresses/VerifiedAddressesTable.tsx
View file @
48595715
...
@@ -19,6 +19,7 @@ const VerifiedAddressesTable = ({ data, applications, onItemEdit, onItemAdd }: P
...
@@ -19,6 +19,7 @@ const VerifiedAddressesTable = ({ data, applications, onItemEdit, onItemAdd }: P
<
Tr
>
<
Tr
>
<
Th
>
Address
</
Th
>
<
Th
>
Address
</
Th
>
<
Th
w=
"232px"
>
Token info
</
Th
>
<
Th
w=
"232px"
>
Token info
</
Th
>
<
Th
w=
"94px"
></
Th
>
<
Th
w=
"160px"
>
Request status
</
Th
>
<
Th
w=
"160px"
>
Request status
</
Th
>
<
Th
w=
"150px"
>
Date
</
Th
>
<
Th
w=
"150px"
>
Date
</
Th
>
</
Tr
>
</
Tr
>
...
...
ui/verifiedAddresses/VerifiedAddressesTableItem.tsx
View file @
48595715
import
{
Td
,
Tr
,
Link
,
Flex
,
Image
,
Tooltip
,
IconButton
,
Icon
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Td
,
Tr
,
Link
,
Tooltip
,
IconButton
,
Icon
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInfoApplication
,
VerifiedAddress
}
from
'
types/api/account
'
;
import
type
{
TokenInfoApplication
,
VerifiedAddress
}
from
'
types/api/account
'
;
import
editIcon
from
'
icons/edit.svg
'
;
import
editIcon
from
'
icons/edit.svg
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
TokenLogoPlaceholder
from
'
ui/shared/TokenLogoPlaceholder
'
;
import
VerifiedAddressesStatus
from
'
./VerifiedAddressesStatus
'
;
import
VerifiedAddressesTokenSnippet
from
'
./VerifiedAddressesTokenSnippet
'
;
interface
Props
{
interface
Props
{
item
:
VerifiedAddress
;
item
:
VerifiedAddress
;
...
@@ -26,26 +27,6 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props)
...
@@ -26,26 +27,6 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props)
onEdit
(
item
.
contractAddress
);
onEdit
(
item
.
contractAddress
);
},
[
item
,
onEdit
]);
},
[
item
,
onEdit
]);
const
status
=
(()
=>
{
switch
(
application
?.
status
)
{
case
'
IN_PROCESS
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
>
In progress
</
chakra
.
span
>;
}
case
'
APPROVED
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
color=
"green.500"
>
Approved
</
chakra
.
span
>;
}
case
'
UPDATE_REQUIRED
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
color=
"orange.500"
>
Waiting for update
</
chakra
.
span
>;
}
case
'
REJECTED
'
:
{
return
<
chakra
.
span
fontWeight=
{
500
}
color=
"red.500"
>
Rejected
</
chakra
.
span
>;
}
default
:
return
null
;
}
})();
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
>
<
Td
>
...
@@ -53,39 +34,25 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props)
...
@@ -53,39 +34,25 @@ const VerifiedAddressesTableItem = ({ item, application, onAdd, onEdit }: Props)
</
Td
>
</
Td
>
<
Td
fontSize=
"sm"
verticalAlign=
"middle"
>
<
Td
fontSize=
"sm"
verticalAlign=
"middle"
>
{
application
?
(
{
application
?
(
<
Flex
alignItems=
"center"
columnGap=
{
2
}
w=
"100%"
>
<
VerifiedAddressesTokenSnippet
application=
{
application
}
/>
<
Image
borderRadius=
"base"
boxSize=
{
6
}
objectFit=
"cover"
src=
{
application
.
iconUrl
}
alt=
"Token logo"
fallback=
{
<
TokenLogoPlaceholder
boxSize=
{
6
}
/>
}
/>
<
AddressLink
hash=
{
application
.
tokenAddress
}
alias=
{
application
.
projectName
}
type=
"token"
isDisabled=
{
application
.
status
===
'
IN_PROCESS
'
}
fontWeight=
{
500
}
/>
<
Tooltip
label=
"Edit"
>
<
IconButton
aria
-
label=
"edit"
variant=
"simple"
boxSize=
{
5
}
borderRadius=
"none"
flexShrink=
{
0
}
onClick=
{
handleEditClick
}
icon=
{
<
Icon
as=
{
editIcon
}
/>
}
/>
</
Tooltip
>
</
Flex
>
)
:
(
)
:
(
<
Link
onClick=
{
handleAddClick
}
>
Add details
</
Link
>
<
Link
onClick=
{
handleAddClick
}
>
Add details
</
Link
>
)
}
)
}
</
Td
>
</
Td
>
<
Td
fontSize=
"sm"
>
{
status
}
</
Td
>
<
Td
>
{
application
?
(
<
Tooltip
label=
"Edit"
>
<
IconButton
aria
-
label=
"edit"
variant=
"simple"
boxSize=
{
5
}
borderRadius=
"none"
flexShrink=
{
0
}
onClick=
{
handleEditClick
}
icon=
{
<
Icon
as=
{
editIcon
}
/>
}
/>
</
Tooltip
>
)
:
null
}
</
Td
>
<
Td
fontSize=
"sm"
><
VerifiedAddressesStatus
status=
{
application
?.
status
}
/></
Td
>
<
Td
fontSize=
"sm"
color=
"text_secondary"
>
{
dayjs
(
application
?.
updatedAt
).
format
(
'
MMM DD, YYYY
'
)
}
</
Td
>
<
Td
fontSize=
"sm"
color=
"text_secondary"
>
{
dayjs
(
application
?.
updatedAt
).
format
(
'
MMM DD, YYYY
'
)
}
</
Td
>
</
Tr
>
</
Tr
>
);
);
...
...
ui/verifiedAddresses/VerifiedAddressesTokenSnippet.tsx
0 → 100644
View file @
48595715
import
{
Image
,
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInfoApplication
}
from
'
types/api/account
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
TokenLogoPlaceholder
from
'
ui/shared/TokenLogoPlaceholder
'
;
interface
Props
{
application
:
TokenInfoApplication
;
}
const
VerifiedAddressesTokenSnippet
=
({
application
}:
Props
)
=>
{
return
(
<
Flex
alignItems=
"center"
columnGap=
{
2
}
w=
"100%"
>
<
Image
borderRadius=
"base"
boxSize=
{
6
}
objectFit=
"cover"
src=
{
application
.
iconUrl
}
alt=
"Token logo"
fallback=
{
<
TokenLogoPlaceholder
boxSize=
{
6
}
/>
}
/>
<
AddressLink
hash=
{
application
.
tokenAddress
}
alias=
{
application
.
projectName
}
type=
"token"
isDisabled=
{
application
.
status
===
'
IN_PROCESS
'
}
fontWeight=
{
500
}
/>
</
Flex
>
);
};
export
default
React
.
memo
(
VerifiedAddressesTokenSnippet
);
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