Skip to content

Instantly share code, notes, and snippets.

@WDever
Created March 21, 2019 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WDever/5acf40b9c91e74af9c3a82944a79252f to your computer and use it in GitHub Desktop.
Save WDever/5acf40b9c91e74af9c3a82944a79252f to your computer and use it in GitHub Desktop.
class ChatBot extends React.Component<ChatBotProps, ChatBotState> {
public handleToggle = async (): Promise<void> => {
this.setState(() => ({
toggle: !this.state.toggle,
}));
this.ChatScroll = React.createRef();
await console.log(this.ChatScroll);
// await console.log(this.ChatScroll.scrollTop);
};
render (
return (
<ChatBotBody>
<ChatBotTopDiv>
<ChatBotImg src={ChatBotIcon} alt='' />
한봇
</ChatBotTopDiv>
<ChatBox ref={this.ChatScroll}>
{chatList}
{/* <ReceptionWrapper>
<ReceptionBox>
<ReceptionText>테스트</ReceptionText>
</ReceptionBox>
</ReceptionWrapper>
<SendWrapper>
<SendBox>
<SendText>시퍼어저 하늘로우리들ㅇ느 ㅂ려</SendText>
</SendBox>
</SendWrapper>
<SendWrapper>
<SendBox>
<SendText>ㅁ러쟈ㅐ서ㅏㅣ넘랮;ㅓㄴ아ㅣㄹ머ㅐㅑ;러재;</SendText>
</SendBox>
</SendWrapper>
<ReceptionWrapper>
<ReceptionBox>
<ReceptionText>테스트</ReceptionText>
</ReceptionBox>
</ReceptionWrapper>
<ReceptionWrapper>
<ReceptionBox>
<ReceptionText>테스트</ReceptionText>
</ReceptionBox>
</ReceptionWrapper>
<SendWrapper>
<SendBox>
<SendText>ㅁ러쟈ㅐ서ㅏㅣ넘랮;ㅓㄴ아ㅣㄹ머ㅐㅑ;러재;</SendText>
</SendBox>
</SendWrapper>
<ReceptionWrapper>
<ReceptionBox>
<ReceptionText>테스트</ReceptionText>
</ReceptionBox>
</ReceptionWrapper>
<ReceptionWrapper>
<ReceptionBox>
<ReceptionText>테스트</ReceptionText>
</ReceptionBox>
</ReceptionWrapper> */}
</ChatBox>
<ChatForm onSubmit={handleEnter}>
<ChatInput
placeholder='한봇과 안부인사를 해봐요!'
onChange={handleChange}
value={input}
/>
</ChatForm>
</ChatBotBody>
<Bubble src={bubble} alt='' onClick={handleToggle} />
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment