Skip to content

Commit

Permalink
Use Twemoji
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhannah committed Aug 5, 2021
1 parent 7a41821 commit 1006b07
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import "prismjs/themes/prism-solarizedlight.css"
import "typeface-varela-round"
import "./src/assets/css/footnotes.less"
import "./src/assets/css/gatsby-highlight.less"
import "./src/assets/css/twemoji.less"
import "./src/assets/css/jetbrains-mono.css"
import "./src/assets/css/libre-caslon-text.css"
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-twemoji": "^0.3.0",
"react-typography": "^0.16.20",
"rehype-react": "^6.2.0",
"remark-html": "^13.0.1",
"remark-parse": "^9.0.0",
"twemoji": "^13.1.0",
"typeface-varela-round": "1.1.13",
"typography": "^0.16.21",
"typography-theme-lincoln": "^0.16.19",
Expand Down
6 changes: 6 additions & 0 deletions src/assets/css/twemoji.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
img.emoji {
height: 1em;
width: 1em;
margin: 0 0.05em 0 0.1em;
vertical-align: -0.1em;
}
5 changes: 4 additions & 1 deletion src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styled from "@emotion/styled"
import { graphql, useStaticQuery } from "gatsby"
import * as React from "react"
import { Helmet } from "react-helmet"
import Twemoji from "react-twemoji"
import {
contentWidth,
contentWidthColumn,
Expand Down Expand Up @@ -72,7 +73,9 @@ export const Layout: React.FunctionComponent = ({ children }) => {
<meta property="twitter:creator" content={twitterCreator} />
</Helmet>
<Header {...{ title, fullname, pronouns }} />
<Main>{children}</Main>
<Main>
<Twemoji>{children}</Twemoji>
</Main>
<Footer {...{ fullname, pronouns }} />
</_Layout>
)
Expand Down
35 changes: 34 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6842,7 +6842,7 @@ fs-extra@^7.0.0:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^8.1.0:
fs-extra@^8.0.1, fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
Expand Down Expand Up @@ -9942,6 +9942,15 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"

jsonfile@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-5.0.0.tgz#e6b718f73da420d612823996fdf14a03f6ff6922"
integrity sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==
dependencies:
universalify "^0.1.2"
optionalDependencies:
graceful-fs "^4.1.6"

jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
Expand Down Expand Up @@ -13017,6 +13026,15 @@ react-test-renderer@^17.0.0:
react-shallow-renderer "^16.13.1"
scheduler "^0.20.1"

react-twemoji@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/react-twemoji/-/react-twemoji-0.3.0.tgz#8c8d5aedec8dda5cc0538043639073bcdd44c3a8"
integrity sha512-y2ZQD3KvpZklETxz9c1NycRdUVF5nKsJ0bPNW3SaRJT+ReK36sMcneYwRPfv9EK2p3s9ph/NczDglnB8wbMJ0g==
dependencies:
lodash.isequal "^4.5.0"
prop-types "^15.7.2"
twemoji "^13.0.1"

react-typography@^0.16.20:
version "0.16.20"
resolved "https://registry.yarnpkg.com/react-typography/-/react-typography-0.16.20.tgz#6861fef52ab3156eda334cbe110fb66646340f57"
Expand Down Expand Up @@ -15110,6 +15128,21 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"

[email protected]:
version "13.1.0"
resolved "https://registry.yarnpkg.com/twemoji-parser/-/twemoji-parser-13.1.0.tgz#65e7e449c59258791b22ac0b37077349127e3ea4"
integrity sha512-AQOzLJpYlpWMy8n+0ATyKKZzWlZBJN+G0C+5lhX7Ftc2PeEVdUU/7ns2Pn2vVje26AIZ/OHwFoUbdv6YYD/wGg==

twemoji@^13.0.1, twemoji@^13.1.0:
version "13.1.0"
resolved "https://registry.yarnpkg.com/twemoji/-/twemoji-13.1.0.tgz#65bb71e966dae56f0d42c30176f04cbdae109913"
integrity sha512-e3fZRl2S9UQQdBFLYXtTBT6o4vidJMnpWUAhJA+yLGR+kaUTZAt3PixC0cGvvxWSuq2MSz/o0rJraOXrWw/4Ew==
dependencies:
fs-extra "^8.0.1"
jsonfile "^5.0.0"
twemoji-parser "13.1.0"
universalify "^0.1.2"

type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
Expand Down

1 comment on commit 1006b07

@vercel
Copy link

@vercel vercel bot commented on 1006b07 Aug 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.