Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
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
LuckySwap
interface
Commits
30d1de8e
Unverified
Commit
30d1de8e
authored
May 03, 2023
by
eddie
Committed by
GitHub
May 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: moonpay modal height (#6439)
parent
0e5328be
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
5 deletions
+35
-5
buy-crypto-modal.test.ts
cypress/e2e/buy-crypto-modal.test.ts
+28
-0
index.tsx
src/components/FiatOnrampModal/index.tsx
+2
-2
index.tsx
src/components/Modal/index.tsx
+4
-2
CurrencySearchModal.tsx
src/components/SearchModal/CurrencySearchModal.tsx
+1
-1
No files found.
cypress/e2e/buy-crypto-modal.test.ts
0 → 100644
View file @
30d1de8e
import
{
getTestSelector
}
from
'
../utils
'
describe
(
'
Buy Crypto Modal
'
,
()
=>
{
it
(
'
should open and close
'
,
()
=>
{
cy
.
visit
(
'
/
'
)
// Open the fiat onramp modal
cy
.
get
(
getTestSelector
(
'
buy-fiat-button
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
fiat-onramp-modal
'
)).
should
(
'
be.visible
'
)
// Click on a location that should be outside the modal, which should close it
cy
.
get
(
'
body
'
).
click
(
0
,
100
)
cy
.
get
(
getTestSelector
(
'
fiat-onramp-modal
'
)).
should
(
'
not.exist
'
)
})
it
(
'
should open and close, mobile viewport
'
,
()
=>
{
cy
.
viewport
(
'
iphone-6
'
)
cy
.
visit
(
'
/
'
)
// Open the fiat onramp modal
cy
.
get
(
getTestSelector
(
'
buy-fiat-button
'
)).
click
()
cy
.
get
(
getTestSelector
(
'
fiat-onramp-modal
'
)).
should
(
'
be.visible
'
)
// Click on a location that should be outside the modal, which should close it
cy
.
get
(
'
body
'
).
click
(
10
,
10
)
cy
.
get
(
getTestSelector
(
'
fiat-onramp-modal
'
)).
should
(
'
not.exist
'
)
})
})
src/components/FiatOnrampModal/index.tsx
View file @
30d1de8e
...
@@ -19,7 +19,7 @@ const Wrapper = styled.div<{ isDarkMode: boolean }>`
...
@@ -19,7 +19,7 @@ const Wrapper = styled.div<{ isDarkMode: boolean }>`
display: flex;
display: flex;
flex-flow: column nowrap;
flex-flow: column nowrap;
margin: 0;
margin: 0;
min-height: 720px
;
flex: 1 1
;
min-width: 375px;
min-width: 375px;
position: relative;
position: relative;
width: 100%;
width: 100%;
...
@@ -125,7 +125,7 @@ export default function FiatOnrampModal() {
...
@@ -125,7 +125,7 @@ export default function FiatOnrampModal() {
},
[
fetchSignedIframeUrl
])
},
[
fetchSignedIframeUrl
])
return
(
return
(
<
Modal
isOpen=
{
fiatOnrampModalOpen
}
onDismiss=
{
closeModal
}
maxHeight=
{
720
}
>
<
Modal
isOpen=
{
fiatOnrampModalOpen
}
onDismiss=
{
closeModal
}
height=
{
80
/* vh */
}
>
<
Wrapper
data
-
testid=
"fiat-onramp-modal"
isDarkMode=
{
isDarkMode
}
>
<
Wrapper
data
-
testid=
"fiat-onramp-modal"
isDarkMode=
{
isDarkMode
}
>
{
error
?
(
{
error
?
(
<>
<>
...
...
src/components/Modal/index.tsx
View file @
30d1de8e
...
@@ -79,6 +79,7 @@ interface ModalProps {
...
@@ -79,6 +79,7 @@ interface ModalProps {
isOpen
:
boolean
isOpen
:
boolean
onDismiss
?:
()
=>
void
onDismiss
?:
()
=>
void
onSwipe
?:
()
=>
void
onSwipe
?:
()
=>
void
height
?:
number
// takes precedence over minHeight and maxHeight
minHeight
?:
number
|
false
minHeight
?:
number
|
false
maxHeight
?:
number
maxHeight
?:
number
maxWidth
?:
number
maxWidth
?:
number
...
@@ -94,6 +95,7 @@ export default function Modal({
...
@@ -94,6 +95,7 @@ export default function Modal({
minHeight
=
false
,
minHeight
=
false
,
maxHeight
=
90
,
maxHeight
=
90
,
maxWidth
=
420
,
maxWidth
=
420
,
height
,
initialFocusRef
,
initialFocusRef
,
children
,
children
,
onSwipe
=
onDismiss
,
onSwipe
=
onDismiss
,
...
@@ -139,8 +141,8 @@ export default function Modal({
...
@@ -139,8 +141,8 @@ export default function Modal({
}
}
:
{}
)}
:
{}
)}
aria-label="dialog"
aria-label="dialog"
$minHeight=
{
minHeight
}
$minHeight=
{
height
??
minHeight
}
$maxHeight=
{
maxHeight
}
$maxHeight=
{
height
??
maxHeight
}
$scrollOverlay=
{
$scrollOverlay
}
$scrollOverlay=
{
$scrollOverlay
}
$hideBorder=
{
hideBorder
}
$hideBorder=
{
hideBorder
}
$maxWidth=
{
maxWidth
}
$maxWidth=
{
maxWidth
}
...
...
src/components/SearchModal/CurrencySearchModal.tsx
View file @
30d1de8e
...
@@ -105,7 +105,7 @@ export default memo(function CurrencySearchModal({
...
@@ -105,7 +105,7 @@ export default memo(function CurrencySearchModal({
break
break
}
}
return
(
return
(
<
Modal
isOpen=
{
isOpen
}
onDismiss=
{
onDismiss
}
maxHeight=
{
modalHeight
}
minH
eight=
{
modalHeight
}
>
<
Modal
isOpen=
{
isOpen
}
onDismiss=
{
onDismiss
}
h
eight=
{
modalHeight
}
>
{
content
}
{
content
}
</
Modal
>
</
Modal
>
)
)
...
...
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