Add color to classes

This commit is contained in:
Leonardo Murça 2022-06-21 22:46:35 -03:00
parent a126ca9419
commit 8b149806e8
3 changed files with 10 additions and 2 deletions

View file

@ -8,18 +8,19 @@ import {
Stack, Stack,
} from '@mui/material'; } from '@mui/material';
function ClassCard({ abbreviation, title, teachers }) { function ClassCard({ abbreviation, title, color, teachers }) {
return ( return (
<Card sx={{ width: 420 }}> <Card sx={{ width: 420 }}>
<CardActionArea sx={{ display: 'flex', flexDirection: 'row' }}> <CardActionArea sx={{ display: 'flex', flexDirection: 'row' }}>
<Container <Container
sx={{ sx={{
backgroundColor: 'tomato', backgroundColor: color,
width: '140px', width: '140px',
height: '145px', height: '145px',
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
color: 'white',
}} }}
> >
<h1>{abbreviation}</h1> <h1>{abbreviation}</h1>

View file

@ -11,6 +11,7 @@ const getClassrooms = userId =>
{ {
name: 'Introdução à Ciência de Dados', name: 'Introdução à Ciência de Dados',
abbreviation: 'ICD', abbreviation: 'ICD',
color: '#006FF2',
teachers: [ teachers: [
{ {
name: 'Carlos Alexandre Silva', name: 'Carlos Alexandre Silva',
@ -22,6 +23,7 @@ const getClassrooms = userId =>
{ {
name: 'Gestão de Projetos', name: 'Gestão de Projetos',
abbreviation: 'GP', abbreviation: 'GP',
color: '#7900F2',
teachers: [ teachers: [
{ {
name: 'Míriam Lúcia Barbosa', name: 'Míriam Lúcia Barbosa',
@ -32,6 +34,7 @@ const getClassrooms = userId =>
{ {
name: 'Banco de Dados II', name: 'Banco de Dados II',
abbreviation: 'BDII', abbreviation: 'BDII',
color: '#FF7A00',
teachers: [ teachers: [
{ {
name: 'Cristiane Norbiato Targa', name: 'Cristiane Norbiato Targa',
@ -43,6 +46,7 @@ const getClassrooms = userId =>
{ {
name: 'Contabilidade Básica', name: 'Contabilidade Básica',
abbreviation: 'CB', abbreviation: 'CB',
color: '#BB0000',
teachers: [ teachers: [
{ {
name: 'Alexandre Couto Cardoso', name: 'Alexandre Couto Cardoso',
@ -53,6 +57,7 @@ const getClassrooms = userId =>
{ {
name: 'Linguagens de Programação', name: 'Linguagens de Programação',
abbreviation: 'LP', abbreviation: 'LP',
color: '#039200',
teachers: [ teachers: [
{ {
name: 'Gabriel Felipe Cândido Novy', name: 'Gabriel Felipe Cândido Novy',

View file

@ -38,6 +38,7 @@ function Home() {
key={classroom.name} key={classroom.name}
abbreviation={classroom.abbreviation} abbreviation={classroom.abbreviation}
title={classroom.name} title={classroom.name}
color={classroom.color}
teachers={classroom.teachers} teachers={classroom.teachers}
/> />
)) ))
@ -67,6 +68,7 @@ function Home() {
key={classroom.name} key={classroom.name}
abbreviation={classroom.abbreviation} abbreviation={classroom.abbreviation}
title={classroom.name} title={classroom.name}
color={classroom.color}
teachers={classroom.teachers} teachers={classroom.teachers}
/> />
)) ))