From 5009b75872b2d28210cfc5362f213fea51a1ee95 Mon Sep 17 00:00:00 2001 From: rodcoffani Date: Wed, 1 Apr 2020 03:37:11 -0300 Subject: [PATCH 1/5] new route /activities --- src/components/Header/index.js | 1 + src/pages/Activities/index.js | 17 +++++++++++++++++ src/pages/Activities/useStyles.js | 21 +++++++++++++++++++++ src/router/routes.js | 4 ++++ 4 files changed, 43 insertions(+) create mode 100644 src/pages/Activities/index.js create mode 100644 src/pages/Activities/useStyles.js diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 8e9e1de..790c398 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -109,6 +109,7 @@ const Header = memo(() => {
{isAdmin && } + { + const classes = useStyles(); + return ( + +
+

Atividades

+
+
+ ); +}); + +export default Activities; diff --git a/src/pages/Activities/useStyles.js b/src/pages/Activities/useStyles.js new file mode 100644 index 0000000..b84da15 --- /dev/null +++ b/src/pages/Activities/useStyles.js @@ -0,0 +1,21 @@ +import { makeStyles } from '@material-ui/core'; + +export default makeStyles(theme => ({ + container: { + margin: theme.spacing(5), + justifyContent: 'center', + }, + divider: { + width: 140, + height: 2, + background: 'black', + position: 'absolute', + left: 'calc(50% - 60px)', + marginTop: 8, + }, + title: { + textAlign: 'center', + fontSize: 22, + textTransform: 'uppercase', + }, +})); diff --git a/src/router/routes.js b/src/router/routes.js index 623ec8c..d06b3d0 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -8,6 +8,7 @@ import Donate from '../pages/Donate'; import History from '../pages/History'; import Login from '../pages/Login'; import RegisterUser from '../pages/Users'; +import Activities from '../pages/Activities'; import WithAuth from '../hocs/WithAuth'; const Routes = memo(() => { @@ -44,6 +45,9 @@ const Routes = memo(() => { + + +
From 485c9444fe45f457fea39d976c29bc0bba120517 Mon Sep 17 00:00:00 2001 From: rodcoffani Date: Wed, 1 Apr 2020 04:53:08 -0300 Subject: [PATCH 2/5] Table component --- src/components/ActivitiesTable/index.js | 70 +++++++++++++++++++++ src/components/ActivitiesTable/useStyles.js | 7 +++ 2 files changed, 77 insertions(+) create mode 100644 src/components/ActivitiesTable/index.js create mode 100644 src/components/ActivitiesTable/useStyles.js diff --git a/src/components/ActivitiesTable/index.js b/src/components/ActivitiesTable/index.js new file mode 100644 index 0000000..93e53a3 --- /dev/null +++ b/src/components/ActivitiesTable/index.js @@ -0,0 +1,70 @@ +import React, { memo } from 'react'; +import { + TableContainer, + Table, + TableHead, + TableRow, + TableCell, + TableBody, + Paper, +} from '@material-ui/core'; + +import useStyles from './useStyles'; + +const ActivitiesTable = memo(() => { + const classes = useStyles(); + + function createData(activity, description, coins) { + return { activity, description, coins }; + } + + const rows = [ + createData( + 'ARTIGO_1000', + 'Artigos exclusivos de 1000 ou mais palavras postados no blog da EZ.devs', + 25, + ), + createData( + 'ARTIGO_500', + 'Artigos exclusivos de 500 a 699 palavras postados no blog da EZ.devs', + 10, + ), + createData( + 'ARTIGO_700', + 'Artigos exclusivos de 700 a 999 palavras postados no blog da EZ.devs', + 15, + ), + createData( + 'ARTIGO_TRADUÇÃO', + 'Traduzir um artigo seu para o inglês, e publicá-lo no medium da ez', + 5, + ), + ]; + + return ( + + + + + Atividades + Descrição + Coins + + + + {rows.map(row => ( + + + {row.activity} + + {row.description} + {row.coins} + + ))} + +
+
+ ); +}); + +export default ActivitiesTable; diff --git a/src/components/ActivitiesTable/useStyles.js b/src/components/ActivitiesTable/useStyles.js new file mode 100644 index 0000000..1f83e21 --- /dev/null +++ b/src/components/ActivitiesTable/useStyles.js @@ -0,0 +1,7 @@ +import { makeStyles } from '@material-ui/core'; + +export default makeStyles({ + table: { + minWidth: 650, + }, +}); From 4a4e398e9719610d340f870ff77f0b6cc6256e8f Mon Sep 17 00:00:00 2001 From: rodcoffani Date: Wed, 1 Apr 2020 04:55:26 -0300 Subject: [PATCH 3/5] Add activities page --- src/pages/Activities/index.js | 4 ++++ src/pages/Activities/useStyles.js | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pages/Activities/index.js b/src/pages/Activities/index.js index 1bba248..9d2ad95 100644 --- a/src/pages/Activities/index.js +++ b/src/pages/Activities/index.js @@ -3,13 +3,17 @@ import { Container } from '@material-ui/core'; import useStyles from './useStyles'; +import ActivitiesTable from '../../components/ActivitiesTable'; + const Activities = memo(() => { const classes = useStyles(); + return (

Atividades

+
); }); diff --git a/src/pages/Activities/useStyles.js b/src/pages/Activities/useStyles.js index b84da15..7265281 100644 --- a/src/pages/Activities/useStyles.js +++ b/src/pages/Activities/useStyles.js @@ -5,14 +5,6 @@ export default makeStyles(theme => ({ margin: theme.spacing(5), justifyContent: 'center', }, - divider: { - width: 140, - height: 2, - background: 'black', - position: 'absolute', - left: 'calc(50% - 60px)', - marginTop: 8, - }, title: { textAlign: 'center', fontSize: 22, From 19fe3918ae823b46a1a9838f3090b88329a5699a Mon Sep 17 00:00:00 2001 From: rodcoffani Date: Fri, 3 Apr 2020 15:48:02 -0300 Subject: [PATCH 4/5] activities mock page --- src/components/ActivitiesTable/index.js | 24 +++++++++++++++++++++++- src/pages/Activities/index.js | 8 ++++---- src/pages/Activities/useStyles.js | 8 ++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/components/ActivitiesTable/index.js b/src/components/ActivitiesTable/index.js index 93e53a3..986815d 100644 --- a/src/components/ActivitiesTable/index.js +++ b/src/components/ActivitiesTable/index.js @@ -39,6 +39,28 @@ const ActivitiesTable = memo(() => { 'Traduzir um artigo seu para o inglês, e publicá-lo no medium da ez', 5, ), + createData( + 'EVENTO_PARTICIPAÇÃO', + 'Participar de eventos relacionados a área de TI, e postar uma foto no instagram marcando @ez.devs ou enviar a foto para o Ed do marketing.', + 5, + ), + createData('EVENTO_REALIZAÇÃO', 'Realizar evento, workshop, bootcamp pela Ez.devs.', 35), + createData('EZ.TALKS', 'Realizar o ez.talks na ez para o pessoal da empresa.', 15), + createData('OPEN_SOURCE_LIB', 'Disponibilizar uma lib própria para comunidade.', 15), + createData( + 'OS_PR_ACEITO', + 'Contribuir de forma relevante com algum projeto open source da comunidade. PR tem sido aceito pelo owner do projeto. ', + 10, + ), + createData( + 'OS_PR_SUBMETIDO', + 'Contribuir de forma relevante com algum projeto open source da comunidade. PR submetido, mas não aceito.', + 5, + ), + createData('PALESTRA', 'Realizar palestra pela EZ.devs.', 25), + createData('VÍDEO_CONTEÚDO', 'Gravar um vídeo de conteúdo para o canal da EZ.devs.', 15), + createData('VÍDEO_INSTAGRAM', 'Gravar vídeo para o Insta da EZ.devs.', 10), + createData('VÍDEO_PARTICIPAÇÃO', 'Gravar vídeo para o canal do Youtube como "entrevistado"', 5), ]; return ( @@ -57,7 +79,7 @@ const ActivitiesTable = memo(() => { {row.activity} - {row.description} + {row.description} {row.coins} ))} diff --git a/src/pages/Activities/index.js b/src/pages/Activities/index.js index 9d2ad95..2713c43 100644 --- a/src/pages/Activities/index.js +++ b/src/pages/Activities/index.js @@ -1,5 +1,5 @@ import React, { memo } from 'react'; -import { Container } from '@material-ui/core'; +import { Container, Divider } from '@material-ui/core'; import useStyles from './useStyles'; @@ -7,11 +7,11 @@ import ActivitiesTable from '../../components/ActivitiesTable'; const Activities = memo(() => { const classes = useStyles(); - return ( -
-

Atividades

+
+
Atividades
+
diff --git a/src/pages/Activities/useStyles.js b/src/pages/Activities/useStyles.js index 7265281..26f44aa 100644 --- a/src/pages/Activities/useStyles.js +++ b/src/pages/Activities/useStyles.js @@ -5,6 +5,14 @@ export default makeStyles(theme => ({ margin: theme.spacing(5), justifyContent: 'center', }, + divider: { + width: 120, + height: 2, + background: 'black', + position: 'absolute', + left: 'calc(50% - 60px)', + marginTop: 8, + }, title: { textAlign: 'center', fontSize: 22, From 708212274f10f1f7270bf0aafba4f6d4142d9352 Mon Sep 17 00:00:00 2001 From: rodcoffani Date: Fri, 10 Apr 2020 16:20:42 -0300 Subject: [PATCH 5/5] activities route only for admin --- src/components/Header/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header/index.js b/src/components/Header/index.js index 790c398..8b2244f 100644 --- a/src/components/Header/index.js +++ b/src/components/Header/index.js @@ -109,7 +109,7 @@ const Header = memo(() => {
{isAdmin && } - + {isAdmin && }