From 651d6a383bc5fae2b622e5c2cc9354cf87b0b6aa Mon Sep 17 00:00:00 2001
From: Alexandru Munteanu <alexandru.munt@gmail.com>
Date: Fri, 14 Sep 2018 18:30:38 +0300
Subject: [PATCH] fix(footer): add mailto in footer; fix paddings

---
 .../component-faraday-selectors/src/index.js    | 17 +++++++++++++++++
 packages/component-faraday-ui/src/Footer.js     | 14 +++++++++-----
 .../src/components/Admin/AdminUsers.js          | 12 +++++++++---
 .../src/components/Dashboard/DashboardItems.js  |  2 +-
 .../components/SignUp/SignUpInvitationForm.js   |  2 +-
 packages/xpub-faraday/app/FaradayApp.js         |  4 ++--
 .../xpub-faraday/app/config/journal/metadata.js |  4 ++--
 7 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/packages/component-faraday-selectors/src/index.js b/packages/component-faraday-selectors/src/index.js
index 60c7b7764..c90d2fec5 100644
--- a/packages/component-faraday-selectors/src/index.js
+++ b/packages/component-faraday-selectors/src/index.js
@@ -145,3 +145,20 @@ export const currentUserIsReviewer = (state, fragmentId) => {
       i.isAccepted,
   )
 }
+
+export const getAdminUsers = state =>
+  chain(state)
+    .get('users.users')
+    .map(u => {
+      let sortValue = -1
+      if (u.isActive) sortValue = 1
+      if (!u.isConfirmed) sortValue = 0
+      return {
+        user: u,
+        sortValue,
+      }
+    })
+    .sortBy('sortValue')
+    .map(s => s.user)
+    .reverse()
+    .value()
diff --git a/packages/component-faraday-ui/src/Footer.js b/packages/component-faraday-ui/src/Footer.js
index eb8529c85..4a237f254 100644
--- a/packages/component-faraday-ui/src/Footer.js
+++ b/packages/component-faraday-ui/src/Footer.js
@@ -1,26 +1,30 @@
 import React from 'react'
+import { get } from 'lodash'
 import styled from 'styled-components'
 import { th } from '@pubsweet/ui-toolkit'
+import { withJournal } from 'xpub-journal'
 
 import { ActionLink, Row, Text } from './'
 
-const Footer = () => (
+const Footer = ({ journal }) => (
   <Root alignItems="center" justify="center">
     <ActionLink to="https://hindawi.com">Hindawi</ActionLink>
-    <ActionLink ml={4} to="https://www.hindawi.com/privacy/">
+    <ActionLink ml={3} to="https://www.hindawi.com/privacy/">
       Privacy Policy
     </ActionLink>
-    <ActionLink ml={4} to="https://www.hindawi.com/terms/">
+    <ActionLink ml={3} to="https://www.hindawi.com/terms/">
       Terms of Service
     </ActionLink>
     <Text ml={4} secondary>
       {`Support: `}
-      <ActionLink to="https://hindawi.com">bca@hindawi.com</ActionLink>
+      <ActionLink to={`mailto:${get(journal, 'metadata.email')}`}>
+        {get(journal, 'metadata.email')}
+      </ActionLink>
     </Text>
   </Root>
 )
 
-export default Footer
+export default withJournal(Footer)
 
 const Root = styled(Row)`
   background-color: ${th('colorBackground')};
diff --git a/packages/components-faraday/src/components/Admin/AdminUsers.js b/packages/components-faraday/src/components/Admin/AdminUsers.js
index 38feb4509..935f2f686 100644
--- a/packages/components-faraday/src/components/Admin/AdminUsers.js
+++ b/packages/components-faraday/src/components/Admin/AdminUsers.js
@@ -8,6 +8,7 @@ import { actions } from 'pubsweet-client'
 import { ConnectPage } from 'xpub-connect'
 import { withJournal } from 'xpub-journal'
 import { compose, withHandlers, withProps } from 'recompose'
+import { getAdminUsers } from 'pubsweet-component-faraday-selectors'
 
 import {
   Row,
@@ -141,9 +142,14 @@ const Users = ({
 
 export default compose(
   ConnectPage(() => [actions.getUsers()]),
-  connect(state => ({ items: get(state, 'users.users') }), {
-    getUsers: actions.getUsers,
-  }),
+  connect(
+    state => ({
+      items: getAdminUsers(state),
+    }),
+    {
+      getUsers: actions.getUsers,
+    },
+  ),
   withJournal,
   withFetching,
   withPagination,
diff --git a/packages/components-faraday/src/components/Dashboard/DashboardItems.js b/packages/components-faraday/src/components/Dashboard/DashboardItems.js
index 096a98f5e..c97ff0b1f 100644
--- a/packages/components-faraday/src/components/Dashboard/DashboardItems.js
+++ b/packages/components-faraday/src/components/Dashboard/DashboardItems.js
@@ -56,7 +56,7 @@ export default compose(
 
 // #region styles
 const Root = styled.div`
-  max-height: calc(100vh - ${th('gridUnit')} * 23);
+  max-height: calc(100vh - ${th('gridUnit')} * 25);
   overflow-y: auto;
   padding-right: ${th('gridUnit')};
   overflow-x: hidden;
diff --git a/packages/components-faraday/src/components/SignUp/SignUpInvitationForm.js b/packages/components-faraday/src/components/SignUp/SignUpInvitationForm.js
index 73b856696..b4f9d3f01 100644
--- a/packages/components-faraday/src/components/SignUp/SignUpInvitationForm.js
+++ b/packages/components-faraday/src/components/SignUp/SignUpInvitationForm.js
@@ -18,7 +18,7 @@ const SignUpInvitation = ({
   initialValues,
   title = 'Add New Account Details',
 }) => (
-  <ShadowedBox center mt={10}>
+  <ShadowedBox center mb={3} mt={10}>
     <H2>{title}</H2>
     {error && <Text error>Token expired or Something went wrong.</Text>}
     {step === 0 && (
diff --git a/packages/xpub-faraday/app/FaradayApp.js b/packages/xpub-faraday/app/FaradayApp.js
index 6c041701d..2494ed100 100644
--- a/packages/xpub-faraday/app/FaradayApp.js
+++ b/packages/xpub-faraday/app/FaradayApp.js
@@ -93,7 +93,7 @@ const Root = styled.div`
 const appBarPaddingHelper = props =>
   props.canCreateDraft
     ? css`
-        padding-top: calc(${th('appBar.height')});
+        padding-top: calc(${th('appBar.height')} + ${th('gridUnit')});
         padding-right: calc(${th('gridUnit')} * 12);
         padding-left: calc(${th('gridUnit')} * 12);
         padding-bottom: calc(${th('gridUnit')} * 5);
@@ -104,7 +104,7 @@ const appBarPaddingHelper = props =>
         }
       `
     : css`
-        padding-top: calc(${th('appBar.height')} + ${th('gridUnit')} * 3);
+        padding-top: calc(${th('appBar.height')} + ${th('gridUnit')} * 4);
         padding-right: calc(${th('gridUnit')} * 12);
         padding-left: calc(${th('gridUnit')} * 12);
         padding-bottom: calc(${th('gridUnit')} * 5);
diff --git a/packages/xpub-faraday/app/config/journal/metadata.js b/packages/xpub-faraday/app/config/journal/metadata.js
index c654de524..a204afcbc 100644
--- a/packages/xpub-faraday/app/config/journal/metadata.js
+++ b/packages/xpub-faraday/app/config/journal/metadata.js
@@ -2,13 +2,13 @@ module.exports = {
   issn: '2474-7394',
   logo: '/assets/logo-hindawi@2x.png',
   nameText: 'Bioinorganic Chemistry and Applications',
-  email: 'hindawi+staff@thinslices.com',
+  email: 'bca.support@hindawi.com',
   mts: {
     doctype: 'article SYSTEM "JATS-archivearticle1-mathml3.dtd"',
     dtdVersion: '1.1d1',
     articleType: 'Research Article',
     journalIdPublisher: 'research',
-    email: 'hindawi+staff@thinslices.com',
+    email: 'bca.support@hindawi.com',
     journalTitle: 'Bioinorganic Chemistry and Applications',
     issn: '2474-7394',
     prefix: 'RESEARCH-BCA-',
-- 
GitLab