Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap flow redesigned #8

Merged
merged 44 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
525e668
'Swap' button
iower Sep 26, 2023
0e692da
Swap -> SwapNew (duplicate components)
iower Sep 26, 2023
c1ee5b4
'Select Chain': place chains list
iower Sep 27, 2023
15013bd
Improve styles
iower Sep 27, 2023
aeaef4e
Remove pin and check
iower Sep 27, 2023
8b4d9a2
Styles
iower Sep 27, 2023
8a3071d
Hide unsupported chains
iower Sep 27, 2023
786a54e
Chains: nothing found case
iower Sep 27, 2023
251bee8
Unfix 'Get quotes'
iower Sep 27, 2023
05eda63
viaSwap model (steps)
iower Sep 28, 2023
5562aa0
SwapRenew
iower Sep 28, 2023
cdba793
Styles
iower Sep 28, 2023
58b406c
Styles
iower Sep 28, 2023
3044958
Styles
iower Sep 28, 2023
472b8ec
Styles
iower Sep 28, 2023
044d725
Styles
iower Sep 28, 2023
690691a
Styles
iower Sep 28, 2023
e608063
Styles
iower Sep 29, 2023
c968fba
Fix popup style
iower Sep 29, 2023
cea6f5c
adapter fix
nrjshka Oct 3, 2023
83e0171
ts
iower Oct 3, 2023
7d9efc3
Styles
iower Oct 3, 2023
202c974
Styles
iower Oct 3, 2023
5b638f3
Fix styles
iower Oct 4, 2023
377d217
Improve styles
iower Oct 4, 2023
0a1ea34
Styles
iower Oct 4, 2023
8468685
More styles
iower Oct 4, 2023
b3d4826
Styles
iower Oct 4, 2023
68bfd8a
Styles
iower Oct 4, 2023
5339d3d
Styles
iower Oct 4, 2023
e5a6f18
Styles
iower Oct 4, 2023
b041009
Styles
iower Oct 5, 2023
65726b0
Styles
iower Oct 5, 2023
fbf33e4
Styles
iower Oct 5, 2023
0832b85
Styles + main-button
iower Oct 5, 2023
0108707
Styles
iower Oct 5, 2023
fa3c3f0
Styles
iower Oct 5, 2023
674c587
Styles
iower Oct 6, 2023
89d4150
Cleanup
iower Oct 6, 2023
4a01f89
Revert "viaSwap model (steps)"
iower Oct 6, 2023
bed6883
Cleanup (remove duplicate code)
iower Oct 6, 2023
1862cca
Styles
iower Oct 6, 2023
6df878b
Swap hotkey
iower Oct 6, 2023
4ac235e
Fix
iower Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@rabby-wallet/eth-watch-keyring": "^1.0.0",
"@rabby-wallet/gnosis-sdk": "^1.3.5",
"@rabby-wallet/page-provider": "^0.1.20",
"@rabby-wallet/rabby-api": "^0.6.20",
"@rabby-wallet/rabby-api": "^0.6.22",
"@vespaiach/axios-fetch-adapter": "^0.3.0",
"@rabby-wallet/rabby-security-engine": "^1.1.16",
"@rabby-wallet/rabby-swap": "^0.0.28",
Expand Down
4 changes: 4 additions & 0 deletions src/background/service/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { INITIAL_OPENAPI_URL, INITIAL_TESTNET_OPENAPI_URL } from '@/constant';
import fetchAdapter from '@vespaiach/axios-fetch-adapter';
import { OpenApiService } from '@rabby-wallet/rabby-api';
import { createPersistStore } from 'background/utils';
export * from '@rabby-wallet/rabby-api/dist/types';
Expand Down Expand Up @@ -27,6 +28,9 @@ if (!process.env.DEBUG) {
}

const service = new OpenApiService({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Comment on lines +31 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

adapter: fetchAdapter,
store,
});

Expand Down
2 changes: 1 addition & 1 deletion src/background/service/transactionHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class TxHistory {
const site = {
origin: INTERNAL_REQUEST_ORIGIN,
icon: '',
name: 'Rabby Wallet',
name: 'Ally',
chain: CHAINS_ENUM.ETH,
isSigned: false,
isTop: false,
Expand Down
2 changes: 1 addition & 1 deletion src/background/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ declare global {
export const walletConnectClientMeta = {
description: i18n.t('appDescription'),
url: 'https://rabby.io',
icons: ['https://rabby.io/assets/images/logo-128.png'],
icons: ['https://myally.xyz/vite.svg'],
name: 'Rabby',
};
export const setWalletConnectClientMeta = (keyring: WalletConnectKeyring) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Sentry.init({
function initAppMeta() {
const head = document.querySelector('head');
const icon = document.createElement('link');
icon.href = 'https://rabby.io/assets/images/logo-128.png';
icon.href = 'https://myally.xyz/vite.svg';
icon.rel = 'icon';
head?.appendChild(icon);
const name = document.createElement('meta');
Expand Down
2 changes: 1 addition & 1 deletion src/ui/assets/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/ui/assets/chain-select/chain-filter-close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/ui/assets/close-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/ui/assets/sign/tx/alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/ui/assets/swap/history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/ui/assets/swap/setting.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/ui/assets/swap/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/ui/assets/swap/switch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/ui/assets/swap/verified.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/ui/component/ChainSelector/InForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { SWAP_SUPPORT_CHAINS } from '@/constant';

const ChainWrapper = styled.div`
height: 40px;
background: #f5f6fa;
background: #1d1d1d;
border-radius: 6px;
padding: 12px 10px;
width: 100%;
Expand All @@ -24,7 +24,7 @@ const ChainWrapper = styled.div`
border: 1px solid transparent;
cursor: pointer;
&:hover {
background: rgba(134, 151, 255, 0.2);
background: #292929;
}
& > {
.down {
Expand All @@ -33,7 +33,7 @@ const ChainWrapper = styled.div`
height: 20px;
}
.name {
color: #13141a;
color: #ccc;
}
}
`;
Expand Down Expand Up @@ -61,7 +61,7 @@ export const ChainRender = ({
<ChainWrapper
className={clsx(
{
'cursor-default hover:bg-[#f5f6fa]': readonly,
'cursor-default hover:bg-[#292929]': readonly,
},
className
)}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/component/ChainSelector/components/SelectChainList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const SelectChainList = (props: SelectChainListProps) => {
}
if (sortable) {
return (
<div className={clsx('select-chain-list', className)}>
<div className={clsx('select-chain-list bg-transparent', className)}>
<DndContext
onDragEnd={handleDragEnd}
measuring={{
Expand Down Expand Up @@ -115,7 +115,7 @@ export const SelectChainList = (props: SelectChainListProps) => {
);
}
return (
<div className={clsx('select-chain-list', className)}>
<div className={clsx('select-chain-list bg-transparent', className)}>
{items.map((item) => {
return (
<SortableSelectChainItem
Expand Down
44 changes: 16 additions & 28 deletions src/ui/component/ChainSelector/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
flex-shrink: 0;
-webkit-user-select: none;
background: rgba(134, 151, 255, 0.12);
border: 1px solid #e5e9ef;
border: 1px solid #333333;
border-radius: 6px;
padding: 8px 4px 8px 8px;
font-weight: 500;
Expand Down Expand Up @@ -51,16 +51,16 @@
position: sticky;
top: 0;
z-index: 1;
background-color: #fff;
background-color: #151515;
.ant-input-affix-wrapper {
border: 1px solid #e5e9ef;
border: none;
border-radius: 6px;
height: 36px;
}

.ant-input-affix-wrapper:focus,
.ant-input-affix-wrapper-focused {
border-color: #b0bdff;
border-color: #ccc;
}
}
.ant-drawer-header {
Expand All @@ -87,12 +87,14 @@
}
.ant-drawer-body {
padding-top: 0 !important;
background: #151515;
&::-webkit-scrollbar {
display: none !important;
}
}
.ant-drawer-content {
border-radius: 16px 16px 0 0;
background: #151515;
}
.no-pinned-container {
width: 360px;
Expand All @@ -114,7 +116,7 @@
}
.all-chais {
width: 100%;
background: #ffffff;
background: #333;
display: flex;
justify-content: center;
margin-top: 16px;
Expand All @@ -140,7 +142,7 @@
min-width: 116px;
display: inline-flex;
height: 40px;
background: #9ba9fd;
background: #666;
border-radius: 6px 6px 0px 0px;
padding: 8px 6px 8px 12px;
font-size: 12px;
Expand All @@ -163,31 +165,18 @@

.select-chain {
&-list {
background: #f5f6fa;
border-radius: 6px;
& + & {
margin-top: 24px;
}
}
&-item {
display: flex;
align-items: center;
padding: 14px 16px;
cursor: pointer;
border-radius: 4px;
border-radius: 6px;
position: relative;
border: 1px solid transparent;
height: 56px;

&::after {
content: '';
position: absolute;
bottom: -1px;
left: 16px;
right: 16px;
border-bottom: 1px solid @color-border;
}

.chain-icon-comp {
img {
width: 28px;
Expand All @@ -203,13 +192,13 @@
margin-left: 12px;
}
&-name {
font-weight: 500;
font-size: 15px;
line-height: 18px;
color: @color-title;
font-weight: normal;
font-size: 14px;
line-height: 20px;
color: #ccc;
}
&-balance {
color: #707280;
color: #666;
font-size: 12px;
display: flex;
align-items: center;
Expand All @@ -223,9 +212,8 @@
margin-left: 16px;
}
&:hover {
// background: rgba(134, 151, 255, 0.1);
background-color: #dce0f9;
border: 1px solid #8697ff;
background-color: #1F1F1F;
border: 1px solid #333;
&::after {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/component/Popup/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
color: @color-title;
}
.ant-drawer-mask {
background-color: rgba(45, 48, 51, 0.2);
background-color: rgba(0, 0, 0, 0.4);
}
.ant-drawer-header {
background: transparent;
Expand Down
5 changes: 4 additions & 1 deletion src/ui/component/StrayFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ const StrayFooterNav = memo(
htmlType="submit"
onClick={onNextClick}
size="large"
className={cx('lg:h-[52px]', hasBack ? 'flex-1' : 'w-[200px]')}
className={cx(
'lg:h-[52px] main-button',
hasBack ? 'flex-1' : 'w-[200px]'
)}
type="primary"
loading={nextLoading}
>
Expand Down
Loading