-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Progress of execution UI (#366) * add progressbar component * add warning * add alert icon * progressbar position * add CheckIcon * add pending status and styles * add AMMs component * fix duplicate import * add progressbar variant and enhancements * add message container and improve mobile view * change amms animation time * fix delay animtation * improvements, color, mobile * change clock colors * Fix wallet-connect double qr code * Fix for 1Inch and possibly some other wallets * Updated comments and disconnect error handling * Forcing wallet connect connector type * integrate Order progress bar UX * extract Cancel order button * fix incorrect amm state percentage * improve state handling and hide progress bar when order is cancelled * hide progress bar for expired orders * hide orders that are not pending * initialize progress bar with current percentage * AMMs logos per network * add GC AMMs logos * fix bao logo reference * Update yarn lock * Incerease update speed and improve message * Add rotating clock * Increase expected execution time * Add nose picking icon * Remove plural * Change message * make cow state always 30 seconds * use safe info to get better progress values * Revert "Merge remote-tracking branch 'origin/fix-walletconnect-double-qr-code_updated' into ramirotw/issue-392-integrate-progress-bar" This reverts commit 0410fc0, reversing changes made to c8e523d. * update lock from reverted merge Co-authored-by: Agustín Longoni <[email protected]> Co-authored-by: Alfetopito <[email protected]> Co-authored-by: nenadV91 <[email protected]> Co-authored-by: Anxo Rodriguez <[email protected]>
- Loading branch information
1 parent
ffe64f9
commit ef11602
Showing
15 changed files
with
547 additions
and
55 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import styled from 'styled-components/macro' | ||
import Sushi from 'assets/cow-swap/ammslogo/sushi.png' | ||
import Paraswap from 'assets/cow-swap/ammslogo/paraswap.png' | ||
import Oneinch from 'assets/cow-swap/ammslogo/1inch.png' | ||
import Uniswap from 'assets/cow-swap/ammslogo/uniswap.png' | ||
import Baoswap from 'assets/cow-swap/ammslogo/baoswap.png' | ||
import Honeyswap from 'assets/cow-swap/ammslogo/honeyswap.png' | ||
import Swapr from 'assets/cow-swap/ammslogo/swapr.png' | ||
import { SupportedChainId } from 'constants/chains' | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 24px; | ||
height: 24px; | ||
border-radius: 100%; | ||
box-shadow: 0px 0px 10px 2px ${({ theme }) => theme.bg1}; | ||
background-color: ${({ theme }) => theme.white}; | ||
transform-style: preserve-3d; | ||
position: absolute; | ||
top: -4px; | ||
right: 0px; | ||
img { | ||
position: absolute; | ||
left: 0; | ||
animation: FadeInOut 6s infinite; | ||
} | ||
@keyframes FadeInOut { | ||
0% { | ||
opacity: 1; | ||
} | ||
17% { | ||
opacity: 1; | ||
} | ||
25% { | ||
opacity: 0; | ||
} | ||
92% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
img:nth-of-type(1) { | ||
animation-delay: 6s; | ||
} | ||
img:nth-of-type(2) { | ||
animation-delay: 4.5s; | ||
} | ||
img:nth-of-type(3) { | ||
animation-delay: 3s; | ||
} | ||
img:nth-of-type(4) { | ||
animation-delay: 1.5s; | ||
} | ||
` | ||
|
||
type Image = { src: string; alt: string } | ||
|
||
const SushiImage = { src: Sushi, alt: 'AMMs Sushiswap' } | ||
const OneInchImage = { src: Oneinch, alt: 'AMMs 1inch' } | ||
const ParaswapImage = { src: Paraswap, alt: 'AMMs Paraswap' } | ||
const UniswapImage = { src: Uniswap, alt: 'AMMs Uniswap' } | ||
const BaoswapImage = { src: Baoswap, alt: 'AMMs Baoswap' } | ||
const HoneyswapImage = { src: Honeyswap, alt: 'AMMs Honeyswap' } | ||
const SwaprImage = { src: Swapr, alt: 'AMMs Swapr' } | ||
|
||
const LogosPerNetwork: Record<SupportedChainId, Array<Image>> = { | ||
[SupportedChainId.MAINNET]: [SushiImage, OneInchImage, ParaswapImage, UniswapImage], | ||
[SupportedChainId.RINKEBY]: [SushiImage, OneInchImage, ParaswapImage, UniswapImage], | ||
[SupportedChainId.XDAI]: [SushiImage, BaoswapImage, HoneyswapImage, SwaprImage], | ||
} | ||
|
||
export function AMMsLogo({ chainId }: { chainId: SupportedChainId }) { | ||
return ( | ||
<Wrapper> | ||
{LogosPerNetwork[chainId].map(({ src, alt }, index) => ( | ||
<img key={index} src={src} alt={alt} /> | ||
))} | ||
</Wrapper> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/custom/components/AccountDetails/Transaction/CancelButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useState } from 'react' | ||
import { LinkStyledButton } from 'theme' | ||
import { ActivityDerivedState } from './index' | ||
import { CancellationModal } from './CancelationModal' | ||
|
||
export function CancelButton(props: { chainId: number; activityDerivedState: ActivityDerivedState }) { | ||
const { activityDerivedState, chainId } = props | ||
const { id, summary } = activityDerivedState | ||
|
||
const [showCancelModal, setShowCancelModal] = useState(false) | ||
|
||
const onCancelClick = () => setShowCancelModal(true) | ||
const onDismiss = () => setShowCancelModal(false) | ||
|
||
return ( | ||
<> | ||
<LinkStyledButton onClick={onCancelClick}>Cancel order</LinkStyledButton>{' '} | ||
{showCancelModal && ( | ||
<CancellationModal | ||
chainId={chainId} | ||
orderId={id} | ||
summary={summary} | ||
isOpen={showCancelModal} | ||
onDismiss={onDismiss} | ||
/> | ||
)} | ||
</> | ||
) | ||
} |
Oops, something went wrong.