Skip to content

Commit

Permalink
feat: add santa hat to unicorn logo for the holidays ๐ŸŽ…๐Ÿผ (#3027)
Browse files Browse the repository at this point in the history
* add santa hat to logo

* make generic component

* add 24th to christmas

* oops
  • Loading branch information
tinaszheng authored Dec 22, 2021
1 parent 587edf4 commit 458e04f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Binary file added src/assets/images/santa-hat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/components/Header/HolidayOrnament.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ReactElement } from 'react'
import styled from 'styled-components/macro'

import SantaHat from '../../assets/images/santa-hat.png'

const SantaHatImage = styled.img`
position: absolute;
top: -4px;
right: -4px;
height: 18px;
`

const Christmas = <SantaHatImage src={SantaHat} alt="Santa hat" />

const DATE_TO_ORNAMENT: { [date: string]: ReactElement } = {
'12-24': Christmas,
'12-25': Christmas,
}

const HolidayOrnament = () => {
// months in javascript are 0 indexed...
const today = `${new Date().getMonth() + 1}-${new Date().getDate()}`
return DATE_TO_ORNAMENT[today] || null
}

export default HolidayOrnament
4 changes: 4 additions & 0 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Menu from '../Menu'
import Row from '../Row'
import { Dots } from '../swap/styleds'
import Web3Status from '../Web3Status'
import HolidayOrnament from './HolidayOrnament'
import NetworkSelector from './NetworkSelector'

const HeaderFrame = styled.div<{ showBackground: boolean }>`
Expand Down Expand Up @@ -178,6 +179,8 @@ const UniIcon = styled.div`
:hover {
transform: rotate(-5deg);
}
position: relative;
`

const activeClassName = 'ACTIVE'
Expand Down Expand Up @@ -270,6 +273,7 @@ export default function Header() {
<Title href=".">
<UniIcon>
<Logo fill={darkMode ? white : black} width="24px" height="100%" title="logo" />
<HolidayOrnament />
</UniIcon>
</Title>
<HeaderLinks>
Expand Down

0 comments on commit 458e04f

Please sign in to comment.