@frontity/mars-theme
Advanced tools
Comparing version 0.3.7 to 0.4.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.4.0](https://github.com/frontity/frontity/compare/@frontity/mars-theme@0.3.7...@frontity/mars-theme@0.4.0) (2019-05-28) | ||
### Features | ||
* **list:** adds support for author lists ([#93](https://github.com/frontity/frontity/issues/93)) ([85586ee](https://github.com/frontity/frontity/commit/85586ee)) | ||
## [0.3.7](https://github.com/frontity/frontity/compare/@frontity/mars-theme@0.3.6...@frontity/mars-theme@0.3.7) (2019-05-27) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@frontity/mars-theme", | ||
"version": "0.3.7", | ||
"version": "0.4.0", | ||
"description": "A starter theme for Frontity", | ||
@@ -24,5 +24,5 @@ "keywords": [ | ||
"@frontity/source": "^0.1.2", | ||
"frontity": "^0.2.13" | ||
"frontity": "^0.2.14" | ||
}, | ||
"gitHead": "d0dd801871ac6a46d2dca6949c88305da80cc97c" | ||
"gitHead": "3a385b62803cc4468c40550cda378d44da765c25" | ||
} |
@@ -15,5 +15,7 @@ import React from "react"; | ||
</Link> | ||
<Author> | ||
By <b>{author.name}</b> | ||
</Author> | ||
<Link path={author.link}> | ||
<Author> | ||
By <b>{author.name}</b> | ||
</Author> | ||
</Link> | ||
<Fecha> | ||
@@ -20,0 +22,0 @@ {" "} |
@@ -15,6 +15,9 @@ import React from "react"; | ||
{data.isTaxonomy && ( | ||
<Taxonomy> | ||
<Header> | ||
{data.taxonomy}: {state.source[data.taxonomy][data.id].name} | ||
</Taxonomy> | ||
</Header> | ||
)} | ||
{data.isAuthor && ( | ||
<Header>Author: {state.source.author[data.id].name}</Header> | ||
)} | ||
{items.map(({ type, id }) => { | ||
@@ -39,3 +42,3 @@ const item = state.source[type][id]; | ||
const Taxonomy = styled.h3` | ||
const Header = styled.h3` | ||
font-weight: 300; | ||
@@ -42,0 +45,0 @@ text-transform: capitalize; |
@@ -5,10 +5,10 @@ import React, { useEffect } from "react"; | ||
const Pages = ({ state, actions }) => { | ||
const Pagination = ({ state, actions }) => { | ||
const { totalPages } = state.source.data(state.router.path); | ||
const isNextPage = state.router.page < totalPages; | ||
const isPreviousPage = state.router.page > 1; | ||
const isThereNextPage = state.router.page < totalPages; | ||
const isTherePreviousPage = state.router.page > 1; | ||
// Fetch the next page if it hasn't been fetched yet. | ||
useEffect(() => { | ||
if (state.router.page < totalPages) | ||
if (isThereNextPage) | ||
actions.source.fetch({ | ||
@@ -22,3 +22,3 @@ path: state.router.path, | ||
<div> | ||
{isNextPage && ( | ||
{isThereNextPage && ( | ||
<Link path={state.router.path} page={state.router.page + 1}> | ||
@@ -28,4 +28,4 @@ <em>← Older posts</em> | ||
)} | ||
{isPreviousPage && isNextPage && " - "} | ||
{isPreviousPage && ( | ||
{isTherePreviousPage && isThereNextPage && " - "} | ||
{isTherePreviousPage && ( | ||
<Link path={state.router.path} page={state.router.page - 1}> | ||
@@ -39,2 +39,2 @@ <em>Newer posts →</em> | ||
export default connect(Pages); | ||
export default connect(Pagination); |
import React, { useEffect } from "react"; | ||
import { connect, styled } from "frontity"; | ||
import Link from "./link"; | ||
import List from "./list"; | ||
@@ -13,2 +14,3 @@ import FeaturedMedia from "./featured-media"; | ||
const author = state.source.author[post.author]; | ||
// Get a date for humans. | ||
const date = new Date(post.date); | ||
@@ -24,9 +26,11 @@ | ||
<Container> | ||
<Head> | ||
<div> | ||
<Title>{post.title.rendered}</Title> | ||
{data.isPost && ( | ||
<> | ||
<Author> | ||
By <b>{author.name}</b> | ||
</Author> | ||
<Link path={author.link}> | ||
<Author> | ||
By <b>{author.name}</b> | ||
</Author> | ||
</Link> | ||
<Fecha> | ||
@@ -38,3 +42,3 @@ {" "} | ||
)} | ||
</Head> | ||
</div> | ||
{state.theme.featured.showOnPost && ( | ||
@@ -60,4 +64,2 @@ <FeaturedMedia id={post.featured_media} /> | ||
const Head = styled.div``; | ||
const Title = styled.h1` | ||
@@ -64,0 +66,0 @@ margin: 0; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27986
502