# Session: MonkChat - React js
>[color=purple]**Autor:** Letícia Rodrigues da Silva
**Turma:** IndoD
**Número:** 25
[toc]
## Components/cabecalho
### index.js
```javascript=
import { Traco, Containerc } from './styled'
export default function Cabecalho(){
return (
<Containerc>
<div class="logo"><img src="/assets/images/monk.png" alt="" /></div>
<Traco/>
<div class="titulo">MonkChat</div>
</Containerc>
)
}
```
### styled.js
```javascript=
import styled from "styled-components";
const Traco = styled.div`
background: linear-gradient(180deg, #ba9d4c -10.17%, #f3d991 115.25%);
width: 4px;
height: 3em;
margin: 0em 1em;
border-radius: 1em;
`
const Containerc = styled.div`
display: flex;
flex-direction: row;
margin-left: 2em;
.titulo {
color: #ffffff;
font-size: 36px;
font-weight: 700;
font-family: montserrat;
margin-top: 7px;
}
`
export {Traco, Containerc}
```
## Pages/monkchat
### index.js
```javascript=
import {Container, BoxSite, BotaoMonk, BotaoMonk2, CInput, CInput2, CTextarea} from './styled'
import Cabecalho from "../../components/cabecalho"
export default function Monkchat() {
return (
<Container>
<Cabecalho/>
<BoxSite>
<div class="box1">
<div class="box-1">
<div class="text-box">
<div class="text1">Sala:</div>
<CInput/>
</div>
<div class="text-box2">
<div class="text2">Nick:</div>
<CInput2/>
</div>
<div class="box-botoes">
<BotaoMonk>Criar</BotaoMonk>
<BotaoMonk>Entrar</BotaoMonk>
</div>
</div>
<div class="box-2">
<div class="texto">Mensagem:</div>
<CTextarea/>
<BotaoMonk2>Enviar</BotaoMonk2>
</div>
</div>
<div class="box2">
<div class="circulo">
<img src="../../assets/images/seta-carregar.png" alt=""/>
</div>
<div class="box-maior">
<div class="chat">
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:03:25) <span>Brunex</span> fala para <span>Todos</span>:
Opa, tudo bem ai?
</div>
<div class="t1">
(15:03:25) <span>Brunex</span> saiu da sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
<div class="t1">
(15:02:01) <span>Brunex</span> entrou na sala...
</div>
</div>
</div>
</div>
</BoxSite>
</Container>
)
}
```
### s-chat.js
```javascript=
import styled from "styled-components";
const BoxSite = styled.div`
display: flex;
flex-direction: row;
background: #4d34a8;
width: 85em;
height: 38em;
margin: 3em 5em 0em 5em;
.box1 {
display: flex;
flex-direction: column;
margin: 3em 0em 3em 3em;
}
.box-1 {
display: flex;
flex-direction: column;
}
.text-box,
.text-box2 {
display: flex;
flex-direction: row;
}
.text1 {
font-size: 24px;
color: #ffffff;
padding-right: 13px;
}
.text2 {
font-size: 24px;
color: #ffffff;
}
.box-nmsala input {
font-family: Montserrat;
font-size: 16px;
background-color: #ffffff;
width: 10em;
height: 1.7em;
border-radius: 4px;
border: 0px;
}
.box-nm input {
font-family: montserrat-regular;
font-size: 16px;
background-color: #ffffff;
width: 10em;
height: 1.7em;
border-radius: 4px;
border: 0px;
margin: 10px 0px 0px 10px;
}
.box-botoes {
display: flex;
flex-direction: row;
justify-content: flex-end;
margin: 10px 0px 60px 0px;
}
.botao1 button {
width: 80px;
height: 30px;
background-color: #50b4bf;
color: #ffffff;
border: 0px;
border-radius: 20px;
font-family: montserrat;
font-size: 16px;
margin-right: 5px;
cursor: pointer;
}
.botao2 button {
width: 80px;
height: 30px;
background-color: #50b4bf;
color: #ffffff;
border: 0px;
border-radius: 20px;
font-family: montserrat;
font-size: 16px;
cursor: pointer;
}
.box-2 {
display: flex;
flex-direction: column;
}
.texto {
font-family: montserrat;
font-size: 24px;
color: #ffffff;
margin-bottom: 7px;
}
`
export {BoxSite}
```
### styled.js
```javascript=
import styled from "styled-components";
const Container = styled.div`
display: flex;
flex-direction: column;
padding: 2em 2em;
background-color: #583BBF;
height: 100vh;
width: 100%;
margin: 0px;
font-family: Montserrat;
`
const BoxSite = styled.div`
display: flex;
flex-direction: row;
background: #4d34a8;
width: 85em;
height: 38em;
margin: 3em 5em 0em 5em;
.box1 {
display: flex;
flex-direction: column;
margin: 3em 0em 3em 3em;
}
.box-1 {
display: flex;
flex-direction: column;
}
.text-box,
.text-box2 {
display: flex;
flex-direction: row;
}
.text1 {
font-family: montserrat;
font-size: 24px;
color: #ffffff;
padding-right: 13px;
}
.text2 {
font-family: montserrat;
font-size: 24px;
color: #ffffff;
}
.box-nmsala input {
font-family: montserrat;
font-size: 16px;
background-color: #ffffff;
width: 10em;
height: 1.7em;
border-radius: 4px;
border: 0px;
}
.box-nm input {
font-family: montserrat-regular;
font-size: 16px;
background-color: #ffffff;
width: 10em;
height: 1.7em;
border-radius: 4px;
border: 0px;
margin: 10px 0px 0px 10px;
}
.box-botoes {
display: flex;
flex-direction: row;
justify-content: flex-end;
margin: 10px 0px 60px 0px;
}
.box-2 {
display: flex;
flex-direction: column;
}
.texto {
font-family: montserrat;
font-size: 24px;
color: #ffffff;
margin-bottom: 7px;
}
.box2 {
display: flex;
flex-direction: column;
margin: 1.5em 0em 0em 4em;
align-items: flex-end;
}
.circulo:hover {
cursor: pointer;
transform: rotate(100deg);
}
.box-maior {
display: flex;
flex-direction: column;
background-color: #6337b3;
width: 55em;
height: 30em;
border-radius: 3px;
font-family: montserrat-light;
font-size: 16px;
line-height: 30px;
}
.chat {
display: flex;
flex-direction: column;
padding: 1.5em 0em 0em 1.5em;
overflow-y: auto;
color: #ffffff;
}
.t1 span {
font-weight: 700;
}
.chat::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #3e006e;
}
.chat::-webkit-scrollbar {
width: 9px;
background-color: #3e006e;
border-radius: 10px;
}
.chat::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
background-color: #cbcbcb;
}
`
const BotaoMonk = styled.button`
width: 80px;
height: 30px;
background-color: #50b4bf;
color: #ffffff;
border: 0px;
border-radius: 20px;
font-size: 16px;
margin-right: 5px;
cursor: pointer;
&:hover {
box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24),
0 17px 50px 0 rgba(0, 0, 0, 0.19);
transform: scale(1.02);
transition: 0.1s;
}
`
const BotaoMonk2 = styled.button`
width: 100px;
height: 30px;
background-color: #50b4bf;
color: #ffffff;
border: 0px;
border-radius: 20px;
font-family: montserrat;
font-size: 16px;
margin: 0.7em 0em 0em 7.5em;
cursor: pointer;
&:hover {
box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24),
0 17px 50px 0 rgba(0, 0, 0, 0.19);
transform: scale(1.02);
transition: 0.1s;
}
`
const CInput = styled.input`
font-size: 16px;
background-color: #ffffff;
width: 10em;
height: 1.7em;
border-radius: 4px;
border: 0px;
`
const CInput2 = styled.input`
font-size: 16px;
background-color: #ffffff;
width: 10em;
height: 1.7em;
border-radius: 4px;
border: 0px;
margin: 10px 0px 0px 10px;
`
const CTextarea = styled.textarea`
height: 180px;
width: 220px;
border-radius: 5px;
resize: none;
`
export {Container, BoxSite, BotaoMonk, BotaoMonk2, CInput, CInput2, CTextarea}
```
### index.js
```javascript=
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import Routes from './pages/monkchat'
ReactDOM.render(
<React.StrictMode>
<Routes />
</React.StrictMode>,
document.getElementById('root')
);
```
### routes.js
```javascript=
import MonkChat from './pages/monkchat'
import { BrowserRouter, Switch, Route } from 'react-router-dom'
export default function Routes() {
return (
<BrowserRouter>
<Switch>
<Route path="/" exact={true} component={MonkChat}></Route>
</Switch>
</BrowserRouter>
)
}
```
{"metaMigratedAt":"2023-06-16T06:23:43.217Z","metaMigratedFrom":"Content","title":"Session: MonkChat - React js","breaks":true,"contributors":"[{\"id\":\"f2f98191-1ff5-4afd-8e66-66ff77c4c5b1\",\"add\":11812,\"del\":14}]"}