-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature(Create and Get all Articles): Enable user to create and view …
…articles [Starts: #167484551]
- Loading branch information
Musinda Kadhuwa
committed
Oct 11, 2019
1 parent
c383a00
commit 79129af
Showing
26 changed files
with
608 additions
and
141 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,29 @@ | ||
export default { | ||
payload: { | ||
title: 'Growth mindset', | ||
description: 'How to demonstrate growth mindsewt', | ||
tags: 'education', | ||
category: 'Eductaion', | ||
body: | ||
'is simply dummy text of the printing and typesetting industry Lorem Ipsum has' | ||
}, | ||
|
||
returnedArticle: { | ||
author: { | ||
bio: null, | ||
firstName: 'Carlos', | ||
image: null, | ||
lastName: 'Gringo', | ||
userName: 'carlosG' | ||
}, | ||
authorId: 3, | ||
blocked: false, | ||
slug: 'tech-world-becoming-a-village-2lk1kg3x3y', | ||
body: | ||
"<h2>Where can I get some?</h2><p>There are many variations of injected humour, or non-characteristic</p><figure class='image'><img src='http://res.cloudinary.com/jkadhuwa/image/upload/v1570696434/buxtk2bswoki2jhiwtr5.png'></figure>", | ||
category: 'Education', | ||
createdAt: '2019-10-10T08:34:04.511Z', | ||
description: | ||
'I like creating a fontawesome.js in the src folder and then importing that into index.js. Feel free to add this file wherever as long as the components you want to use the icons in have access (are child components).' | ||
} | ||
}; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,20 @@ | ||
/* istanbul ignore file */ | ||
import ReactHtmlParser from 'react-html-parser'; | ||
import defaultImage from '../common/images/defaultImage.png'; | ||
|
||
const getImage = body => { | ||
const image = ReactHtmlParser(body); | ||
let imgUrl; | ||
|
||
image.forEach(img => { | ||
if (img.type === 'figure') { | ||
imgUrl = img.props.children[0].props.src; | ||
} | ||
}); | ||
if (imgUrl) { | ||
return imgUrl; | ||
} | ||
return defaultImage; | ||
}; | ||
|
||
export default getImage; |
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
Oops, something went wrong.