From 8b7f13ab75a9cbd7ad1789eb4cf96cd0c7b886c9 Mon Sep 17 00:00:00 2001 From: hannut91 Date: Sun, 9 Aug 2020 20:38:49 +0900 Subject: [PATCH] Extract global style to component Extract global style to component. --- src/App.jsx | 18 ++---------------- src/GlobalStyle.jsx | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 src/GlobalStyle.jsx diff --git a/src/App.jsx b/src/App.jsx index 956b4d3..382896b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,25 +7,11 @@ import { } from 'react-router-dom'; import styled from '@emotion/styled'; -import { Global, css } from '@emotion/core'; +import GlobalStyle from './GlobalStyle'; import RetrospectivesPage from './RetrospectivesPage'; import WritingPage from './WritingPage'; -const GlobalStyles = css` - @font-face { - font-family: 'MapoFlowerIsland'; - src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/MapoFlowerIslandA.woff') - format('woff'); - font-weight: normal; - font-style: normal; - } - - * { - font-family: 'MapoFlowerIsland'; - } -`; - const Header = styled.div({ margin: '5em 10em', }); @@ -33,7 +19,7 @@ const Header = styled.div({ export default function App() { return ( <> - +

함께 회,고(Go) 해요. diff --git a/src/GlobalStyle.jsx b/src/GlobalStyle.jsx new file mode 100644 index 0000000..b71e789 --- /dev/null +++ b/src/GlobalStyle.jsx @@ -0,0 +1,21 @@ +import React from 'react'; + +import { Global, css } from '@emotion/core'; + +const GlobalStyles = css` +@font-face { + font-family: 'MapoFlowerIsland'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/MapoFlowerIslandA.woff') + format('woff'); + font-weight: normal; + font-style: normal; +} + +* { + font-family: 'MapoFlowerIsland'; +} +`; + +export default function GlobalStyle() { + return ; +}