-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to create pages for an md file
- Loading branch information
1 parent
a2451ae
commit a68f7f4
Showing
11 changed files
with
900 additions
and
59 deletions.
There are no files selected for viewing
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
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
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
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
12 changes: 6 additions & 6 deletions
12
...n/components/layouts/pages/about/About.js → ...ayouts/pages/markdownPage/MarkdownPage.js
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { marked } from 'marked'; | ||
|
||
import './About.scss'; | ||
import './MarkdownPage.scss'; | ||
|
||
function About() { | ||
function MarkdownPage({ fileName }) { | ||
const [content, setContent] = useState(''); | ||
useEffect(() => { | ||
const fetchFile = async () => { | ||
const file = await fetch(process.env.PUBLIC_URL + '/ABOUT.md'); | ||
const file = await fetch(process.env.PUBLIC_URL + `/${fileName}.md`); | ||
const content = await file.text(); | ||
setContent(marked(content)); | ||
}; | ||
fetchFile().catch(console.error); | ||
}, []); | ||
}, [fileName]); | ||
return ( | ||
<section className="about"> | ||
<section className="markdown"> | ||
<div dangerouslySetInnerHTML={{ __html: content }} /> | ||
</section> | ||
); | ||
} | ||
|
||
export default About; | ||
export default MarkdownPage; |
2 changes: 1 addition & 1 deletion
2
...components/layouts/pages/about/About.scss → ...outs/pages/markdownPage/MarkdownPage.scss
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.about { | ||
.markdown { | ||
padding: 0 20px; | ||
|
||
a { | ||
|
23 changes: 0 additions & 23 deletions
23
src/common/components/layouts/pages/privacyPolicy/PrivacyPolicy.js
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/common/components/layouts/pages/privacyPolicy/PrivacyPolicy.scss
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.