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

Hotfix 1.13.4 - Party time is over #500

Merged
merged 1 commit into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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('can enter an amount into input', () => {
cy.get('#swap-currency-input .token-amount-input')
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
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 @@ -36,7 +36,6 @@ import getLibrary from 'utils/getLibrary'
import AppziButton from 'components/AppziButton'
import RadialGradientByChainUpdater from 'theme/RadialGradientByChainUpdater'
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 @@ -82,7 +81,6 @@ ReactDOM.render(
<Updaters />
<ThemeProvider>
<ThemedGlobalStyle />
<SideBanner type={BannerType.ANNIVERSARY} />
<AppziButton />
<App />
</ThemeProvider>
Expand Down