-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial tagger app with posts loaded via API
Loading posts from API via global axios instance. Lazy conditional rendering of placeholder for loading state. Appending posts to the posts array so they can lazy loaded and iterated later.
- Loading branch information
Showing
5 changed files
with
109 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
function Controls(props) { | ||
return( | ||
<div className="post-controls"> | ||
<button><- Prev</button> | ||
Some stuff ought to go here | ||
<button>Next -></button> | ||
</div> | ||
) | ||
} | ||
|
||
export default Controls; |
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 @@ | ||
import React from 'react'; | ||
import Tag from './tag.js'; | ||
|
||
function Post(props) { | ||
return( | ||
<div className="post"> | ||
<h3>{props.post.Description}</h3> | ||
<p><a href={props.post.Url}>{props.post.Url}</a></p> | ||
<p className="post-description">{props.post.Extended}</p> | ||
<p>{props.post.Tags.map((t) => { | ||
return( | ||
<Tag key={t} tag={t} /> | ||
); | ||
}) | ||
}</p> | ||
</div> | ||
); | ||
} | ||
|
||
export default Post; |
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,9 @@ | ||
import React from 'react'; | ||
|
||
function Tag(props) { | ||
return( | ||
<span className="post-tag">{props.tag} | x</span> | ||
) | ||
} | ||
|
||
export default Tag; |
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