-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34c3a5b
commit 754bcca
Showing
25 changed files
with
232 additions
and
163 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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,53 @@ | ||
import React from 'react'; | ||
import Remarkable from 'remarkable'; | ||
import { Link } from 'react-router-dom'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import styles from './styles.scss'; | ||
|
||
const remarkable = new Remarkable({ | ||
html: true, | ||
breaks: true, | ||
linkify: true, | ||
typographer: false, | ||
quotes: '“”‘’', | ||
}); | ||
|
||
const PostBody = ({ | ||
className, body, author, permlink, minify, ...props | ||
}) => ( | ||
<div className={`${className} ${styles.container}`} {...props}> | ||
<div | ||
className={`${minify ? styles.minify : ''} ${styles.bodyContainer}`} | ||
dangerouslySetInnerHTML={{ __html: remarkable.render(body) }} | ||
/> | ||
{ | ||
minify | ||
&& ( | ||
<div className={['uk-text-center', styles.articleReadMore].join(' ')}> | ||
<Link | ||
to={`/@${author}/${permlink}`} | ||
className={[styles.readMoreText].join(' ')} | ||
> | ||
READ MORE | ||
</Link> | ||
</div> | ||
) | ||
} | ||
</div> | ||
); | ||
|
||
PostBody.propTypes = { | ||
className: PropTypes.string, | ||
body: PropTypes.string.isRequired, | ||
author: PropTypes.string.isRequired, | ||
permlink: PropTypes.string.isRequired, | ||
minify: PropTypes.bool, | ||
}; | ||
|
||
PostBody.defaultProps = { | ||
className: '', | ||
minify: false, | ||
}; | ||
|
||
export default PostBody; |
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,56 @@ | ||
@import "../../index.scss"; | ||
|
||
.container { | ||
padding: 0 24px; | ||
} | ||
|
||
.bodyContainer { | ||
font-size: 16px; | ||
color: rgba(0,0,0,0.54); | ||
line-height: 24px; | ||
} | ||
|
||
.bodyContainer h1 { | ||
font-family: Roboto-Medium; | ||
font-size: 36px; | ||
color: $primary-color; | ||
line-height: 54px; | ||
} | ||
|
||
.bodyContainer h2 { | ||
font-family: Roboto; | ||
font-size: 18px; | ||
color: $primary-color; | ||
line-height: 30px; | ||
} | ||
|
||
.articleReadMore { | ||
margin-top: -16px; | ||
padding: 8px 0; | ||
background-color: rgba(255, 255, 255, 0.9); | ||
color: #3F72AF; | ||
letter-spacing: 2px; | ||
font-weight: 500; | ||
position: relative; | ||
cursor: pointer; | ||
} | ||
|
||
.readMoreText { | ||
padding: 4px 8px; | ||
color: rgba(0, 0, 0, 0.54); | ||
background: white; | ||
border: 1px solid rgba(0, 0, 0, 0.24); | ||
border-radius: 4px; | ||
transition: all 0.3s; | ||
} | ||
|
||
.readMoreText:hover { | ||
background-color: $primary-color; | ||
color: white; | ||
transition: all 0.3s; | ||
} | ||
|
||
.minify { | ||
max-height: 380px; | ||
overflow: hidden; | ||
} |
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
File renamed without changes.
Oops, something went wrong.