- {/* If the post has an author, we render a clickable author text. */}
+
{author && (
-
+
By {author.name}
)}
-
- {' '}
- on {date.toDateString()}
+
+ {date.toDateString()}
-
+
- {/*
- * If the want to show featured media in the
- * list of featured posts, we render the media.
- */}
{state.theme.featured.showOnList && (
-
+
+
+
)}
{/* If the post has an excerpt (short summary text), we render it */}
{item.excerpt && (
-
+
+
+
)}
-
+
);
};
diff --git a/packages/nnk/src/components/core/List/list.js b/packages/nnk/src/components/core/List/list.js
index c0c913b..c6a82e6 100644
--- a/packages/nnk/src/components/core/List/list.js
+++ b/packages/nnk/src/components/core/List/list.js
@@ -1,36 +1,30 @@
import React from 'react';
-import { connect, styled, decode } from 'frontity';
-import { any } from 'prop-types';
+import { connect, decode } from 'frontity';
import Item from './list-item';
import Pagination from './pagination';
import { Container, Header } from './styles';
import { StatePropType } from '../../../types';
const List = ({ state }) => {
- // Get the data of the current list.
+ const { colors } = state.theme;
const data = state.source.get(state.router.link);
return (
{/* If the list is a taxonomy, we render a title. */}
{data.isTaxonomy && (
-
+
{data.taxonomy}:{' '}
{decode(state.source[data.taxonomy][data.id].name)}
)}
-
- {/* If the list is for a specific author, we render a title. */}
{data.isAuthor && (
-
+
Author: {decode(state.source.author[data.id].name)}
)}
-
- {/* Iterate over the items of the list. */}
{data.items.map(({ type, id }) => {
const item = state.source[type][id];
- // Render one Item component for each one.
return ;
})}
diff --git a/packages/nnk/src/components/core/List/pagination.js b/packages/nnk/src/components/core/List/pagination.js
index a10d912..9ce1af9 100644
--- a/packages/nnk/src/components/core/List/pagination.js
+++ b/packages/nnk/src/components/core/List/pagination.js
@@ -13,6 +13,7 @@ import { ActionsPropType, StatePropType } from '../../../types';
* when we wrap this component in `connect(...)`
*/
const Pagination = ({ state, actions }) => {
+ const { colors } = state.theme;
// Get the total posts to be displayed based for the current link
const { next, previous } = state.source.get(state.router.link);
@@ -28,7 +29,7 @@ const Pagination = ({ state, actions }) => {
{/* If there's a next page, render this link */}
{next && (
- ← Older posts
+ ← Older posts
)}
@@ -37,7 +38,7 @@ const Pagination = ({ state, actions }) => {
{/* If there's a previous page, render this link */}
{previous && (
- Newer posts →
+ Newer posts →
)}
diff --git a/packages/nnk/src/components/core/List/styles.js b/packages/nnk/src/components/core/List/styles.js
index 18b8948..9e43f9d 100644
--- a/packages/nnk/src/components/core/List/styles.js
+++ b/packages/nnk/src/components/core/List/styles.js
@@ -1,34 +1,82 @@
-import { styled } from 'frontity';
+import { css, styled } from 'frontity';
+import { sizeMedium } from '../../../setup/themes';
import Link from '../Link';
// --- List Item
-export const Title = styled.h1`
+export const ArticleWrapper = styled.article`
+ ${({ isReport, colors }) =>
+ isReport &&
+ css`
+ margin: 30px auto;
+ border: 1px solid ${colors.primary};
+ box-shadow: 0 0 10px 2px ${colors.secondary};
+ ${'' /* background: white; */}
+
+ &:hover: {
+ border: 2px solid ${colors.terciary};
+ }
+ `}
+`;
+
+export const Title = styled.h3`
font-size: 2rem;
- color: rgba(12, 17, 43);
margin: 0;
padding-top: 24px;
padding-bottom: 8px;
box-sizing: border-box;
+
+ ${({ isReport, colors }) =>
+ isReport &&
+ css`
+ width: 100%;
+ text-align: center;
+ color: ${colors.terciary};
+ `}
`;
export const AuthorName = styled.span`
- color: rgba(12, 17, 43, 0.9);
font-size: 0.9em;
`;
+export const InfoBox = styled.div`
+ ${({ isReport }) =>
+ isReport &&
+ css`
+ display: flex;
+ flex-direction: column;
+ margin: 0;
+ align-items: center;
+ text-align: justify;
+ `}
+`;
+
export const StyledLink = styled(Link)`
padding: 15px 0;
`;
export const PublishDate = styled.span`
- color: rgba(12, 17, 43, 0.9);
font-size: 0.9em;
+ ${({ isReport, colors }) =>
+ isReport &&
+ css`
+ color: ${colors.secondary};
+ text-align: center;
+ `}
`;
export const Excerpt = styled.div`
line-height: 1.6em;
- color: rgba(12, 17, 43, 0.8);
+
+ ${({ isReport }) =>
+ isReport &&
+ css`
+ display: flex;
+ flex-direction: column;
+ margin: 20px 30px;
+ align-items: center;
+ text-align: justify;
+ `}
`;
// --- List
@@ -43,12 +91,13 @@ export const Container = styled.section`
export const Header = styled.h3`
font-weight: 300;
text-transform: capitalize;
- color: rgba(12, 17, 43, 0.9);
+ color: ${({ colors }) => colors && colors.secondary};
`;
// -- Pagination
export const Text = styled.em`
display: inline-block;
- margin-top: 16px;
+ margin-top: 30px;
+ color: ${({ colors }) => colors && colors.terciary};
`;
diff --git a/packages/nnk/src/components/core/Post/index.js b/packages/nnk/src/components/core/Post/index.js
index 80015f7..a6f4fb0 100644
--- a/packages/nnk/src/components/core/Post/index.js
+++ b/packages/nnk/src/components/core/Post/index.js
@@ -9,26 +9,25 @@ import {
Content,
DateWrapper,
StyledLink,
- Title
+ Title,
+ BackToReports
} from './styles';
import {
ActionsPropType,
LibrariesPropTypes,
StatePropType
} from '../../../types';
+import { ACTIONS_TEXTS } from '../../../db';
const Post = ({ state, actions, libraries }) => {
- // Get information about the current URL.
+ const { colors, language } = state.theme;
const data = state.source.get(state.router.link);
- // Get the data of the post.
const post = state.source[data.type][data.id];
- // Get the data of the author.
const author = state.source.author[post.author];
- // Get a human readable date.
const date = new Date(post.date);
-
- // Get the html2react component.
const Html2React = libraries.html2react.Component;
+ const isReport = post.slug.includes('report');
+ const texts = ACTIONS_TEXTS[language];
/**
* Once the post has loaded in the DOM, prefetch both the
@@ -40,25 +39,33 @@ const Post = ({ state, actions, libraries }) => {
List.preload();
}, []);
- // Load the post, but only if the data is ready.
return data.isReady ? (
+ {isReport && (
+
+ {`<< ${texts.backToReports}`}
+
+ )}
-
+
{/* Only display author and date on posts */}
{data.isPost && (
{author && (
-
+
By {author.name}
)}
-
+
{' '}
- on {date.toDateString()}
+ Published on {date.toDateString()}
)}
@@ -71,7 +78,7 @@ const Post = ({ state, actions, libraries }) => {
{/* Render the content using the Html2React component so the HTML is processed
by the processors we included in the libraries.html2react.processors array. */}
-
+
diff --git a/packages/nnk/src/components/core/Post/styles.js b/packages/nnk/src/components/core/Post/styles.js
index a485707..0c9d930 100644
--- a/packages/nnk/src/components/core/Post/styles.js
+++ b/packages/nnk/src/components/core/Post/styles.js
@@ -1,4 +1,5 @@
-import { styled } from 'frontity';
+import { css, styled } from 'frontity';
+import { sizeLargeTitle } from '../../../setup/themes';
import Link from '../Link';
export const Container = styled.div`
@@ -12,7 +13,13 @@ export const Title = styled.h1`
margin: 0;
margin-top: 24px;
margin-bottom: 8px;
- color: rgba(12, 17, 43);
+ color: ${({ colors }) => colors && colors.terciary};
+
+ ${({ isReport }) =>
+ isReport &&
+ css`
+ font-size: ${sizeLargeTitle};
+ `}
`;
Title.displayName = 'Title';
@@ -21,17 +28,22 @@ export const StyledLink = styled(Link)`
`;
StyledLink.displayName = 'StyledLink';
+export const BackToReports = styled.div`
+ color: ${({ colors }) => colors && colors.terciary};
+`;
+BackToReports.displayName = 'BackToReports';
+
export const Author = styled.p`
display: inline;
font-size: 0.9em;
- color: rgba(12, 17, 43, 0.9);
+ color: ${({ colors }) => colors && colors.secondary};
`;
Author.displayName = 'Author';
export const DateWrapper = styled.p`
display: inline;
font-size: 0.9em;
- color: rgba(12, 17, 43, 0.9);
+ color: ${({ colors }) => colors && colors.secondary};
`;
DateWrapper.displayName = 'DateWrapper';
@@ -41,7 +53,13 @@ DateWrapper.displayName = 'DateWrapper';
*/
export const Content = styled.div`
word-break: break-word;
- color: rgba(12, 17, 43, 0.8);
+ color: ${({ colors }) => colors && colors.secondary};
+ ${({ isReport }) =>
+ isReport &&
+ css`
+ margin: 40px auto;
+ text-align: justify;
+ `}
/* WordPress Core Align Classes */
@@ -74,7 +92,31 @@ export const Content = styled.div`
}
p {
- line-height: 1.6em;
+ line-height: 2;
+ margin: 20px auto;
+ width: 100%;
+ }
+
+ span {
+ line-height: 2;
+ margin: 20px auto;
+ }
+
+ li:not([class]),
+ a[class=''] {
+ line-height: 1.5;
+ margin-left: 50px;
+ list-style: disc;
+ }
+
+ span {
+ line-height: 2;
+ margin: 20px auto;
+ }
+
+ form {
+ margin: 30px auto;
+ margin-left: 50px;
}
img {
@@ -106,8 +148,27 @@ export const Content = styled.div`
}
a {
- text-decoration: underline;
- color: rgb(31, 56, 197);
+ text-decoration: none;
+ color: #26b9ff;
+ width: 100%;
+
+ & button {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ color: white;
+ }
+ }
+
+ button {
+ margin: 10px auto 40px;
+ background: crimson;
+ border: 1px solid red;
+ border-radius: 10px;
+ padding: 5px 10px;
+ cursor: pointer;
+ text-align: center;
}
/* Input fields styles */
@@ -143,7 +204,7 @@ export const Content = styled.div`
display: inline-block;
border: 1px solid #1f38c5;
border-radius: 4px;
- margin-bottom: 0;
+ margin: 30px 0 10px 0;
background-image: none;
background-color: #1f38c5;
padding: 12px 36px;
diff --git a/packages/nnk/src/components/views/Footer/styles.js b/packages/nnk/src/components/views/Footer/styles.js
index 8204544..4960b07 100644
--- a/packages/nnk/src/components/views/Footer/styles.js
+++ b/packages/nnk/src/components/views/Footer/styles.js
@@ -1,5 +1,4 @@
import { styled } from 'frontity';
-import Link from '../../core/Link';
export const FooterContainer = styled.div`
display: flex;
diff --git a/packages/nnk/src/components/views/ReportItem/index.js b/packages/nnk/src/components/views/ReportItem/index.js
new file mode 100644
index 0000000..e5b05df
--- /dev/null
+++ b/packages/nnk/src/components/views/ReportItem/index.js
@@ -0,0 +1,50 @@
+import React, { useEffect, useState } from 'react';
+import { string } from 'prop-types';
+import { connect } from 'frontity';
+import { Report, ReportImage, ReportTitle } from './styles';
+import { StatePropType } from '../../../types';
+import { fetchData } from '../../../utils';
+import Link from '../../core/Link';
+
+const ReportItem = ({ state, url }) => {
+ const [report, setReport] = useState();
+
+ useEffect(() => {
+ fetchData(url)
+ .then(resp => {
+ setReport(resp[0]);
+ })
+ .catch(error =>
+ console.error(`Failed to get report from ${URL}. ${error}.`)
+ );
+ }, [url]);
+
+ const transformLink = link => link.split('https://www.borderviolence.eu')[1];
+
+ return (
+ <>
+ {report && (
+
+
+
+
+
+
+ )}
+ >
+ );
+};
+
+ReportItem.propTypes = {
+ state: StatePropType.isRequired,
+ url: string.isRequired
+};
+
+export default connect(ReportItem);
diff --git a/packages/nnk/src/components/views/ReportItem/styles.js b/packages/nnk/src/components/views/ReportItem/styles.js
new file mode 100644
index 0000000..9a763be
--- /dev/null
+++ b/packages/nnk/src/components/views/ReportItem/styles.js
@@ -0,0 +1,27 @@
+import { styled } from 'frontity';
+import { fontText, sizeMedium } from '../../../setup/themes';
+
+export const Report = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ margin: 20px 30px;
+ width: auto;
+`;
+Report.displayName = 'ReportTitle';
+
+export const ReportTitle = styled.h3`
+ margin-bottom: 20px;
+ font-size: ${sizeMedium};
+ color: ${({ colors }) => colors && colors.secondary};
+ font-family: ${fontText};
+ font-weight: 700; ;
+`;
+ReportTitle.displayName = 'ReportTitle';
+
+export const ReportImage = styled.img`
+ width: 100%;
+ border: 1px solid white;
+`;
+ReportImage.displayName = 'ReportImage';
diff --git a/packages/nnk/src/components/views/SectionHeader/index.js b/packages/nnk/src/components/views/SectionHeader/index.js
index da27248..83e01a0 100644
--- a/packages/nnk/src/components/views/SectionHeader/index.js
+++ b/packages/nnk/src/components/views/SectionHeader/index.js
@@ -3,6 +3,7 @@ import { arrayOf, string } from 'prop-types';
import SocialModule from '../SocialContainer';
import { PhotoContainer } from '../HomePageModules/Main/styles';
import { Title, TitleWrapper } from './styles';
+import { ColorsPropType, ConfigSocialLinksPropType } from '../../../types';
const SectionHeader = ({ colors, img, socialLinks, position, title }) => (
@@ -14,10 +15,10 @@ const SectionHeader = ({ colors, img, socialLinks, position, title }) => (
);
SectionHeader.propTypes = {
- colors: string.isRequired,
+ colors: ColorsPropType.isRequired,
img: string.isRequired,
position: string,
- socialLinks: arrayOf(string).isRequired,
+ socialLinks: arrayOf(ConfigSocialLinksPropType).isRequired,
title: string.isRequired
};
diff --git a/packages/nnk/src/components/views/What/index.js b/packages/nnk/src/components/views/What/index.js
index 1199ac3..d904680 100644
--- a/packages/nnk/src/components/views/What/index.js
+++ b/packages/nnk/src/components/views/What/index.js
@@ -4,7 +4,7 @@ import SectionHeader from '../SectionHeader';
import { getSocialLinks } from '../../../utils';
import { WHAT_TEXTS } from '../../../db';
import {
- WhatBG,
+ Photo01,
Program01,
Program02,
Program03
@@ -36,8 +36,8 @@ const WhatSection = ({ state }) => {
diff --git a/packages/nnk/src/components/views/Where/index.js b/packages/nnk/src/components/views/Where/index.js
index 086a00d..6c242ad 100644
--- a/packages/nnk/src/components/views/Where/index.js
+++ b/packages/nnk/src/components/views/Where/index.js
@@ -3,7 +3,7 @@ import { connect } from 'frontity';
import SectionHeader from '../SectionHeader';
import { getSocialLinks } from '../../../utils';
import { WHERE_TEXTS } from '../../../db';
-import { Mapv1, Photo01 } from '../../../assets/images';
+import { Mapv1, Photo05 } from '../../../assets/images';
import { Content, Map, Section } from './styles';
import { StatePropType } from '../../../types';
@@ -20,8 +20,8 @@ const WhereSection = ({ state }) => {
diff --git a/packages/nnk/src/components/views/Why/index.js b/packages/nnk/src/components/views/Why/index.js
new file mode 100644
index 0000000..7d0b665
--- /dev/null
+++ b/packages/nnk/src/components/views/Why/index.js
@@ -0,0 +1,104 @@
+import React, { useEffect, useState } from 'react';
+import { connect } from 'frontity';
+import SectionHeader from '../SectionHeader';
+import { getSocialLinks } from '../../../utils';
+import { WHY_TEXTS } from '../../../db';
+import { Photo07, Program03 } from '../../../assets/images';
+import {
+ BorderViolenceArea,
+ Content,
+ Intro,
+ Photo,
+ RecentArea,
+ Section,
+ SubTitle,
+ TestimonialArea,
+ Title,
+ TextTestimonial,
+ TextVictim,
+ LatestReportsArea,
+ ReportLink
+} from './styles';
+import { StatePropType } from '../../../types';
+import config from '../../../setup/config';
+import ReportItem from '../ReportItem';
+
+const WhySection = ({ state }) => {
+ const { colors, language } = state.theme;
+ const [latestReports, setLatestReports] = useState([]);
+ let texts = WHY_TEXTS[language];
+ const socialLinks = getSocialLinks(['Facebook', 'Twitter', 'Instagram']);
+
+ const getLatestMonthlyReports = () => {
+ const categories = state.source.category;
+
+ if (Object.keys(categories).length > 0) {
+ const reports = [];
+ const latests = [];
+ // eslint-disable-next-line no-unused-vars
+ Object.entries(categories).forEach(([id, category]) => {
+ if (category.link.includes('monthly-report')) {
+ reports.push(category);
+ }
+ });
+ const latestIds = Object.keys(reports).splice(-config.latestReportsNum);
+
+ latestIds.forEach(id => {
+ // eslint-disable-next-line no-underscore-dangle
+ const URL = reports[id]._links['wp:post_type'][0].href;
+ latests.push(URL);
+ });
+ setLatestReports(latests);
+ }
+ };
+
+ useEffect(() => {
+ texts = WHY_TEXTS[language];
+ }, [language]);
+
+ useEffect(() => {
+ getLatestMonthlyReports();
+ }, [state]);
+
+ return (
+
+
+
+ {texts.fullInto}
+ {texts.programsTitle}
+
+
+ {texts.testimonial}
+ {texts.victim}
+
+
+ {texts.borderViolence}
+
+ {latestReports &&
+ latestReports.map(reportUrl => (
+
+ ))}
+
+
+ {texts.moreReports}
+
+
+
+ {texts.recentTestimonials}
+
+
+
+ );
+};
+
+WhySection.propTypes = {
+ state: StatePropType.isRequired
+};
+
+export default connect(WhySection);
diff --git a/packages/nnk/src/components/views/Why/styles.js b/packages/nnk/src/components/views/Why/styles.js
new file mode 100644
index 0000000..c9b774c
--- /dev/null
+++ b/packages/nnk/src/components/views/Why/styles.js
@@ -0,0 +1,120 @@
+import { styled, css } from 'frontity';
+import {
+ BaseText,
+ BaseTitle,
+ fontText,
+ sizeLarge,
+ sizeLargeTitle,
+ sizeXLargeTitle
+} from '../../../setup/themes';
+import Link from '../../core/Link';
+
+const WhyArea = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ margin: auto;
+ width: 80%;
+ text-align: justify;
+`;
+
+export const BorderViolenceArea = styled(WhyArea)``;
+BorderViolenceArea.displayName = 'BorderViolenceArea';
+
+export const Content = styled.div`
+ padding: 20px 80px;
+`;
+Content.displayName = 'Content';
+
+export const Intro = styled(BaseText)`
+ text-align: justify;
+ font-size: ${sizeLarge};
+ color: ${({ colors }) => colors && colors.secondary};
+`;
+Intro.displayName = 'Intro';
+
+export const LatestReportsArea = styled.div`
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ margin: auto;
+`;
+LatestReportsArea.displayName = 'LatestReportsArea';
+
+export const Photo = styled.div`
+ margin: 20px auto;
+ height: 200px;
+ width: 200px;
+ overflow: hidden;
+ ${({ img }) =>
+ css`
+ border-radius: 50%;
+ background-image: ${`url(${img})`};
+ background-position: left top;
+ background-size: 105%;
+ background-repeat: no-repeat;
+ `}
+`;
+Photo.displayName = 'Photo';
+
+export const RecentArea = styled(WhyArea)``;
+RecentArea.displayName = 'RecentArea';
+
+export const ReportLink = styled(Link)`
+ margin: 40px auto 20px;
+ font-size: ${sizeLarge};
+ font-family: ${fontText};
+ color: ${({ colors }) => colors && colors.secondary};
+ text-decoration: none;
+ cursor: pointer;
+`;
+ReportLink.displayName = 'ReportLink';
+
+export const Section = styled.section`
+ color: ${({ colors }) => colors && colors.secondary};
+`;
+Section.displayName = 'Section';
+
+export const SubTitle = styled(BaseTitle)`
+ margin: 50px auto;
+ text-align: center;
+ font-size: ${sizeLargeTitle};
+ color: ${({ colors }) => colors && colors.terciary};
+`;
+SubTitle.displayName = 'SubTitle';
+
+export const TestimonialArea = styled(WhyArea)`
+ margin: 20px auto;
+ width: 50%;
+`;
+TestimonialArea.displayName = 'TestimonialArea';
+
+export const Text = styled(BaseText)`
+ text-align: justify;
+ color: ${({ colors }) => colors && colors.secondary};
+`;
+Text.displayName = 'Text';
+
+export const TextTestimonial = styled(Text)`
+ text-align: center;
+ font-size: ${sizeLarge};
+ font-style: italic;
+`;
+Intro.displayName = 'Intro';
+
+export const TextVictim = styled(Text)`
+ margin: 20px auto;
+ text-align: center;
+ font-size: ${sizeLarge};
+ font-weight: 700;
+`;
+Intro.displayName = 'Intro';
+
+export const Title = styled(BaseTitle)`
+ margin: 50px auto;
+ font-size: ${sizeXLargeTitle};
+ color: ${({ colors }) => colors && colors.terciary};
+`;
+Title.displayName = 'Title';
diff --git a/packages/nnk/src/db/actions.json b/packages/nnk/src/db/actions.json
index 6b31d3f..25ce7df 100644
--- a/packages/nnk/src/db/actions.json
+++ b/packages/nnk/src/db/actions.json
@@ -1,5 +1,6 @@
{
"en": {
- "back": "back"
+ "back": "back",
+ "backToReports": "Back to reports"
}
}
\ No newline at end of file
diff --git a/packages/nnk/src/db/why.json b/packages/nnk/src/db/why.json
index 2935a40..5d6a05b 100644
--- a/packages/nnk/src/db/why.json
+++ b/packages/nnk/src/db/why.json
@@ -1,5 +1,12 @@
{
"en": {
- "intro": "Many people are forced to escape from armed conflicts, discrimination or poverty,\nfleeing to find the peace and civil rights that they are missing at home.\n However, there are no safe pathways and people are exposed to hunger, pain and trauma."
- }
+ "title": "Why?",
+ "intro": "Many people are forced to escape from armed conflicts, discrimination or poverty,\nfleeing to find the peace and civil rights that they are missing at home.\n However, there are no safe pathways and people are exposed to hunger, pain and trauma.",
+ "fullInto": "Many people are forced to escape from armed conflicts, discrimination or poverty. Most of them flee to find in Europe the peace and civil rights that they are missing at home. However, there are no safe pathways to migrate and people are exposed to hunger, pain and trauma while authorities reject them applying violence instead of sustainable solutions.",
+ "testimonial": "\"It was midnight. We were in the forest in Croatia when the police stopped us. I told them I need asylum, because my life is in danger, but they laugh at me and started to hit us with their sticks...\"",
+ "victim": "Ava (26 years old). She is moving from Iran to Germany.",
+ "borderViolence": "Border violence reports",
+ "recentTestimonials": "Recent testimonials",
+ "moreReports": "Click here to find more reports"
+ }
}
\ No newline at end of file
diff --git a/packages/nnk/src/index.js b/packages/nnk/src/index.js
index 1470b82..875f673 100644
--- a/packages/nnk/src/index.js
+++ b/packages/nnk/src/index.js
@@ -16,20 +16,14 @@ const nnkTheme = {
theme: App
},
state: {
-
- /**
- * State is where the packages store their default settings and other
- * relevant state. It is scoped to the `theme` namespace.
- */
-
theme: {
language: config.defaultLanguage,
colors: THEMES.dark,
menu: [],
isMobileMenuOpen: false,
featured: {
- showOnList: false,
- showOnPost: false
+ showOnList: true,
+ showOnPost: true
}
},
source: {
@@ -41,16 +35,14 @@ const nnkTheme = {
'/where/': {
isReady: true,
isFetching: false
+ },
+ '/why/': {
+ isReady: true,
+ isFetching: false
}
}
}
},
-
- /**
- * Actions are functions that modify the state or deal with other parts of
- * Frontity like libraries.
- */
-
actions: {
theme: {
toggleMobileMenu: ({ state }) => {
@@ -60,20 +52,12 @@ const nnkTheme = {
state.theme.isMobileMenuOpen = false;
},
changeTheme: ({ state }) => newTheme => {
- console.log('$$$ newTheme', newTheme);
- console.log('$$$ state', state);
state.theme.colors = THEMES[newTheme];
}
}
},
libraries: {
html2react: {
-
- /**
- * Add a processor to `html2react` so it processes the `` tags
- * inside the content HTML. You can add your own processors too
- */
-
processors: [image, iframe]
}
}
diff --git a/packages/nnk/src/setup/config.js b/packages/nnk/src/setup/config.js
index 771c07d..4027f90 100644
--- a/packages/nnk/src/setup/config.js
+++ b/packages/nnk/src/setup/config.js
@@ -8,6 +8,7 @@ export default {
buttonsBackground: THEMES[LIGHT].purewWhite,
buttonsText: THEMES[LIGHT].primary,
buttonsHighlight: THEMES[LIGHT].terciary,
+ latestReportsNum: 2,
socialLinks: [
{
type: 'Facebook',
diff --git a/packages/nnk/src/setup/themes.js b/packages/nnk/src/setup/themes.js
index 2a42a79..a1740ac 100644
--- a/packages/nnk/src/setup/themes.js
+++ b/packages/nnk/src/setup/themes.js
@@ -5,8 +5,8 @@ import { DARK, LIGHT } from '../constants/theme';
export const THEMES = {
[DARK]: {
- primary: 'black',
- secondary: 'white',
+ primary: '#212121',
+ secondary: '#f8f8ff',
terciary: '#da002b',
neutral: '#868686',
purewWhite: '#ffffff',
diff --git a/packages/nnk/src/utils/index.js b/packages/nnk/src/utils/index.js
index 867f304..748626d 100644
--- a/packages/nnk/src/utils/index.js
+++ b/packages/nnk/src/utils/index.js
@@ -1,3 +1,5 @@
+import axios from 'axios';
+
import { DESKTOP, MOBILE, TABLET } from '../constants/devices';
import config from '../setup/config';
@@ -17,3 +19,11 @@ export const getMediaQuery = () => {
}
return DESKTOP;
};
+
+export const fetchData = URL => {
+ const request = axios
+ .get(URL)
+ .then(resp => resp.data)
+ .catch(error => console.error(`Failed to get data from ${URL}. ${error}.`));
+ return request;
+};
diff --git a/yarn.lock b/yarn.lock
index 73bc0ae..5e99007 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2347,6 +2347,13 @@ axe-core@^3.5.4:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-3.5.5.tgz#84315073b53fa3c0c51676c588d59da09a192227"
integrity sha512-5P0QZ6J5xGikH780pghEdbEKijCTrruK9KxtPZCFWUpef0f6GipO+xEZ5GKCb020mmqgbiNO6TcA55CriL784Q==
+axios@^0.21.0:
+ version "0.21.0"
+ resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.0.tgz#26df088803a2350dff2c27f96fef99fe49442aca"
+ integrity sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==
+ dependencies:
+ follow-redirects "^1.10.0"
+
axobject-query@^2.1.2:
version "2.2.0"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
@@ -4427,6 +4434,11 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3"
readable-stream "^2.3.6"
+follow-redirects@^1.10.0:
+ version "1.13.0"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
+ integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==
+
for-in@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"