Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed May 2, 2022
2 parents 85088ce + cee4696 commit 4324195
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 29 deletions.
3 changes: 0 additions & 3 deletions cypress-custom/integration/fee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ describe('Fee: Complex fetch and persist fee', () => {
// GIVEN: user visits app, selects 0.1 WETH as sell, DAI as buy
// and goes AFK
cy.visit('/swap')
cy.get('#anniversary-banner > svg').click()
cy.swapSelectOutput(DAI)
cy.swapEnterInputAmount(DEFAULT_SELL_TOKEN.address, INPUT_AMOUNT)

Expand Down Expand Up @@ -173,7 +172,6 @@ describe('Fee: simple checks it exists', () => {
// GIVEN: A user loads the swap page
// WHEN: Select DAI token as output and sells 0.1 WETH
cy.visit('/swap')
cy.get('#anniversary-banner > svg').click()
cy.swapSelectOutput(DAI)
cy.swapEnterInputAmount(DEFAULT_SELL_TOKEN.address, INPUT_AMOUNT)

Expand All @@ -186,7 +184,6 @@ describe('Swap: Considering fee', () => {
beforeEach(() => {
// GIVEN: an initial selection of WETH-DAI
cy.visit('/swap')
cy.get('#anniversary-banner > svg').click()
})

it("Uses Uniswap price, if there's no tip", () => {
Expand Down
1 change: 0 additions & 1 deletion cypress-custom/integration/swapMod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe('Swap (mod)', () => {
beforeEach(() => {
cy.visit('/swap')
cy.get('#anniversary-banner > svg').click()
})

it('starts with an Native/USDC swap and quotes it', () => {
Expand Down
1 change: 0 additions & 1 deletion cypress/integration/lists.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe('Lists', () => {
beforeEach(() => {
cy.visit('/swap')
cy.get('#anniversary-banner > svg').click()
})

// @TODO check if default lists are active when we have them
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"types": "./dist/widgets.d.ts",
"private": true,
"version": "1.13.3",
"version": "1.13.4",
"engines": {
"node": ">=14.0.0"
},
Expand Down
Binary file removed public/audio/success-alex.mp3
Binary file not shown.
Binary file removed public/audio/success-martin.mp3
Binary file not shown.
16 changes: 2 additions & 14 deletions src/custom/components/SideBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { transparentize } from 'polished'
import SVG from 'react-inlinesvg'
import { CloseIcon, ExternalLink } from 'theme'
import { IS_SIDE_BANNER_VISIBLE_KEY } from '@src/constants/misc'
import { getCowSoundAnniversary } from 'utils/sound'

const WIDTH = 440
const HEIGHT = 440
Expand All @@ -22,14 +21,6 @@ export interface BannerProps {
type: BannerType
}

function playAnniversarySound() {
getCowSoundAnniversary()
.play()
.catch((e) => {
console.error('🐮 [SideBanner] Celebration sound cannot be played', e)
})
}

const Banner = styled.div<{ isActive: boolean }>`
position: fixed;
width: ${`${WIDTH}px`};
Expand Down Expand Up @@ -172,7 +163,7 @@ export default function SideBanner({ type }: BannerProps) {
}, [isActive])

return (
<Banner isActive={isActive} id={'anniversary-banner'}>
<Banner isActive={isActive}>
{type === 'anniversary' && (
<BannerContainer>
<ReactConfetti numberOfPieces={25} width={WIDTH} height={HEIGHT} recycle={true} run={true} />
Expand All @@ -184,10 +175,7 @@ export default function SideBanner({ type }: BannerProps) {
<img src={AnniversaryImage} height="162" alt="CowSwap evolving icons" />
<FooterContent>
<p>Share and be eligible for a celebratory NFT!</p>
<ExternalLink
href={`https://twitter.com/intent/tweet?text=${ANNIVERSARY_TWEET_TEMPLATE}`}
onClickOptional={playAnniversarySound}
>
<ExternalLink href={`https://twitter.com/intent/tweet?text=${ANNIVERSARY_TWEET_TEMPLATE}`}>
<button>
<StyledTwitterIcon src={TwitterImage} height="18" width="18" description="Share CowSwap on Twitter" />
Share on Twitter
Expand Down
9 changes: 2 additions & 7 deletions src/custom/utils/sound.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
type SoundType = 'SEND' | 'SUCCESS' | 'SUCCESS_CLAIM' | 'ERROR' | 'ANNIVERSARY'
type SoundType = 'SEND' | 'SUCCESS' | 'SUCCESS_CLAIM' | 'ERROR'
type Sounds = Record<SoundType, string>

const COW_SOUNDS: Sounds = {
SEND: '/audio/send.mp3',
SUCCESS: '/audio/success-alex.mp3',
ANNIVERSARY: '/audio/success-martin.mp3',
SUCCESS: '/audio/success.mp3',
SUCCESS_CLAIM: '/audio/success-claim.mp3',
ERROR: '/audio/error.mp3',
}
Expand Down Expand Up @@ -38,7 +37,3 @@ export function getCowSoundSuccessClaim(): HTMLAudioElement {
export function getCowSoundError(): HTMLAudioElement {
return getAudio('ERROR')
}

export function getCowSoundAnniversary(): HTMLAudioElement {
return getAudio('ANNIVERSARY')
}
2 changes: 0 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
// import { EventUpdater } from 'state/orders/mocks'
import AppziButton from 'components/AppziButton'
import { nodeRemoveChildFix } from 'utils/node'
import SideBanner, { BannerType } from 'components/SideBanner'

// Node removeChild hackaround
// based on: https://github.com/facebook/react/issues/11538#issuecomment-417504600
Expand Down Expand Up @@ -87,7 +86,6 @@ ReactDOM.render(
<Updaters />
<ThemeProvider>
<ThemedGlobalStyle />
<SideBanner type={BannerType.ANNIVERSARY} />
<AppziButton />
<App />
</ThemeProvider>
Expand Down

0 comments on commit 4324195

Please sign in to comment.