Skip to content

Commit

Permalink
Merge pull request #8 from viaprotocol/swap-flow-redesigned
Browse files Browse the repository at this point in the history
Swap flow redesigned
  • Loading branch information
iower authored Oct 6, 2023
2 parents 78fdef8 + 4ac235e commit 001e83b
Show file tree
Hide file tree
Showing 69 changed files with 348 additions and 329 deletions.
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
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

0 comments on commit 001e83b

Please sign in to comment.