Skip to content

Commit

Permalink
enhancement: making the evm swap section look decent on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Jul 26, 2023
1 parent 66c3725 commit f6e9e85
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/pages/evm/swap/confirm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@
max-width: 300px;
margin: auto;
}
/* Media Query for Mobile */
@media screen and (max-width: 768px) {
padding: 1em;
table {
tr {
flex-direction: column;
align-items: start;
}
}
.bottom-section {
max-width: 100%;
}
}
}
</style>

Expand All @@ -61,11 +77,11 @@

<table>
<tr>
<td>From {from}</td>
<td>From {from.name}</td>
<td>{from?.name === 'EOS (EVM)' ? $evmAccount?.address : $activeSession?.auth.actor}</td>
</tr>
<tr>
<td>To {to}</td>
<td>To {to.name}</td>
<td>{from?.name === 'EOS' ? $evmAccount?.address : $activeSession?.auth.actor}</td>
</tr>
<tr>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/evm/swap/form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@
margin-bottom: 15px;
}
}
/* Media Query for Mobile */
@media screen and (max-width: 768px) {
flex-direction: column;
.left-section,
.right-section {
width: 90%; /* Adjust width for mobile */
margin: 3% auto; /* Centers the sections */
}
}
}
.bottom-section {
Expand Down
37 changes: 36 additions & 1 deletion src/pages/evm/swap/success.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,41 @@
justify-content: center;
gap: 1em;
}
/* Media Query for Mobile */
@media screen and (max-width: 768px) {
padding: 1em;
table {
width: 300px;
margin: auto;
tr:first-child td {
border: none;
}
tr {
display: flex;
flex-direction: column;
}
tr td {
border: none;
word-wrap: break-word;
width: 300px;
}
tr td:last-child {
padding-top: 0;
margin-bottom: 20px;
}
}
.bottom-section {
flex-direction: column;
align-items: center;
}
}
}
</style>

Expand All @@ -61,7 +96,7 @@

<table>
<tr>
<td>Transaction ID</td>
<td>Transaction ID:</td>
<td>{evmTransactResult?.hash}</td>
</tr>
</table>
Expand Down

0 comments on commit f6e9e85

Please sign in to comment.