Showing
1 changed file
with
27 additions
and
18 deletions
... | @@ -90,17 +90,32 @@ const ChatScreenBox = styled.div` | ... | @@ -90,17 +90,32 @@ const ChatScreenBox = styled.div` |
90 | flex-direction: column; | 90 | flex-direction: column; |
91 | width: 100%; | 91 | width: 100%; |
92 | height: 100%; | 92 | height: 100%; |
93 | + overflow-y: scroll; | ||
94 | + &::-webkit-scrollbar { | ||
95 | + width: 10px; | ||
96 | + } | ||
97 | + &::-webkit-scrollbar-track { | ||
98 | + background-color: transparent; | ||
99 | + } | ||
100 | + &::-webkit-scrollbar-thumb { | ||
101 | + border-radius: 3px; | ||
102 | + background-color: gray; | ||
103 | + } | ||
104 | + &::-webkit-scrollbar-button { | ||
105 | + width: 0; | ||
106 | + height: 0; | ||
107 | + } | ||
93 | `; | 108 | `; |
94 | 109 | ||
95 | const InputContainer = styled.div` | 110 | const InputContainer = styled.div` |
96 | position: fixed; | 111 | position: fixed; |
97 | bottom: 0; | 112 | bottom: 0; |
98 | - justify-self: center; | 113 | + justify-content: center; |
99 | - padding: 10px; | 114 | + align-items: center; |
100 | - margin-bottom: 20px; | 115 | + width: 70%; |
116 | + margin: 10px; | ||
101 | display: flex; | 117 | display: flex; |
102 | flex-direction: row; | 118 | flex-direction: row; |
103 | - width: 70%; | ||
104 | form { | 119 | form { |
105 | width: 100%; | 120 | width: 100%; |
106 | button { | 121 | button { |
... | @@ -132,20 +147,10 @@ const StyledLink = styled(Link)` | ... | @@ -132,20 +147,10 @@ const StyledLink = styled(Link)` |
132 | } | 147 | } |
133 | `; | 148 | `; |
134 | 149 | ||
135 | -export default ({ | 150 | +export default ({ location, message, onSubmit, messageArray }) => { |
136 | - location, | ||
137 | - message, | ||
138 | - onSubmit, | ||
139 | - messageText, | ||
140 | - messageTime, | ||
141 | - newMsgObj, | ||
142 | - messageArray, | ||
143 | -}) => { | ||
144 | const { pathname } = location; | 151 | const { pathname } = location; |
145 | const roomName = pathname.slice(1, pathname.length); | 152 | const roomName = pathname.slice(1, pathname.length); |
146 | 153 | ||
147 | - console.log(messageArray); | ||
148 | - | ||
149 | return ( | 154 | return ( |
150 | <Wrapper> | 155 | <Wrapper> |
151 | <Header text={"KhuChat"} /> | 156 | <Header text={"KhuChat"} /> |
... | @@ -169,10 +174,14 @@ export default ({ | ... | @@ -169,10 +174,14 @@ export default ({ |
169 | <ChatScreenBox> | 174 | <ChatScreenBox> |
170 | {messageArray && | 175 | {messageArray && |
171 | messageArray.seeAllMessage.map((e) => ( | 176 | messageArray.seeAllMessage.map((e) => ( |
172 | - <Message text={e.text} time={e.createdAt} key={e.id} /> | 177 | + <Message |
178 | + text={e.text} | ||
179 | + time={e.createdAt} | ||
180 | + key={e.id} | ||
181 | + avatar={e.sender.avatarUrl} | ||
182 | + /> | ||
173 | ))} | 183 | ))} |
174 | - {newMsgObj && <Message text={messageText} time={messageTime} />} | 184 | + <InputContainer className="InputContainer"> |
175 | - <InputContainer> | ||
176 | <form onSubmit={onSubmit}> | 185 | <form onSubmit={onSubmit}> |
177 | <Input | 186 | <Input |
178 | placeholder={"Enter any words"} | 187 | placeholder={"Enter any words"} | ... | ... |
-
Please register or login to post a comment