Skip to content

Commit

Permalink
Merge pull request #24 from andela/ch-beautify-homepage-162693578
Browse files Browse the repository at this point in the history
#162693578 Make a better first impression on the homepage
  • Loading branch information
tibetegya committed Dec 20, 2018
2 parents cf70d30 + a202554 commit cea3572
Show file tree
Hide file tree
Showing 24 changed files with 852 additions and 374 deletions.
2 changes: 1 addition & 1 deletion src/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ exports[`Provider and App renders <Provider/> correctly 2`] = `
path="/profiles/edit"
/>
</Switch>
<Footer />
<Connect(Footer) />
</BrowserRouter>
`;
6 changes: 6 additions & 0 deletions src/commons/initialStates.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@ export const initialStateWithSample2 = {
article: sampleArticle2,
};

export const sampleListOfArticles = [
sampleArticle, { ...sampleArticle, id: 2 }, { ...sampleArticle, id: 3 },
{ ...sampleArticle, id: 4 }, { ...sampleArticle, id: 5 }, { ...sampleArticle, id: 6 },
{ ...sampleArticle, id: 7 }, { ...sampleArticle, id: 8 }, { ...sampleArticle, id: 9 },
];

export default initialState;
8 changes: 4 additions & 4 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { library } from '@fortawesome/fontawesome-svg-core';
import { faSearch } from '@fortawesome/free-solid-svg-icons';
import Home from '../Home';
import Login from '../Login/index';
import LoginPage from '../../containers/LoginPage';
import Header from '../Header';
import { Footer } from '../Footer';
import FooterConnected from '../../containers/Footer';
import SignUpPageConnected from '../../containers/SignUpPage';
import Articles from '../../containers/Articles';
import ArticlePageConnected from '../../containers/ArticlePage';
Expand All @@ -19,14 +19,14 @@ const App = () => (
<Header />
<Switch>
<Route exact path="/" component={Home} />
<Route path="/login" component={Login} />
<Route path="/login" component={LoginPage} />
<Route path="/signup" component={SignUpPageConnected} />
<Route path="/articles" component={Articles} />
<Route path="/article/:articleId" component={ArticlePageConnected} />
<Route path="/profile" component={ProfileConnected} />
<Route path="/profiles/edit" component={EditProfilePageConnected} />
</Switch>
<Footer />
<FooterConnected />
</React.Fragment>
</BrowserRouter>
);
Expand Down
6 changes: 5 additions & 1 deletion src/components/Article/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ exports[`<Article /> should render correctly 1`] = `
<div
className="author"
>
janedoe
<a
href="profiles/janedoe"
>
janedoe
</a>
</div>
</span>
<span
Expand Down
11 changes: 6 additions & 5 deletions src/components/Article/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ const createIconSection = (icon, cssClass, content) => (

const Article = ({ onLikeDislike, article }) => {
const iconSections = [
{
icon: 'user',
cssClass: 'author',
content: article.author.username,
},
{
icon: 'clock',
cssClass: 'readtime',
Expand Down Expand Up @@ -54,6 +49,12 @@ const Article = ({ onLikeDislike, article }) => {
<img src={article.image_url} alt="poster" />
</div>
<div className="article-small-details">
<span key="author">
<FontAwesomeIcon icon="user" />
<div className="author">
<a href={`profiles/${article.author.username}`}>{article.author.username}</a>
</div>
</span>
{iconSections.map(el => createIconSection(el.icon, el.cssClass, el.content))}
</div>
<div className="article-taglist">
Expand Down
27 changes: 19 additions & 8 deletions src/components/Articles/Articles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
$primaryLight: #40e0d0;
$primaryDark: #20c0b0;
$primaryDarker: #345F5B;

.articles-body {
display: flex;
flex-flow: row wrap;
Expand Down Expand Up @@ -48,15 +52,22 @@
.date-section {
}
.read-more {
border-radius: 5px;
// border: 1px solid red;
width: 40%;
background: #47d79f;
color: white;
text-align: center;
padding-top: 20px;

a{
color: #efefef;
}
a {
border-radius: 5px;
background: $primaryLight;
color: #efefef;
text-align: center;
padding: 5px 10px;
}
a:hover {
text-decoration: none;
border: 1px solid $primaryLight;
background: white;
color: $primaryDark;
}
}
}
}
235 changes: 0 additions & 235 deletions src/components/Footer/__snapshots__/footer.test.js.snap

This file was deleted.

14 changes: 0 additions & 14 deletions src/components/Footer/footer.test.js

This file was deleted.

Loading

0 comments on commit cea3572

Please sign in to comment.