From 5e505a342371cc37655e3502d244c54080406c23 Mon Sep 17 00:00:00 2001 From: Anna Branco Date: Thu, 8 Apr 2021 12:36:21 +0200 Subject: [PATCH 1/6] enh: [#127] Resized sections fonts for mobiles --- packages/nnk/src/components/controllers/Header/index.js | 5 +---- packages/nnk/src/components/views/SectionHeader/styles.js | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nnk/src/components/controllers/Header/index.js b/packages/nnk/src/components/controllers/Header/index.js index d5035ef..aef75f7 100644 --- a/packages/nnk/src/components/controllers/Header/index.js +++ b/packages/nnk/src/components/controllers/Header/index.js @@ -14,11 +14,9 @@ import { StatePropType, ActionsPropType } from '../../../types'; import { HeaderContainer, Logo } from './styles'; const Header = ({ state, actions }) => { - // eslint-disable-next-line no-unused-vars const [activeLanguage, changeLanguage] = useState('es'); const { colors } = state.theme; - // eslint-disable-next-line no-unused-vars - const { changeTheme } = actions.theme; + // const { changeTheme } = actions.theme; const MOBILE_VERSION = getMediaQuery() === MOBILE; // const onClickFlag = () => { @@ -53,5 +51,4 @@ Header.propTypes = { actions: ActionsPropType.isRequired }; -// Connect the Header component to get access to the `state` in it's `props` export default connect(Header); diff --git a/packages/nnk/src/components/views/SectionHeader/styles.js b/packages/nnk/src/components/views/SectionHeader/styles.js index 65c9472..59946cf 100644 --- a/packages/nnk/src/components/views/SectionHeader/styles.js +++ b/packages/nnk/src/components/views/SectionHeader/styles.js @@ -10,7 +10,11 @@ export const Title = styled(BaseTitle)` color: ${({ colors }) => colors && colors.secondary}; width: fit-content; - @media only screen and (min-width: 375px) { + /* @media only screen and (min-width: 375px) { + font-size: ${sizeHugeTitle}; + } */ + + @media all and (min-width: 768px) { font-size: ${sizeHugeTitle}; } `; From f43d17dd9b5a0702a9984d20895c167fa0fc2e29 Mon Sep 17 00:00:00 2001 From: Anna Branco Date: Thu, 8 Apr 2021 12:37:21 +0200 Subject: [PATCH 2/6] enh: [#130, #131] Adjusted sizes for smaller mobiles --- .../nnk/src/components/core/List/styles.js | 19 ++++++++++++++--- .../nnk/src/components/core/Post/index.js | 4 +++- .../nnk/src/components/core/Post/styles.js | 21 ++++++++++++++----- .../src/components/views/NewsItem/index.js | 11 +++++++--- .../src/components/views/NewsItem/styles.js | 14 +++++++++++-- packages/nnk/src/setup/themes.js | 1 + 6 files changed, 56 insertions(+), 14 deletions(-) diff --git a/packages/nnk/src/components/core/List/styles.js b/packages/nnk/src/components/core/List/styles.js index edea015..cd58625 100644 --- a/packages/nnk/src/components/core/List/styles.js +++ b/packages/nnk/src/components/core/List/styles.js @@ -1,5 +1,10 @@ import { css, styled } from 'frontity'; -import { sizeMedium, sizeSmall } from '../../../setup/themes'; +import { + sizeLarge, + sizeMedium, + sizeSmall, + sizeSmallestTitle +} from '../../../setup/themes'; import Link from '../Link'; import { BackToReports, BackToReportsArrow } from '../Post/styles'; @@ -114,13 +119,17 @@ ButtonsWrapper.displayName = 'ButtonsWrapper'; export const PageButton = styled.p` text-align: center; - font-size: ${sizeMedium}; + font-size: ${sizeLarge}; text-transform: uppercase; font-weight: 700; margin-top: -15px; color: ${({ colors }) => colors && colors.terciary}; + @media all and (min-width: 768px) { + font-size: ${sizeMedium}; + } + @media all and (min-width: 1200px) { font-size: 0.8rem; margin-top: -30px; @@ -156,7 +165,11 @@ PageButton.displayName = 'PageButton'; export const PageButtonArrow = styled(BackToReportsArrow)` margin: ${({ right }) => (right ? '0 0 0 5px' : '0 5px 0 0')}; - font-size: 0.9rem; + font-size: ${sizeLarge}; + + @media all and (min-width: 768px) { + font-size: ${sizeSmallestTitle}; + } @media all and (min-width: 1200px) { font-size: ${sizeMedium}; diff --git a/packages/nnk/src/components/core/Post/index.js b/packages/nnk/src/components/core/Post/index.js index 46125d0..8bcf1c6 100644 --- a/packages/nnk/src/components/core/Post/index.js +++ b/packages/nnk/src/components/core/Post/index.js @@ -52,7 +52,9 @@ const Post = ({ actions, libraries, state }) => { useEffect(() => { const onReadAll = () => { if (window.innerHeight + window.scrollY >= document.body.offsetHeight) { - onRead(); + setTimeout(() => { + onRead(); + }, 1000); } }; diff --git a/packages/nnk/src/components/core/Post/styles.js b/packages/nnk/src/components/core/Post/styles.js index 2b029f6..d276a91 100644 --- a/packages/nnk/src/components/core/Post/styles.js +++ b/packages/nnk/src/components/core/Post/styles.js @@ -6,7 +6,8 @@ import { sizeSmall, sizeSmallTitle, sizeMediumTitle, - fontTitleNews + fontTitleNews, + sizeXLarge } from '../../../setup/themes'; import Link from '../Link'; @@ -52,17 +53,19 @@ export const StyledLink = styled(Link)` StyledLink.displayName = 'StyledLink'; export const BackToReports = styled.p` + z-index: 50; position: fixed; - bottom: 10%; - left: 10%; + bottom: 50px; + height: 20px; + left: 0; border: ${({ colors }) => `2px solid ${colors.terciary}`}; border-radius: 5px; padding: 5px 10px; background: ${({ colors }) => colors && colors.terciary}; text-transform: uppercase; font-weight: 700; - font-size: ${sizeMedium}; - width: 15%; + font-size: ${sizeMediumTitle}; + width: 100%; cursor: pointer; &:hover { @@ -73,6 +76,14 @@ export const BackToReports = styled.p` transition: transform ease 0.5s; } } + + @media all and (min-width: 768px) { + width: 15%; + bottom: 10%; + left: 10%; + height: auto; + font-size: ${sizeMedium}; + } `; BackToReports.displayName = 'BackToReports'; diff --git a/packages/nnk/src/components/views/NewsItem/index.js b/packages/nnk/src/components/views/NewsItem/index.js index 69156e1..9ee7d27 100644 --- a/packages/nnk/src/components/views/NewsItem/index.js +++ b/packages/nnk/src/components/views/NewsItem/index.js @@ -6,11 +6,14 @@ import Link from '../../core/Link'; import FeaturedMedia from '../../core/FeaturedMedia'; import { ItemPropType, StatePropType, TextsNewsPropType } from '../../../types'; import { ArticleWrapper, Excerpt, PublishDate, Title, InfoBox } from './styles'; -import { getFormatedDate } from '../../../utils'; +import { getFormatedDate, getMediaQuery } from '../../../utils'; +import { MOBILE } from '../../../constants/devices'; const NewsItem = ({ state, item, read, texts }) => { const { colors, language } = state.theme; const date = new Date(item.date); + const MOBILE_VERSION = getMediaQuery() === MOBILE; + const clearOriginalLink = excerpt => { return excerpt.split('

Contact

Name: ${formData.name.value}

E-mail: ${formData.email.value}

Message: ${formData.message.value}

` - // }).then(message => { - // if (message === 'OK') { - // toggleEmailSent(true); - // } else { - // console.warn('Failed sending message through server', message); - // } - // }); - }; - useEffect(() => { texts = DONATION_TEXTS[language]; }, [language]); @@ -148,67 +87,16 @@ const HelpUs = ({ state }) => { - - {/* DonorBox - - - - {texts.subscribeTo} - - - {texts.noNameNews} - - - - - updateForm(event.target.value, 'name')} - placeholder={texts.form.name} - type="text" - /> - - - - updateForm(event.target.value, 'email')} - placeholder={texts.form.email} - type="email" - /> - - - {texts.form.send} - - - */} + + {/* DonorBox */} - {/* - {texts.justice} - - {texts.hope} - - {texts.dignity} - */} ); }; diff --git a/packages/nnk/src/components/views/JumpToTheField/index.js b/packages/nnk/src/components/views/JumpToTheField/index.js index 7837d3d..6da7af6 100644 --- a/packages/nnk/src/components/views/JumpToTheField/index.js +++ b/packages/nnk/src/components/views/JumpToTheField/index.js @@ -1,189 +1,81 @@ // eslint-disable-next-line import/no-extraneous-dependencies import React, { useEffect, useState } from 'react'; import { connect } from 'frontity'; +import config from '../../../setup/config'; import SectionHeader from '../SectionHeader'; -import { - // validateForm, - getSocialLinks, - getMediaQuery - // allValidated -} from '../../../utils'; +import { getSocialLinks, getMediaQuery } from '../../../utils'; import { JTTF_TEXTS } from '../../../db'; import { MOBILE, TABLET } from '../../../constants/devices'; import { VolunteersInAction } from '../../../assets/images'; import { StatePropType } from '../../../types'; import { - // Container, Content, - // Description, - // Field, - // FormArea, Icon, Info, InfoDescription, InfoTitle, JoinButton, - // Label, - // MessageField, MoreInfo, JTTFSection, - // SendButton, Text - // TextEmail, - // TextField, - // Title } from './styles'; import AppModal from '../../core/AppModal'; - -// const INITIAL_FORM_DATA = { -// email: { -// isValid: false, -// value: null -// }, -// message: { -// isValid: false, -// value: null -// }, -// name: { -// isValid: false, -// value: null -// } -// }; +import ExternalForm from '../ExternalFrame'; const DEVICE_VERSION = getMediaQuery() === MOBILE || getMediaQuery() === TABLET; const JumpToTheFieldSection = ({ state }) => { const [displayModal, toggleModal] = useState(false); - // const [formData, setFormData] = useState(INITIAL_FORM_DATA); - // const [emailSent, toggleEmailSent] = useState(false); const { colors, language } = state.theme; let texts = JTTF_TEXTS[language]; const socialLinks = getSocialLinks(['Facebook', 'Twitter', 'Instagram']); - // const sendEmail = event => { - // event.preventDefault(); - // // eslint-disable-next-line no-undef - // Email.send({ - // SecureToken: '5ee1f4fa-251a-4319-8cd5-71bb061b263a', - // To: 'nnk56478991032@outlook.com', - // From: 'nnk56478991032@outlook.com', - // Subject: 'New volunteer contact', - // Body: `

Contact

Name: ${formData.name.value}

E-mail: ${formData.email.value}

Message: ${formData.message.value}

` - // }).then(message => { - // if (message === 'OK') { - // toggleEmailSent(true); - // } else { - // console.warn('Failed sending message though server', message); - // } - // }); - // }; - - // const updateForm = (value, field) => { - // const updatedData = { ...formData }; - // updatedData[field] = { - // value, - // isValid: validateForm(field, value) - // }; - // setFormData(updatedData); - // }; - useEffect(() => { texts = JTTF_TEXTS[language]; }, [language]); return ( - <> - {/* {emailSent ? ( - - {texts.messageSent.title} - - {texts.messageSent.msgSent} - - - ) : ( */} - - - - {texts.text1} - {texts.text2 && {texts.text2}} - {texts.text3 && {texts.text3}} - - {texts.infoIcons.map(item => ( - - - {item.title} - - {item.description} - - - {item.description2} - - - ))} - - {texts.form.joinUs} - {displayModal && ( - toggleModal(false)}> - - - )} - {/* - - - updateForm(event.target.value, 'name')} - id="name" - name="name" - type="text" - /> - - - - updateForm(event.target.value, 'email')} - id="email" - name="email" - type="email" - /> - - - - updateForm(event.target.value, 'message')} - id="message" - name="message" - rows="4" - /> - - - {texts.form.send} - - - )} */} - - - + + + + {texts.text1} + {texts.text2 && {texts.text2}} + {texts.text3 && {texts.text3}} + + {texts.infoIcons.map(item => ( + + + {item.title} + + {item.description} + + + {item.description2} + + + ))} + + {texts.form.joinUs} + {displayModal && ( + toggleModal(false)}> + + + )} + + ); }; diff --git a/packages/nnk/src/setup/config.js b/packages/nnk/src/setup/config.js index e75867a..cd6677d 100644 --- a/packages/nnk/src/setup/config.js +++ b/packages/nnk/src/setup/config.js @@ -34,6 +34,10 @@ export default { hide: false } ], + subscriptionEndpoint: + 'https://docs.google.com/forms/d/e/1FAIpQLSfDAwap34je_R2Kt-H3QvK6tLAxRB3TMNGFmmo3_Yn5Xd3IPg/viewform?embedded=true', + volunteerForm: + 'https://docs.google.com/forms/d/e/1FAIpQLSe4TmEylSelfV1GJQLBURdP2Swp0mYTWAVZuehZzK6bgffbXg/viewform?embedded=true', partnersEmail: 'partners@nonamekitchen.org', account: { name: 'NO NAME KITCHEN', From d7b4174d938a2d7d8fe5c8924143c1e7693c6f48 Mon Sep 17 00:00:00 2001 From: Anna Branco Date: Thu, 8 Apr 2021 13:51:04 +0200 Subject: [PATCH 4/6] fix: [#129] Fixed social links buttons --- packages/nnk/src/components/views/SocialLink/index.js | 6 +++--- packages/nnk/src/components/views/SocialLink/styles.js | 5 +++++ packages/nnk/src/setup/globalStyles.js | 6 ++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/nnk/src/components/views/SocialLink/index.js b/packages/nnk/src/components/views/SocialLink/index.js index 5138831..df1b3d4 100644 --- a/packages/nnk/src/components/views/SocialLink/index.js +++ b/packages/nnk/src/components/views/SocialLink/index.js @@ -1,7 +1,7 @@ import React from 'react'; // eslint-disable-line import/no-extraneous-dependencies import { string, func } from 'prop-types'; import Link from '../../core/Link'; -import { SocialLogo } from './styles'; +import { SocialLinkButton, SocialLogo } from './styles'; const SocialLink = ({ link = '', onClick, type }) => { let socialClassName; @@ -27,9 +27,9 @@ const SocialLink = ({ link = '', onClick, type }) => { return ( - + - + ); }; diff --git a/packages/nnk/src/components/views/SocialLink/styles.js b/packages/nnk/src/components/views/SocialLink/styles.js index e929f13..cc276c4 100644 --- a/packages/nnk/src/components/views/SocialLink/styles.js +++ b/packages/nnk/src/components/views/SocialLink/styles.js @@ -36,3 +36,8 @@ export const SocialLogo = styled.div` } `; SocialLogo.displayName = 'SocialLogo'; + +export const SocialLinkButton = styled.a` + text-decoration: none; + color: black; +`; diff --git a/packages/nnk/src/setup/globalStyles.js b/packages/nnk/src/setup/globalStyles.js index b12afbe..fbd8d11 100644 --- a/packages/nnk/src/setup/globalStyles.js +++ b/packages/nnk/src/setup/globalStyles.js @@ -102,6 +102,12 @@ export const globalStyles = css` button { outline: none; } + a { + color: black; + &:hover { + color: red; + } + } html { font-size: 10px; From 41b2fe0ae88fcdf904cdd94966da75c4a4708acd Mon Sep 17 00:00:00 2001 From: Anna Branco Date: Thu, 8 Apr 2021 15:25:21 +0200 Subject: [PATCH 5/6] enh: [#126] Avoiding empty spaces when there are highlighted news --- packages/nnk/src/components/controllers/News/styles.js | 6 ++---- packages/nnk/src/components/views/NewsItem/styles.js | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/nnk/src/components/controllers/News/styles.js b/packages/nnk/src/components/controllers/News/styles.js index 448825c..0d922c1 100644 --- a/packages/nnk/src/components/controllers/News/styles.js +++ b/packages/nnk/src/components/controllers/News/styles.js @@ -1,6 +1,4 @@ -import { css, styled } from 'frontity'; -import { sizeMedium } from '../../../setup/themes'; -import Link from '../../core/Link'; +import { styled } from 'frontity'; export const NewsSection = styled.section` display: flex; @@ -30,7 +28,7 @@ export const NewsWrapper = styled.div` @media all and (min-width: 768px) { display: grid; - + grid-auto-flow: dense; grid-template-columns: repeat(3, 1fr); padding: 24px; grid-gap: 10px; diff --git a/packages/nnk/src/components/views/NewsItem/styles.js b/packages/nnk/src/components/views/NewsItem/styles.js index d75c5ef..aa1f5c2 100644 --- a/packages/nnk/src/components/views/NewsItem/styles.js +++ b/packages/nnk/src/components/views/NewsItem/styles.js @@ -6,9 +6,7 @@ import { sizeDefaultText, fontTitleNews, fontTitle, - sizeSmallestTitle, - sizeLarge, - sizeMediumTitle + sizeLarge } from '../../../setup/themes'; import Link from '../../core/Link'; From 0a5961145d2dac810c797df7352e89002453f7b1 Mon Sep 17 00:00:00 2001 From: Anna Branco Date: Thu, 8 Apr 2021 15:26:25 +0200 Subject: [PATCH 6/6] 0.8.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90aad3b..02cce80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nnk", - "version": "0.8.1", + "version": "0.8.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1b9f2b6..84c215e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nnk", - "version": "0.8.1", + "version": "0.8.2", "private": true, "description": "No Named Kitchen: Supporting People on the Move", "repository": "https://github.com/annabranco/nnk",