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
8949cb36
Commit
8949cb36
authored
Sep 02, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete modals mobile view
parent
a2597538
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
16 deletions
+23
-16
Textarea.ts
theme/components/Textarea.ts
+6
-0
DeleteApiKeyModal.tsx
ui/apiKey/DeleteApiKeyModal.tsx
+1
-1
DeleteCustomAbiModal.tsx
ui/customAbi/DeleteCustomAbiModal.tsx
+1
-1
DeletePrivateTagModal.tsx
ui/privateTags/DeletePrivateTagModal.tsx
+1
-1
DeletePublicTagModal.tsx
ui/publicTags/DeletePublicTagModal.tsx
+13
-12
DeleteAddressModal.tsx
ui/watchlist/DeleteAddressModal.tsx
+1
-1
No files found.
theme/components/Textarea.ts
View file @
8949cb36
...
@@ -4,6 +4,12 @@ import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system';
...
@@ -4,6 +4,12 @@ import { defineStyle, defineStyleConfig } from '@chakra-ui/styled-system';
import
getOutlinedFieldStyles
from
'
../utils/getOutlinedFieldStyles
'
;
import
getOutlinedFieldStyles
from
'
../utils/getOutlinedFieldStyles
'
;
const
sizes
=
{
const
sizes
=
{
md
:
defineStyle
({
fontSize
:
'
md
'
,
lineHeight
:
'
20px
'
,
h
:
'
160px
'
,
borderRadius
:
'
base
'
,
}),
lg
:
defineStyle
({
lg
:
defineStyle
({
fontSize
:
'
md
'
,
fontSize
:
'
md
'
,
lineHeight
:
'
20px
'
,
lineHeight
:
'
20px
'
,
...
...
ui/apiKey/DeleteApiKeyModal.tsx
View file @
8949cb36
...
@@ -28,7 +28,7 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
...
@@ -28,7 +28,7 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
const
renderText
=
useCallback
(()
=>
{
const
renderText
=
useCallback
(()
=>
{
return
(
return
(
<
Text
display=
"flex"
>
API key for
<
Text
fontWeight=
"600"
whiteSpace=
"pre"
>
{
` "${ data.name || 'name' }" `
}
</
Text
>
will be deleted
</
Text
>
<
Text
>
API key for
<
Text
fontWeight=
"600"
as=
"span"
>
{
` "${ data.name || 'name' }" `
}
</
Text
>
will be deleted
</
Text
>
);
);
},
[
data
.
name
]);
},
[
data
.
name
]);
...
...
ui/customAbi/DeleteCustomAbiModal.tsx
View file @
8949cb36
...
@@ -28,7 +28,7 @@ const DeleteCustomAbiModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
...
@@ -28,7 +28,7 @@ const DeleteCustomAbiModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
const
renderText
=
useCallback
(()
=>
{
const
renderText
=
useCallback
(()
=>
{
return
(
return
(
<
Text
display=
"flex"
>
Custom ABI for
<
Text
fontWeight=
"600"
whiteSpace=
"pre
"
>
{
` "${ data.name || 'name' }" `
}
</
Text
>
will be deleted
</
Text
>
<
Text
>
Custom ABI for
<
Text
fontWeight=
"600"
as=
"span
"
>
{
` "${ data.name || 'name' }" `
}
</
Text
>
will be deleted
</
Text
>
);
);
},
[
data
.
name
]);
},
[
data
.
name
]);
...
...
ui/privateTags/DeletePrivateTagModal.tsx
View file @
8949cb36
...
@@ -37,7 +37,7 @@ const DeletePrivateTagModal: React.FC<Props> = ({ isOpen, onClose, data, type })
...
@@ -37,7 +37,7 @@ const DeletePrivateTagModal: React.FC<Props> = ({ isOpen, onClose, data, type })
const
renderText
=
useCallback
(()
=>
{
const
renderText
=
useCallback
(()
=>
{
return
(
return
(
<
Text
display=
"flex"
>
Tag
<
Text
fontWeight=
"600"
whiteSpace=
"pre
"
>
{
` "${ tag || 'tag' }" `
}
</
Text
>
will be deleted
</
Text
>
<
Text
>
Tag
<
Text
fontWeight=
"600"
as=
"span
"
>
{
` "${ tag || 'tag' }" `
}
</
Text
>
will be deleted
</
Text
>
);
);
},
[
tag
]);
},
[
tag
]);
...
...
ui/publicTags/DeletePublicTagModal.tsx
View file @
8949cb36
import
{
Flex
,
Text
,
FormControl
,
FormLabel
,
Textarea
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
,
FormControl
,
FormLabel
,
Textarea
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
{
useQueryClient
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
import
type
{
ChangeEvent
}
from
'
react
'
;
...
@@ -22,6 +22,7 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
...
@@ -22,6 +22,7 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
const
tags
=
data
.
tags
.
split
(
'
;
'
);
const
tags
=
data
.
tags
.
split
(
'
;
'
);
const
queryClient
=
useQueryClient
();
const
queryClient
=
useQueryClient
();
const
formBackgroundColor
=
useColorModeValue
(
'
white
'
,
'
gray.900
'
);
const
deleteApiKey
=
useCallback
(()
=>
{
const
deleteApiKey
=
useCallback
(()
=>
{
const
body
=
JSON
.
stringify
({
remove_reason
:
reason
});
const
body
=
JSON
.
stringify
({
remove_reason
:
reason
});
...
@@ -44,9 +45,9 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
...
@@ -44,9 +45,9 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
if
(
tags
.
length
===
1
)
{
if
(
tags
.
length
===
1
)
{
text
=
(
text
=
(
<>
<>
<
Text
display=
"
flex
"
>
Public tag
</
Text
>
<
Text
display=
"
inline"
as=
"span
"
>
Public tag
</
Text
>
<
Text
fontWeight=
"600"
whiteSpace=
"pre"
>
{
` "${ tags[0] }" `
}
</
Text
>
<
Text
fontWeight=
"600"
whiteSpace=
"pre"
as=
"span"
>
{
` "${ tags[0] }" `
}
</
Text
>
<
Text
>
will be removed.
</
Text
>
<
Text
as=
"span"
>
will be removed.
</
Text
>
</>
</>
);
);
}
}
...
@@ -54,29 +55,29 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
...
@@ -54,29 +55,29 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
const
tagsText
:
Array
<
JSX
.
Element
|
string
>
=
[];
const
tagsText
:
Array
<
JSX
.
Element
|
string
>
=
[];
tags
.
forEach
((
tag
,
index
)
=>
{
tags
.
forEach
((
tag
,
index
)
=>
{
if
(
index
<
tags
.
length
-
2
)
{
if
(
index
<
tags
.
length
-
2
)
{
tagsText
.
push
(<
Text
fontWeight=
"600"
whiteSpace=
"pre"
>
{
` "${ tag }"`
}
</
Text
>);
tagsText
.
push
(<
Text
fontWeight=
"600"
whiteSpace=
"pre"
as=
"span"
>
{
` "${ tag }"`
}
</
Text
>);
tagsText
.
push
(
'
,
'
);
tagsText
.
push
(
'
,
'
);
}
}
if
(
index
===
tags
.
length
-
2
)
{
if
(
index
===
tags
.
length
-
2
)
{
tagsText
.
push
(<
Text
fontWeight=
"600"
whiteSpace=
"pre"
>
{
` "${ tag }" `
}
</
Text
>);
tagsText
.
push
(<
Text
fontWeight=
"600"
whiteSpace=
"pre"
as=
"span"
>
{
` "${ tag }" `
}
</
Text
>);
tagsText
.
push
(
'
and
'
);
tagsText
.
push
(
'
and
'
);
}
}
if
(
index
===
tags
.
length
-
1
)
{
if
(
index
===
tags
.
length
-
1
)
{
tagsText
.
push
(<
Text
fontWeight=
"600"
whiteSpace=
"pre"
>
{
` "${ tag }" `
}
</
Text
>);
tagsText
.
push
(<
Text
fontWeight=
"600"
whiteSpace=
"pre"
as=
"span"
>
{
` "${ tag }" `
}
</
Text
>);
}
}
});
});
text
=
(
text
=
(
<>
<>
<
Text
>
Public tags
</
Text
>
{
tagsText
}
<
Text
>
will be removed.
</
Text
>
<
Text
as=
"span"
>
Public tags
</
Text
>
{
tagsText
}
<
Text
as=
"span"
>
will be removed.
</
Text
>
</>
</>
);
);
}
}
return
(
return
(
<>
<>
<
Fle
x
marginBottom=
{
12
}
>
<
Bo
x
marginBottom=
{
12
}
>
{
text
}
{
text
}
</
Fle
x
>
</
Bo
x
>
<
FormControl
variant=
"floating"
id=
"tag-delete"
>
<
FormControl
variant=
"floating"
id=
"tag-delete"
backgroundColor=
{
formBackgroundColor
}
>
<
Textarea
<
Textarea
size=
"lg"
size=
"lg"
value=
{
reason
}
value=
{
reason
}
...
@@ -86,7 +87,7 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
...
@@ -86,7 +87,7 @@ const DeletePublicTagModal: React.FC<Props> = ({ isOpen, onClose, data, onDelete
</
FormControl
>
</
FormControl
>
</>
</>
);
);
},
[
tags
,
reason
,
onFieldChange
]);
},
[
tags
,
reason
,
onFieldChange
,
formBackgroundColor
]);
return
(
return
(
<
DeleteModal
<
DeleteModal
...
...
ui/watchlist/DeleteAddressModal.tsx
View file @
8949cb36
...
@@ -33,7 +33,7 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
...
@@ -33,7 +33,7 @@ const DeleteAddressModal: React.FC<Props> = ({ isOpen, onClose, data }) => {
const renderModalContent = useCallback(() => {
const renderModalContent = useCallback(() => {
const addressString = isMobile ? [ address.slice(0, 4), address.slice(-4) ].join('...') : address;
const addressString = isMobile ? [ address.slice(0, 4), address.slice(-4) ].join('...') : address;
return (
return (
<Text
display="flex">Address <Text fontWeight="600" whiteSpace="pre"> { addressString || 'address' } </Text>
will be deleted</Text>
<Text
>Address <Text fontWeight="600" as="span"> { addressString || 'address' }</Text>
will be deleted</Text>
);
);
}, [ address, isMobile ]);
}, [ address, isMobile ]);
...
...
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