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
f9e590b8
Commit
f9e590b8
authored
Oct 22, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixes
parent
4546db73
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
8 deletions
+16
-8
Watchlist.tsx
ui/pages/Watchlist.tsx
+4
-0
UserProfileContentNavLink.tsx
ui/snippets/user/profile/UserProfileContentNavLink.tsx
+1
-1
WatchListItem.tsx
ui/watchlist/WatchlistTable/WatchListItem.tsx
+4
-3
WatchListTableItem.tsx
ui/watchlist/WatchlistTable/WatchListTableItem.tsx
+4
-3
WatchlistTable.tsx
ui/watchlist/WatchlistTable/WatchlistTable.tsx
+3
-1
No files found.
ui/pages/Watchlist.tsx
View file @
f9e590b8
...
@@ -13,6 +13,7 @@ import DataListDisplay from 'ui/shared/DataListDisplay';
...
@@ -13,6 +13,7 @@ import DataListDisplay from 'ui/shared/DataListDisplay';
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
useProfileQuery
from
'
ui/snippets/auth/useProfileQuery
'
;
import
useRedirectForInvalidAuthToken
from
'
ui/snippets/auth/useRedirectForInvalidAuthToken
'
;
import
useRedirectForInvalidAuthToken
from
'
ui/snippets/auth/useRedirectForInvalidAuthToken
'
;
import
AddressModal
from
'
ui/watchlist/AddressModal/AddressModal
'
;
import
AddressModal
from
'
ui/watchlist/AddressModal/AddressModal
'
;
import
DeleteAddressModal
from
'
ui/watchlist/DeleteAddressModal
'
;
import
DeleteAddressModal
from
'
ui/watchlist/DeleteAddressModal
'
;
...
@@ -28,6 +29,7 @@ const WatchList: React.FC = () => {
...
@@ -28,6 +29,7 @@ const WatchList: React.FC = () => {
},
},
});
});
const
queryClient
=
useQueryClient
();
const
queryClient
=
useQueryClient
();
const
profileQuery
=
useProfileQuery
();
const
addressModalProps
=
useDisclosure
();
const
addressModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
...
@@ -93,6 +95,7 @@ const WatchList: React.FC = () => {
...
@@ -93,6 +95,7 @@ const WatchList: React.FC = () => {
isLoading=
{
isPlaceholderData
}
isLoading=
{
isPlaceholderData
}
onDeleteClick=
{
onDeleteClick
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
onEditClick=
{
onEditClick
}
hasEmail=
{
Boolean
(
profileQuery
.
data
?.
email
)
}
/>
/>
))
}
))
}
</
Box
>
</
Box
>
...
@@ -103,6 +106,7 @@ const WatchList: React.FC = () => {
...
@@ -103,6 +106,7 @@ const WatchList: React.FC = () => {
onDeleteClick=
{
onDeleteClick
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
onEditClick=
{
onEditClick
}
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
hasEmail=
{
Boolean
(
profileQuery
.
data
?.
email
)
}
/>
/>
</
Box
>
</
Box
>
</>
</>
...
...
ui/snippets/user/profile/UserProfileContentNavLink.tsx
View file @
f9e590b8
...
@@ -20,7 +20,7 @@ const UserProfileContentNavLink = ({ href, icon, text, onClick, py }: Props) =>
...
@@ -20,7 +20,7 @@ const UserProfileContentNavLink = ({ href, icon, text, onClick, py }: Props) =>
alignItems=
"center"
alignItems=
"center"
columnGap=
{
3
}
columnGap=
{
3
}
py=
{
py
??
'
14px
'
}
py=
{
py
??
'
14px
'
}
color=
"in
itial
"
color=
"in
herit
"
_hover=
{
{
textDecoration
:
'
none
'
,
color
:
'
link_hovered
'
}
}
_hover=
{
{
textDecoration
:
'
none
'
,
color
:
'
link_hovered
'
}
}
onClick=
{
onClick
}
onClick=
{
onClick
}
>
>
...
...
ui/watchlist/WatchlistTable/WatchListItem.tsx
View file @
f9e590b8
...
@@ -17,9 +17,10 @@ interface Props {
...
@@ -17,9 +17,10 @@ interface Props {
isLoading
?:
boolean
;
isLoading
?:
boolean
;
onEditClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onEditClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onDeleteClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onDeleteClick
:
(
data
:
WatchlistAddress
)
=>
void
;
hasEmail
:
boolean
;
}
}
const
WatchListItem
=
({
item
,
isLoading
,
onEditClick
,
onDeleteClick
}:
Props
)
=>
{
const
WatchListItem
=
({
item
,
isLoading
,
onEditClick
,
onDeleteClick
,
hasEmail
}:
Props
)
=>
{
const
[
notificationEnabled
,
setNotificationEnabled
]
=
useState
(
item
.
notification_methods
.
email
);
const
[
notificationEnabled
,
setNotificationEnabled
]
=
useState
(
item
.
notification_methods
.
email
);
const
[
switchDisabled
,
setSwitchDisabled
]
=
useState
(
false
);
const
[
switchDisabled
,
setSwitchDisabled
]
=
useState
(
false
);
const
onItemEditClick
=
useCallback
(()
=>
{
const
onItemEditClick
=
useCallback
(()
=>
{
...
@@ -49,7 +50,7 @@ const WatchListItem = ({ item, isLoading, onEditClick, onDeleteClick }: Props) =
...
@@ -49,7 +50,7 @@ const WatchListItem = ({ item, isLoading, onEditClick, onDeleteClick }: Props) =
const
showNotificationToast
=
useCallback
((
isOn
:
boolean
)
=>
{
const
showNotificationToast
=
useCallback
((
isOn
:
boolean
)
=>
{
notificationToast
({
notificationToast
({
position
:
'
top-right
'
,
position
:
'
top-right
'
,
description
:
isOn
?
'
Email notification is ON
'
:
'
Email notification is OFF
'
,
description
:
!
isOn
?
'
Email notification is ON
'
:
'
Email notification is OFF
'
,
colorScheme
:
'
green
'
,
colorScheme
:
'
green
'
,
status
:
'
success
'
,
status
:
'
success
'
,
variant
:
'
subtle
'
,
variant
:
'
subtle
'
,
...
@@ -103,7 +104,7 @@ const WatchListItem = ({ item, isLoading, onEditClick, onDeleteClick }: Props) =
...
@@ -103,7 +104,7 @@ const WatchListItem = ({ item, isLoading, onEditClick, onDeleteClick }: Props) =
isChecked=
{
notificationEnabled
}
isChecked=
{
notificationEnabled
}
onChange=
{
onSwitch
}
onChange=
{
onSwitch
}
aria
-
label=
"Email notification"
aria
-
label=
"Email notification"
isDisabled=
{
switchDisabled
}
isDisabled=
{
!
hasEmail
||
switchDisabled
}
/>
/>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
...
...
ui/watchlist/WatchlistTable/WatchListTableItem.tsx
View file @
f9e590b8
...
@@ -21,9 +21,10 @@ interface Props {
...
@@ -21,9 +21,10 @@ interface Props {
isLoading
?:
boolean
;
isLoading
?:
boolean
;
onEditClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onEditClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onDeleteClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onDeleteClick
:
(
data
:
WatchlistAddress
)
=>
void
;
hasEmail
:
boolean
;
}
}
const
WatchlistTableItem
=
({
item
,
isLoading
,
onEditClick
,
onDeleteClick
}:
Props
)
=>
{
const
WatchlistTableItem
=
({
item
,
isLoading
,
onEditClick
,
onDeleteClick
,
hasEmail
}:
Props
)
=>
{
const
[
notificationEnabled
,
setNotificationEnabled
]
=
useState
(
item
.
notification_methods
.
email
);
const
[
notificationEnabled
,
setNotificationEnabled
]
=
useState
(
item
.
notification_methods
.
email
);
const
[
switchDisabled
,
setSwitchDisabled
]
=
useState
(
false
);
const
[
switchDisabled
,
setSwitchDisabled
]
=
useState
(
false
);
const
onItemEditClick
=
useCallback
(()
=>
{
const
onItemEditClick
=
useCallback
(()
=>
{
...
@@ -53,7 +54,7 @@ const WatchlistTableItem = ({ item, isLoading, onEditClick, onDeleteClick }: Pro
...
@@ -53,7 +54,7 @@ const WatchlistTableItem = ({ item, isLoading, onEditClick, onDeleteClick }: Pro
const
showNotificationToast
=
useCallback
((
isOn
:
boolean
)
=>
{
const
showNotificationToast
=
useCallback
((
isOn
:
boolean
)
=>
{
notificationToast
({
notificationToast
({
position
:
'
top-right
'
,
position
:
'
top-right
'
,
description
:
isOn
?
'
Email notification is ON
'
:
'
Email notification is OFF
'
,
description
:
!
isOn
?
'
Email notification is ON
'
:
'
Email notification is OFF
'
,
colorScheme
:
'
green
'
,
colorScheme
:
'
green
'
,
status
:
'
success
'
,
status
:
'
success
'
,
variant
:
'
subtle
'
,
variant
:
'
subtle
'
,
...
@@ -101,7 +102,7 @@ const WatchlistTableItem = ({ item, isLoading, onEditClick, onDeleteClick }: Pro
...
@@ -101,7 +102,7 @@ const WatchlistTableItem = ({ item, isLoading, onEditClick, onDeleteClick }: Pro
size=
"md"
size=
"md"
isChecked=
{
notificationEnabled
}
isChecked=
{
notificationEnabled
}
onChange=
{
onSwitch
}
onChange=
{
onSwitch
}
isDisabled=
{
switchDisabled
}
isDisabled=
{
!
hasEmail
||
switchDisabled
}
aria
-
label=
"Email notification"
aria
-
label=
"Email notification"
/>
/>
</
Skeleton
>
</
Skeleton
>
...
...
ui/watchlist/WatchlistTable/WatchlistTable.tsx
View file @
f9e590b8
...
@@ -18,9 +18,10 @@ interface Props {
...
@@ -18,9 +18,10 @@ interface Props {
onEditClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onEditClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onDeleteClick
:
(
data
:
WatchlistAddress
)
=>
void
;
onDeleteClick
:
(
data
:
WatchlistAddress
)
=>
void
;
top
:
number
;
top
:
number
;
hasEmail
:
boolean
;
}
}
const
WatchlistTable
=
({
data
,
isLoading
,
onDeleteClick
,
onEditClick
,
top
}:
Props
)
=>
{
const
WatchlistTable
=
({
data
,
isLoading
,
onDeleteClick
,
onEditClick
,
top
,
hasEmail
}:
Props
)
=>
{
return
(
return
(
<
Table
variant=
"simple"
minWidth=
"600px"
>
<
Table
variant=
"simple"
minWidth=
"600px"
>
<
TheadSticky
top=
{
top
}
>
<
TheadSticky
top=
{
top
}
>
...
@@ -39,6 +40,7 @@ const WatchlistTable = ({ data, isLoading, onDeleteClick, onEditClick, top }: Pr
...
@@ -39,6 +40,7 @@ const WatchlistTable = ({ data, isLoading, onDeleteClick, onEditClick, top }: Pr
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
onDeleteClick=
{
onDeleteClick
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
onEditClick=
{
onEditClick
}
hasEmail=
{
hasEmail
}
/>
/>
))
}
))
}
</
Tbody
>
</
Tbody
>
...
...
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