From 275e7b02c2b445d7bd6eb2c8a7029748172a9730 Mon Sep 17 00:00:00 2001
From: Andy Nicholson <intothemist@gmail.com>
Date: Tue, 5 Jan 2021 21:57:30 +1100
Subject: [PATCH] Different style of display, depending on if its a docx or not

---
 .../component-frontpage/src/Frontpage.js      | 26 ++++++++++++++++---
 .../component-frontpage/src/queries.js        |  2 ++
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/app/components/component-frontpage/src/Frontpage.js b/app/components/component-frontpage/src/Frontpage.js
index 8c84f2610a..ff48860f1b 100644
--- a/app/components/component-frontpage/src/Frontpage.js
+++ b/app/components/component-frontpage/src/Frontpage.js
@@ -3,7 +3,7 @@ import { useQuery } from '@apollo/client'
 import { JournalContext } from '../../xpub-journal/src'
 import queries from './queries'
 import { Container, Placeholder, VisualAbstract } from './style'
-
+import Wax from '../../wax-collab/src/Editoria'
 
 import {
   Spinner,
@@ -24,7 +24,13 @@ const Frontpage = ({ history, ...props }) => {
   const [page, setPage] = useState(1)
   const limit = 2
   const sort = sortName && sortDirection && `${sortName}_${sortDirection}`
-    
+ 
+  const skipXSweet = file =>
+  !(
+    file.mimeType ===
+    'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
+  )
+
 
   const { loading, data, error } = useQuery(queries.frontpage, {
     variables: {
@@ -86,9 +92,10 @@ const Frontpage = ({ history, ...props }) => {
               </p> : <br/> }
               
               {manuscript.files.length > 0 ? 
+
               <div>
-                Submitted files:
                 {manuscript.files.map(file => (
+		  skipXSweet(file) && 
                   <p>
                     <a
                       href={file.url}
@@ -99,6 +106,19 @@ const Frontpage = ({ history, ...props }) => {
                     </a>
                   </p>
                 ))}
+                {manuscript.files.map(file => (
+		  (! skipXSweet(file)) && 
+
+		    <p> 
+			<Wax 
+			content={manuscript.meta.source}
+			readonly
+			/>
+		    </p>
+
+                ))}
+
+
               </div> : <br/> }
 
               {manuscript.submission?.links ? 
diff --git a/app/components/component-frontpage/src/queries.js b/app/components/component-frontpage/src/queries.js
index f3a943443b..3e60696493 100644
--- a/app/components/component-frontpage/src/queries.js
+++ b/app/components/component-frontpage/src/queries.js
@@ -36,12 +36,14 @@ export default {
             url
             filename
             fileType
+	    mimeType
           }
           meta {
             manuscriptId
             title
             articleSections
             articleType
+	    source
             history {
               type
               date
-- 
GitLab