From 0389ad42579135de2b150f1c32125af27479fd63 Mon Sep 17 00:00:00 2001 From: Akosah Date: Fri, 2 Feb 2024 12:41:35 -0500 Subject: [PATCH 1/3] simplify contribute and tagging pages --- .../pages/contribute/ContributeLanding.tsx | 21 +++++++++--- .../src/pages/contribute/TaggingInterface.tsx | 34 +++++++++---------- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/packages/client/src/pages/contribute/ContributeLanding.tsx b/packages/client/src/pages/contribute/ContributeLanding.tsx index eb032f38..de090fb7 100644 --- a/packages/client/src/pages/contribute/ContributeLanding.tsx +++ b/packages/client/src/pages/contribute/ContributeLanding.tsx @@ -1,16 +1,19 @@ import { Typography, Box, Stack, Button } from '@mui/material'; import { useNavigate } from 'react-router-dom'; import { useStudy } from '../../context/Study.context'; +import { TagProvider, useTag } from '../../context/Tag.context'; -export const ContributeLanding: React.FC = () => { +const ContributeLandingInernal: React.FC = () => { const navigate = useNavigate(); const { study } = useStudy(); + const { tag } = useTag(); const enterTagging = () => { navigate('/contribute/tagging'); }; // TODO: Add in check for training completion + return ( <> {study && ( @@ -22,13 +25,23 @@ export const ContributeLanding: React.FC = () => { Study: {study.name} Description: {study.description} Instructions: {study.instructions} - + )} ); }; + +export const ContributeLanding = () => { + return ( + + + + + + ); +}; diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx index 84b8dc26..4165a7f9 100644 --- a/packages/client/src/pages/contribute/TaggingInterface.tsx +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -4,24 +4,22 @@ import { TagForm } from '../../components/contribute/TagForm.component'; import { useStudy } from '../../context/Study.context'; import { useEffect, useState } from 'react'; import { useCompleteTagMutation } from '../../graphql/tag/tag'; -import { NoTagNotification } from '../../components/contribute/NoTagNotification.component'; import { Study } from '../../graphql/graphql'; import { TagProvider, useTag } from '../../context/Tag.context'; export const TaggingInterface: React.FC = () => { const { study } = useStudy(); - // TODO: View for when there is no study vs when there is no tag return ( - <> - + + <> {study && ( <> )} - - + + ); }; @@ -53,20 +51,20 @@ const MainView: React.FC = (props) => { return ( <> - {tag ? ( + {tag && ( - - + <> + + + - ) : ( - )} ); From be5fb42eb9c657af225f1458299ab6baa83e3d7e Mon Sep 17 00:00:00 2001 From: Akosah Date: Fri, 2 Feb 2024 12:57:21 -0500 Subject: [PATCH 2/3] remove unnecessary changes --- .../pages/contribute/ContributeLanding.tsx | 2 - .../src/pages/contribute/TaggingInterface.tsx | 37 +++++++++---------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/packages/client/src/pages/contribute/ContributeLanding.tsx b/packages/client/src/pages/contribute/ContributeLanding.tsx index de090fb7..33dcb0cf 100644 --- a/packages/client/src/pages/contribute/ContributeLanding.tsx +++ b/packages/client/src/pages/contribute/ContributeLanding.tsx @@ -38,10 +38,8 @@ const ContributeLandingInernal: React.FC = () => { export const ContributeLanding = () => { return ( - - ); }; diff --git a/packages/client/src/pages/contribute/TaggingInterface.tsx b/packages/client/src/pages/contribute/TaggingInterface.tsx index 4165a7f9..edb6f3bd 100644 --- a/packages/client/src/pages/contribute/TaggingInterface.tsx +++ b/packages/client/src/pages/contribute/TaggingInterface.tsx @@ -6,19 +6,18 @@ import { useEffect, useState } from 'react'; import { useCompleteTagMutation } from '../../graphql/tag/tag'; import { Study } from '../../graphql/graphql'; import { TagProvider, useTag } from '../../context/Tag.context'; +import { NoTagNotification } from '../../components/contribute/NoTagNotification.component'; export const TaggingInterface: React.FC = () => { const { study } = useStudy(); // TODO: View for when there is no study vs when there is no tag return ( - <> - {study && ( - <> - - - )} - + {study && ( + <> + + + )} ); }; @@ -51,20 +50,20 @@ const MainView: React.FC = (props) => { return ( <> - {tag && ( + {tag ? ( - <> - - - + + + ) : ( + )} ); From c54c39650278225f66379d58467a42c0a47cef75 Mon Sep 17 00:00:00 2001 From: Akosah Date: Fri, 2 Feb 2024 13:39:11 -0500 Subject: [PATCH 3/3] minor changes --- .../client/src/pages/contribute/ContributeLanding.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/pages/contribute/ContributeLanding.tsx b/packages/client/src/pages/contribute/ContributeLanding.tsx index 33dcb0cf..5272fd17 100644 --- a/packages/client/src/pages/contribute/ContributeLanding.tsx +++ b/packages/client/src/pages/contribute/ContributeLanding.tsx @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom'; import { useStudy } from '../../context/Study.context'; import { TagProvider, useTag } from '../../context/Tag.context'; -const ContributeLandingInernal: React.FC = () => { +const ContributeLandingInternal: React.FC = () => { const navigate = useNavigate(); const { study } = useStudy(); const { tag } = useTag(); @@ -36,10 +36,10 @@ const ContributeLandingInernal: React.FC = () => { ); }; -export const ContributeLanding = () => { +export const ContributeLanding: React.FC = () => { return ( - - - + + + ); };