diff --git a/src/components/marginals/index.js b/src/components/marginals/index.js
index 1d4ab30..68ab2e0 100644
--- a/src/components/marginals/index.js
+++ b/src/components/marginals/index.js
@@ -1,5 +1,5 @@
/* eslint-disable import/no-cycle */
-export { default as Footer } from "./Footer/Footer";
-export { default as Navbar } from "./Navbar/Navigation";
-export { default as SearchBar } from "./Search/Search";
\ No newline at end of file
+export { default as Footer } from './Footer/Footer';
+export { default as Navbar } from './Navbar/Navigation';
+export { default as SearchBar } from './Search/Search';
diff --git a/src/config/content/footer.js b/src/config/content/footer.js
index c0b2c50..2fd75e9 100644
--- a/src/config/content/footer.js
+++ b/src/config/content/footer.js
@@ -1,85 +1,84 @@
/* eslint-disable import/no-unresolved */
-import {faTwitter, faGithub, faSlack} from '@fortawesome/free-brands-svg-icons';
-import {faEnvelope} from '@fortawesome/free-solid-svg-icons';
+import { faTwitter, faGithub, faSlack } from '@fortawesome/free-brands-svg-icons';
+import { faEnvelope } from '@fortawesome/free-solid-svg-icons';
-
-export default{
- img: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702085/CiS/rocket_vkcatz.png',
- alt: 'Code Is Science',
- },
- copyright: 'Copyright © {{ new Date().getFullYear() }} Code is Science',
- col1: {
- head: 'Useful Links',
- links: [
- {
- id:1,
- sub: 'Contribute',
- link: 'https://github.com/codeisscience',
- },
- {
- id: 2,
- sub: 'Manifesto',
- link: 'https://codeisscience.github.io/manifesto/manifesto.html',
- },
- {
- id: 3,
- sub: 'Code of Conduct',
- link: '/home',
- },
- ]
- },
- col2: {
- head: 'Resources',
- links: [
- {
- id: 1,
- sub: 'Authors',
- link: '/home',
- },
- {
- id: 2,
- sub: 'Open Science',
- link: '/home',
- },
- {
- id: 3,
- sub: 'Contributors',
- link: '/home',
- }
- ]
- },
- socials: {
- head: 'Contact Us',
- links: [
- {
- id: 1,
- icon: faEnvelope,
- head: 'Email',
- link: 'mailto:contact@codeisscience.com',
- color: 'white',
- },
- {
- id: 2,
- icon: faTwitter,
- head: 'Twitter',
- link: 'https://twitter.com/codeisscience',
- color: '#00acee',
- },
- {
- id: 3,
- icon: faGithub,
- head: 'Github',
- link: 'https://github.com/codeisscience',
- color: 'black',
- },
- {
- id: 4,
- icon: faSlack,
- head: 'Slack',
- link: '',
- color: '#e01e5a',
- }
- ]
- }
-}
\ No newline at end of file
+export default {
+ img: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702085/CiS/rocket_vkcatz.png',
+ alt: 'Code Is Science',
+ },
+ copyright: 'Copyright © {{ new Date().getFullYear() }} Code is Science',
+ col1: {
+ head: 'Useful Links',
+ links: [
+ {
+ id: 1,
+ sub: 'Contribute',
+ link: 'https://github.com/codeisscience',
+ },
+ {
+ id: 2,
+ sub: 'Manifesto',
+ link: 'https://codeisscience.github.io/manifesto/manifesto.html',
+ },
+ {
+ id: 3,
+ sub: 'Code of Conduct',
+ link: '/home',
+ },
+ ],
+ },
+ col2: {
+ head: 'Resources',
+ links: [
+ {
+ id: 1,
+ sub: 'Authors',
+ link: '/home',
+ },
+ {
+ id: 2,
+ sub: 'Open Science',
+ link: '/home',
+ },
+ {
+ id: 3,
+ sub: 'Contributors',
+ link: '/home',
+ },
+ ],
+ },
+ socials: {
+ head: 'Contact Us',
+ links: [
+ {
+ id: 1,
+ icon: faEnvelope,
+ head: 'Email',
+ link: 'mailto:contact@codeisscience.com',
+ color: 'white',
+ },
+ {
+ id: 2,
+ icon: faTwitter,
+ head: 'Twitter',
+ link: 'https://twitter.com/codeisscience',
+ color: '#00acee',
+ },
+ {
+ id: 3,
+ icon: faGithub,
+ head: 'Github',
+ link: 'https://github.com/codeisscience',
+ color: 'black',
+ },
+ {
+ id: 4,
+ icon: faSlack,
+ head: 'Slack',
+ link: '',
+ color: '#e01e5a',
+ },
+ ],
+ },
+};
diff --git a/src/config/content/index.js b/src/config/content/index.js
index bb3fff2..c3d0c75 100644
--- a/src/config/content/index.js
+++ b/src/config/content/index.js
@@ -1,5 +1,5 @@
export { default as landingpage } from './landingpage';
export { default as footer } from './footer';
export { default as manifesto } from './manifesto';
-export { default as navbar } from './navbar';
-export { default as signup } from './signup';
\ No newline at end of file
+export { default as navbar } from './navbar';
+export { default as signup } from './signup';
diff --git a/src/config/content/landingpage.js b/src/config/content/landingpage.js
index f26350c..49c0199 100644
--- a/src/config/content/landingpage.js
+++ b/src/config/content/landingpage.js
@@ -1,90 +1,90 @@
/* eslint-disable max-len */
export default {
- landing: {
- head: 'Read and Sign the Manifesto',
- img: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702025/CiS/bg_jhdw6s.png',
- alt: 'landing'
- }
+ landing: {
+ head: 'Read and Sign the Manifesto',
+ img: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702025/CiS/bg_jhdw6s.png',
+ alt: 'landing',
+ },
+ },
+ section1: {
+ head: 'Premise',
+ img: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702092/CiS/section-img_pkjqly.png',
+ alt: 'laptops',
},
- section1: {
- head: 'Premise',
- img: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702092/CiS/section-img_pkjqly.png',
- alt: 'laptops',
- },
- content: [
- {
- id: 1,
- subhead: 'Science is often computing',
- para: 'Much of modern science involves code these days, in large part due to the amount of data available - it would be almost impossible to analyse without computational assistance.'
- },
- {
- id: 2,
- subhead: 'Science requires peer review',
- para: 'One of the basic prerequisites for any published scientific results is that it be reviewed by peers, to ensure the research and conclusions are valid.'
- }
- ]
- },
- section2: {
content: [
- {
- id: 1,
- head: 'Code == Science',
- para: 'If software is required to perform science, it stands to reason that errors in your software mean errors in your science.',
- img: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702030/CiS/clock_dryc5d.png',
- alt: 'clock',
- },
+ {
+ id: 1,
+ subhead: 'Science is often computing',
+ para: 'Much of modern science involves code these days, in large part due to the amount of data available - it would be almost impossible to analyse without computational assistance.',
+ },
+ {
+ id: 2,
+ subhead: 'Science requires peer review',
+ para: 'One of the basic prerequisites for any published scientific results is that it be reviewed by peers, to ensure the research and conclusions are valid.',
+ },
+ ],
+ },
+ section2: {
+ content: [
+ {
+ id: 1,
+ head: 'Code == Science',
+ para: 'If software is required to perform science, it stands to reason that errors in your software mean errors in your science.',
+ img: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702030/CiS/clock_dryc5d.png',
+ alt: 'clock',
},
- {
- id: 2,
- head: 'Possible Solution?',
- para: 'Scientific code needs to be peer reviewed, and ideally open source.That’s easier said than done. Getting there requires awareness, culture shift, and adherence to best practices.',
- img: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702098/CiS/talking_q54knb.png',
- alt: 'humans',
- }
+ },
+ {
+ id: 2,
+ head: 'Possible Solution?',
+ para: 'Scientific code needs to be peer reviewed, and ideally open source.That’s easier said than done. Getting there requires awareness, culture shift, and adherence to best practices.',
+ img: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702098/CiS/talking_q54knb.png',
+ alt: 'humans',
},
- ]
- },
+ },
+ ],
+ },
- section3: {
+ section3: {
content: [
- {
- head: 'Looking to Contribute?',
- para: [
- {
- id: 1,
- sub: 'Do you wish more code was open source? Have you wished in the past that a DB of open source journals existed? Share your story.'
- },
- {
- id: 2,
- sub: 'Add more journals to our list Right now it’s a google form, but hopefully we’ll have the full site up and running soon!'
- },
- {
- id: 3,
- sub: 'Pick up a technical or design task on GitHub: https://github.com/codeisscience/code-is-science'
- }
- ]
- },
- {
- head: 'Latest Posts',
- links: [
- {
- title: 'Good practices & good quality code',
- link: '',
- },
- {
- title: 'Mozfest Session 2017',
- link: '',
- },
- {
- title: 'Mozfest Is Coming',
- link: '',
- }
- ]
- }
- ]
- }
-}
\ No newline at end of file
+ {
+ head: 'Looking to Contribute?',
+ para: [
+ {
+ id: 1,
+ sub: 'Do you wish more code was open source? Have you wished in the past that a DB of open source journals existed? Share your story.',
+ },
+ {
+ id: 2,
+ sub: 'Add more journals to our list Right now it’s a google form, but hopefully we’ll have the full site up and running soon!',
+ },
+ {
+ id: 3,
+ sub: 'Pick up a technical or design task on GitHub: https://github.com/codeisscience/code-is-science',
+ },
+ ],
+ },
+ {
+ head: 'Latest Posts',
+ links: [
+ {
+ title: 'Good practices & good quality code',
+ link: '',
+ },
+ {
+ title: 'Mozfest Session 2017',
+ link: '',
+ },
+ {
+ title: 'Mozfest Is Coming',
+ link: '',
+ },
+ ],
+ },
+ ],
+ },
+};
diff --git a/src/config/content/manifesto.js b/src/config/content/manifesto.js
index 61eafbf..ef5bd61 100644
--- a/src/config/content/manifesto.js
+++ b/src/config/content/manifesto.js
@@ -2,84 +2,82 @@
import { ImTwitter, ImMail, ImGithub } from 'react-icons/im';
export default {
- title: 'Manifesto',
- section1: {
- img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702069/CiS/manifesto-img-1_tsnufg.png',
- alt: 'manifesto image',
- head: 'Code is Science Manifesto',
- sub: 'Through working with scientific code, we agree that scientific code needs to be treated as a genuine research output. For this reason we have created a manifesto, which will allow both individuals and organisations to sign up and agree to make genuine efforts to both make their own scientific code open, as well as sharing the manifesto mission with others.',
- link: 'https://codeisscience.github.io/manifesto/manifesto.html',
- },
- section2: {
- head: 'I want to express my support for the manifesto! Tell me how',
- cards: [
- {
- id:1,
- img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702103/CiS/walking-man_ncunny.png',
- alt: 'Card Image',
- head: 'Sign the manifesto as an individual',
- link : 'https://docs.google.com/forms/d/e/1FAIpQLSeaDLDaREkUyOwpvbQf41hxT12ixoBToTdBhlgTj_YoW0tSgw/viewform',
- },
- {
- id: 2,
- img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702076/CiS/peers_m0fgdd.png',
- alt: 'Card Image',
- head: 'Sign the manifesto as an organisation or institution.',
- sub: 'Please make sure you have authority to sign on behalf of your organisation before you sign on behalf of an organisation.',
- link: 'https://docs.google.com/forms/d/e/1FAIpQLSdUPKlP__5saaYMyEJwkHF3gRNAHiKihOlp6zd6QK4vUqs3gg/viewform',
- },
- {
- id: 3,
- img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702037/CiS/hands-icon_omk7ug.png',
- alt: 'Card Image',
- sub: 'We’re particularly interested in adding logos and links indicating organisational support from publishers, funders, and research institutions.'
- }
- ]
+ title: 'Manifesto',
+ section1: {
+ img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702069/CiS/manifesto-img-1_tsnufg.png',
+ alt: 'manifesto image',
+ head: 'Code is Science Manifesto',
+ sub: 'Through working with scientific code, we agree that scientific code needs to be treated as a genuine research output. For this reason we have created a manifesto, which will allow both individuals and organisations to sign up and agree to make genuine efforts to both make their own scientific code open, as well as sharing the manifesto mission with others.',
+ link: 'https://codeisscience.github.io/manifesto/manifesto.html',
+ },
+ section2: {
+ head: 'I want to express my support for the manifesto! Tell me how',
+ cards: [
+ {
+ id: 1,
+ img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702103/CiS/walking-man_ncunny.png',
+ alt: 'Card Image',
+ head: 'Sign the manifesto as an individual',
+ link: 'https://docs.google.com/forms/d/e/1FAIpQLSeaDLDaREkUyOwpvbQf41hxT12ixoBToTdBhlgTj_YoW0tSgw/viewform',
+ },
+ {
+ id: 2,
+ img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702076/CiS/peers_m0fgdd.png',
+ alt: 'Card Image',
+ head: 'Sign the manifesto as an organisation or institution.',
+ sub: 'Please make sure you have authority to sign on behalf of your organisation before you sign on behalf of an organisation.',
+ link: 'https://docs.google.com/forms/d/e/1FAIpQLSdUPKlP__5saaYMyEJwkHF3gRNAHiKihOlp6zd6QK4vUqs3gg/viewform',
+ },
+ {
+ id: 3,
+ img: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702037/CiS/hands-icon_omk7ug.png',
+ alt: 'Card Image',
+ sub: 'We’re particularly interested in adding logos and links indicating organisational support from publishers, funders, and research institutions.',
+ },
+ ],
+ },
+ section3: [
+ {
+ head: 'How can I contribute?',
+ list: [
+ {
+ id: 1,
+ sub: 'Sign the manifesto and share with all your friends!',
+ },
+ {
+ id: 2,
+ sub: 'Add links to your personal and institutional sites.',
+ },
+ {
+ id: 3,
+ sub: 'You can also look at the issues on GitHub and see if there’s anything else you can pick up. You can also look at our roadmap to get an understanding of our timeline.',
+ },
+ ],
},
- section3: [
+ ],
+ section4: [
+ {
+ head: 'Contact',
+ links: [
{
- head: 'How can I contribute?',
- list: [
- {
- id: 1,
- sub: 'Sign the manifesto and share with all your friends!',
- },
- {
- id: 2,
- sub: 'Add links to your personal and institutional sites.',
- },
- {
- id: 3,
- sub: 'You can also look at the issues on GitHub and see if there’s anything else you can pick up. You can also look at our roadmap to get an understanding of our timeline.',
- }
- ]
+ id: 1,
+ icon: ImTwitter,
+ sub: 'Twitter: @codeisscience',
+ link: 'https://twitter.com/codeisscience',
},
- ],
- section4: [
{
- head: 'Contact',
- links: [
- {
- id: 1,
- icon: ImTwitter,
- sub: 'Twitter: @codeisscience',
- link: 'https://twitter.com/codeisscience',
- },
- {
- id: 2,
- icon: ImMail,
- sub: 'Email: contact@codeisscience.com',
- link: 'mailto:contact@codeisscience.com',
- },
- {
- id: 3,
- icon: ImGithub,
- sub: 'Github: You can also create issues on the manifesto repository',
- link: 'https://github.com/codeisscience',
- }
- ]
- }
- ]
-
-
-}
\ No newline at end of file
+ id: 2,
+ icon: ImMail,
+ sub: 'Email: contact@codeisscience.com',
+ link: 'mailto:contact@codeisscience.com',
+ },
+ {
+ id: 3,
+ icon: ImGithub,
+ sub: 'Github: You can also create issues on the manifesto repository',
+ link: 'https://github.com/codeisscience',
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/config/content/navbar.js b/src/config/content/navbar.js
index 928ba38..b410395 100644
--- a/src/config/content/navbar.js
+++ b/src/config/content/navbar.js
@@ -1,43 +1,48 @@
import { faBars, faXmark } from '@fortawesome/free-solid-svg-icons';
export default {
- title: 'Navbar',
- logo: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702059/CiS/logo_ch4fzv.png',
- alt: 'Code Is Science',
+ title: 'Navbar',
+ logo: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702059/CiS/logo_ch4fzv.png',
+ alt: 'Code Is Science',
+ },
+ icon: faBars,
+ icon2: faXmark,
+ navItems: [
+ {
+ id: 'home',
+ name: 'Home',
+ link: '/home',
},
- icon: faBars,
- icon2: faXmark,
- navItems: [
- {
- id: 'home',
- name: 'Home',
- link: '/home',
- },
- {
- id: 'journals',
- name: 'Journals',
- link: '/journal',
- },
- {
- id: 'manifesto',
- name: 'Manifesto',
- link: '/manifesto',
- },
- {
- id: 'contact',
- name: 'Contact',
- link: '/contact',
- },
- {
- id: 'signup',
- name: 'Signup',
- link: '/signup',
- },
- {
- id: 'login',
- name: null,
- link: '/login',
- }
- ],
-};
\ No newline at end of file
+ {
+ id: 'journal',
+ name: 'Journals',
+ link: '/journal',
+ },
+ {
+ id: 'manifesto',
+ name: 'Manifesto',
+ link: '/manifesto',
+ },
+ {
+ id: 'contact',
+ name: 'Contact',
+ link: '/contact',
+ },
+ {
+ id: 'signup',
+ name: 'Signup',
+ link: '/signup',
+ },
+ {
+ id: 'login',
+ name: null,
+ link: '/login',
+ },
+ {
+ id: 'policy',
+ name: null,
+ link: '/policy/:id',
+ },
+ ],
+};
diff --git a/src/config/content/signup.js b/src/config/content/signup.js
index 50c5ba7..4193a53 100644
--- a/src/config/content/signup.js
+++ b/src/config/content/signup.js
@@ -1,22 +1,21 @@
/* eslint-disable max-len */
export default {
- head: 'Welcome to Code Is Science',
- head2: 'Welcome back, please log in to your account',
- labelUsername: 'Enter your username',
- labelEmail: 'Enter your email',
- labelPassword: 'Enter your password',
- labelPassword2: 'Confirm your password',
- button: 'Sign Up',
- buttonLogin: 'Login',
- login: 'Already have an account? Login',
- logo: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702059/CiS/logo_ch4fzv.png',
- alt: 'Form Image',
- },
- img: {
- src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1656711379/CiS/branding-and-marketing-for-product-of-startup-business_wdzfmj.png',
- alt: 'spaceship',
- },
- formHead: 'Scientific Code Should Be Open',
-
-}
\ No newline at end of file
+ head: 'Welcome to Code Is Science',
+ head2: 'Welcome back, please log in to your account',
+ labelUsername: 'Enter your username',
+ labelEmail: 'Enter your email',
+ labelPassword: 'Enter your password',
+ labelPassword2: 'Confirm your password',
+ button: 'Sign Up',
+ buttonLogin: 'Login',
+ login: 'Already have an account? Login',
+ logo: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1655702059/CiS/logo_ch4fzv.png',
+ alt: 'Form Image',
+ },
+ img: {
+ src: 'https://res.cloudinary.com/dh6j2zoog/image/upload/v1656711379/CiS/branding-and-marketing-for-product-of-startup-business_wdzfmj.png',
+ alt: 'spaceship',
+ },
+ formHead: 'Scientific Code Should Be Open',
+};
diff --git a/src/helpers/alerts.js b/src/helpers/alerts.js
index 08cdb9a..8b3dd19 100644
--- a/src/helpers/alerts.js
+++ b/src/helpers/alerts.js
@@ -1,4 +1,4 @@
import React from 'react';
-export const showSuccessMessage = success =>
{success}
;
-export const showErrorMessage = error =>
{error}
;
+export const showSuccessMessage = (success) =>
{success}
;
+export const showErrorMessage = (error) =>
{error}
;
diff --git a/src/helpers/validate.js b/src/helpers/validate.js
index 0b65264..5980be2 100644
--- a/src/helpers/validate.js
+++ b/src/helpers/validate.js
@@ -1,36 +1,51 @@
/* eslint-disable-next-line max-len */
// ----------------------------------Journal Validation------------------------------
-export const JournalValidation = (title, url, issn, rating, policyTitle,
-firstYear, lastYear, policyType, domain, date) =>{
- if(title.length<3 || url.length < 5 || issn.length<1 || rating.length<1 ||
- date.length<1 || policyTitle.length<1 || firstYear.length<1 || lastYear.length<1 ||
- policyType.length<1 || domain.length<1 || !date){
-
- return false
-
- }
-
- return true;
-
-}
+export const JournalValidation = (
+ title,
+ url,
+ issn,
+ rating,
+ policyTitle,
+ firstYear,
+ lastYear,
+ policyType,
+ domain,
+ date,
+) => {
+ if (
+ title.length < 3 ||
+ url.length < 5 ||
+ issn.length < 1 ||
+ rating.length < 1 ||
+ date.length < 1 ||
+ policyTitle.length < 1 ||
+ firstYear.length < 1 ||
+ lastYear.length < 1 ||
+ policyType.length < 1 ||
+ domain.length < 1 ||
+ !date
+ ) {
+ return false;
+ }
+
+ return true;
+};
// ----------------------------------Signup Validation------------------------------
-export const SignupValidation = ({username,email,password}) => {
- if(username<1||email<1||password<1)
- {
- return false;
- }
- return true;
-}
+export const SignupValidation = ({ username, email, password }) => {
+ if (username < 1 || email < 1 || password < 1) {
+ return false;
+ }
+ return true;
+};
// ----------------------------------Login Validation------------------------------
-export const LoginValidation = ({email,password}) => {
- if(email<1||password<1)
- {
- return false;
- }
- return true;
-}
\ No newline at end of file
+export const LoginValidation = ({ email, password }) => {
+ if (email < 1 || password < 1) {
+ return false;
+ }
+ return true;
+};
diff --git a/src/index.css b/src/index.css
index c361189..f1bc0f0 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,7 +1,7 @@
* {
box-sizing: border-box;
margin: 0;
- padding: 0;
+ padding-top: 1px;
font-family: 'Poppins', sans-serif;
}
diff --git a/src/index.js b/src/index.js
index 7b8c6a8..d5570cc 100644
--- a/src/index.js
+++ b/src/index.js
@@ -5,7 +5,7 @@ import './index.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import { BrowserRouter as Router, Switch, Route, Redirect } from 'react-router-dom';
import { Journal, Contact, Manifesto, Home } from './pages';
-import { Footer, Auth, Header, Login } from './components';
+import { Footer, Auth, Header, Login, JournalDetails } from './components';
import Navbar from './components/marginals/Navbar/Navbar';
function App() {
@@ -16,12 +16,15 @@ function App() {
+
+
+
-
+
);
diff --git a/src/pages/Contact/Contact.js b/src/pages/Contact/Contact.js
index 6b69c41..9218dbf 100644
--- a/src/pages/Contact/Contact.js
+++ b/src/pages/Contact/Contact.js
@@ -4,90 +4,88 @@ import { Container, Row, Col, Form, Button } from 'react-bootstrap';
import { ImTwitter, ImMail, ImGithub } from 'react-icons/im';
import { FaGitter } from 'react-icons/fa';
-function Contact(){
- let formIsValid = false
+function Contact() {
+ let formIsValid = false;
const [email, setEmailAttr] = useState({
value: '',
- focused: false
- })
+ focused: false,
+ });
const [subject, setSubjectAttr] = useState({
value: '',
- focused: false
- })
+ focused: false,
+ });
const [message, setMessageAttr] = useState({
value: '',
- focused: false
- })
+ focused: false,
+ });
+ const setEmailVal = (e) => setEmailAttr((prev) => ({ ...prev, value: e.target.value }));
+ const setSubjectVal = (e) => setSubjectAttr((prev) => ({ ...prev, value: e.target.value }));
+ const setMsgVal = (e) => setMessageAttr((prev) => ({ ...prev, value: e.target.value }));
- const setEmailVal = e => setEmailAttr(prev => ({ ...prev, value: e.target.value }))
- const setSubjectVal = e => setSubjectAttr(prev => ({ ...prev, value: e.target.value }))
- const setMsgVal = e => setMessageAttr(prev => ({ ...prev, value: e.target.value }))
+ const setEmailFocus = () => setEmailAttr((prev) => ({ ...prev, focused: true }));
+ const setSubjectFocus = () => setSubjectAttr((prev) => ({ ...prev, focused: true }));
+ const setMsgFocus = () => setMessageAttr((prev) => ({ ...prev, focused: true }));
- const setEmailFocus = () => setEmailAttr(prev => ({ ...prev, focused: true }))
- const setSubjectFocus = () => setSubjectAttr(prev => ({ ...prev, focused: true }))
- const setMsgFocus = () => setMessageAttr(prev => ({ ...prev, focused: true }))
+ const emailIsValid = !!email.value;
+ const subjectIsValid = !!subject.value;
+ const messageIsValid = !!message.value;
- const emailIsValid = !!email.value
- const subjectIsValid = !!subject.value
- const messageIsValid = !!message.value
+ const emailIsInvalid = email.focused && !emailIsValid;
+ const subjectIsInvalid = subject.focused && !subjectIsValid;
+ const messageIsInvalid = message.focused && !messageIsValid;
- const emailIsInvalid = email.focused && !emailIsValid
- const subjectIsInvalid = subject.focused && !subjectIsValid
- const messageIsInvalid = message.focused && !messageIsValid
-
- formIsValid = emailIsValid && subjectIsValid && messageIsValid
+ formIsValid = emailIsValid && subjectIsValid && messageIsValid;
const formSubmitHandler = (e) => {
- e.preventDefault()
+ e.preventDefault();
if (!formIsValid) {
- console.log("INVALID FORM")
- return
+ console.log('INVALID FORM');
+ return;
}
- console.log("PERFORM NETWORK REQUEST HERE")
- setEmailAttr({value:'',focused:false})
- setSubjectAttr({value:'',focused:false})
- setMessageAttr({value:'',focused:false})
-
- }
+ console.log('PERFORM NETWORK REQUEST HERE');
+ setEmailAttr({ value: '', focused: false });
+ setSubjectAttr({ value: '', focused: false });
+ setMessageAttr({ value: '', focused: false });
+ };
return (
- Contact Us
+ Contact Us
Ideas? Comments? Critiques? Want to help out? Here’s how to get in contact:
@@ -96,17 +94,17 @@ function Contact(){
@@ -114,17 +112,17 @@ function Contact(){
@@ -137,11 +135,13 @@ function Contact(){
Email
-
+ placeholder='someone@example.com'
+ />
{emailIsInvalid && Email cannot be empty.
}
@@ -151,11 +151,13 @@ function Contact(){
Subject
-
+ placeholder='Code is Science'
+ />
{subjectIsInvalid && Subject cannot be empty.
}
@@ -165,12 +167,14 @@ function Contact(){
Message
-
+ placeholder='Enter your message here...'
+ />
{messageIsInvalid && Message cannot be empty.
}
@@ -182,14 +186,16 @@ function Contact(){
- Send
+
+ Send
+
- )
-};
+ );
+}
-export default Contact
\ No newline at end of file
+export default Contact;
diff --git a/src/pages/Home.js b/src/pages/Home.js
index 22201fa..3a5c8df 100644
--- a/src/pages/Home.js
+++ b/src/pages/Home.js
@@ -1,11 +1,11 @@
import React from 'react';
import { Header, LandingSection } from '../components';
-import "../components/Landing/Header/Header.css"
+import '../components/Landing/Header/Header.css';
function Home() {
return (
-
+
);
diff --git a/src/pages/Journal/Journal.js b/src/pages/Journal/Journal.js
index 73a7f22..180519d 100644
--- a/src/pages/Journal/Journal.js
+++ b/src/pages/Journal/Journal.js
@@ -8,9 +8,9 @@ import { Container } from '../../components/Journals/styles';
const Journal = () => {
return (
-
+
- )
+ );
};
export default Journal;
diff --git a/src/pages/Manifesto/Manifesto.js b/src/pages/Manifesto/Manifesto.js
index d19ef5f..d6127ab 100644
--- a/src/pages/Manifesto/Manifesto.js
+++ b/src/pages/Manifesto/Manifesto.js
@@ -16,7 +16,7 @@ const Manifesto = () => (
-
+
Manifesto
@@ -50,7 +50,7 @@ const Manifesto = () => (
I want to express my support for the manifesto! Tell me how
-
+
(
-
-
+
+
(
on behalf of an organisation.
-
+
We’re particularly interested in adding logos and links indicating organisational support
diff --git a/src/pages/index.js b/src/pages/index.js
index b04127a..6766d1a 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -1,4 +1,4 @@
export { default as Contact } from './Contact/Contact';
export { default as Journal } from './Journal/Journal';
export { default as Manifesto } from './Manifesto/Manifesto';
-export { default as Home } from './Home';
\ No newline at end of file
+export { default as Home } from './Home';