-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add santa hat to unicorn logo for the holidays ๐
๐ผ (#3027)
* add santa hat to logo * make generic component * add 24th to christmas * oops
- Loading branch information
1 parent
587edf4
commit 458e04f
Showing
3 changed files
with
30 additions
and
0 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.
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,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 |
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