Created
June 26, 2021 04:05
-
-
Save MoranggNormal/a121ebab875134ef1e465c623dfbb9e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="page-room"> | |
<header> | |
<div className="content"> | |
<img src={logoImg} alt="Letmeask" /> | |
<RoomCode code={roomId} /> | |
</div> | |
</header> | |
<main> | |
<div className="room-title"> | |
<h1>Sala: {title}</h1> | |
{questions.length > 0 && <span>{questions.length} perguntas</span>} | |
</div> | |
<form onSubmit={handleSendQuestion}> | |
<textarea | |
placeholder="O que você quer perguntar?" | |
onChange={e => setNewQuestion(e.target.value)} | |
value={newQuestion} | |
/> | |
<div className="form-footer"> | |
{user ? ( | |
<div className="user-info"> | |
<img src={user.avatar} alt="user.name" /> | |
<span>{user.name}</span> | |
</div> | |
) : ( | |
<span>Para enviar uma pergunta, <button>faça seu login.</button></span> | |
)} | |
<Button type="submit" disabled={!user}>Enviar pergunta</Button> | |
</div> | |
</form> | |
<div className="question-list"> | |
{questions.map(question => { | |
return ( | |
<Question | |
key={question.id} | |
content={question.content} | |
author={question.author} | |
/> | |
) | |
})} | |
</div> | |
</main> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment