From 476db89eea9478c71419763ed172a3dc07e80b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Thu, 15 Sep 2022 21:06:26 -0300 Subject: [PATCH] Add mobile profile layout --- src/screens/Profile/View.js | 69 +++++++++----------- src/screens/Profile/index.js | 6 +- src/screens/Profile/styles.js | 116 +++++++++++++++++++++++++++++++++- 3 files changed, 148 insertions(+), 43 deletions(-) diff --git a/src/screens/Profile/View.js b/src/screens/Profile/View.js index 01be7bb..9cd44ea 100644 --- a/src/screens/Profile/View.js +++ b/src/screens/Profile/View.js @@ -17,58 +17,49 @@ import InputMask from '../../components/InputMask'; import { COURSES } from '../../utils/constants'; import { createArrayFrom1ToN } from '../../utils/createArrayFrom1ToN'; +import styles from './styles'; -function View({ data, onChangeInput }) { +function View({ data, onChangeInput, layoutType }) { + const { + profileSummaryBox, + avatar, + profileSummaryStack, + formBox, + formField, + formStack, + fullNameTypography, + button, + } = styles[layoutType]; const fullName = `${data.firstName} ${data.lastName}`; const currentYear = dayjs().year(); return ( - - - - + + + + {fullName} - + Estudante de {COURSES.filter(c => c.value === data.course)[0].name} - - Turma de {data.year} - - + Turma de {data.year} + RA: {data.ra} - - + + @@ -79,7 +70,7 @@ function View({ data, onChangeInput }) { label="Sobrenome" variant="standard" type="text" - sx={{ width: '45%' }} + sx={formField} value={data.lastName} onChange={onChangeInput} /> @@ -93,7 +84,7 @@ function View({ data, onChangeInput }) { value={data.phone} onChange={onChangeInput} placeholder="(##) #####-####" - sx={{ width: '45%' }} + sx={formField} InputProps={{ inputComponent: InputMask, }} @@ -107,7 +98,7 @@ function View({ data, onChangeInput }) { type="email" value={data.email} onChange={onChangeInput} - sx={{ width: '45%' }} + sx={formField} /> - + Curso @@ -141,7 +132,7 @@ function View({ data, onChangeInput }) { ))} - + Ano da turma @@ -170,14 +161,14 @@ function View({ data, onChangeInput }) { value={data.ra} placeholder="#######" disabled - sx={{ width: '45%', cursor: 'no-drop' }} + sx={{ ...formField, cursor: 'no-drop' }} InputProps={{ inputComponent: InputMask, }} />