Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-06-03 23:54:22 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3382b045c582b8b9e6f39edce7fe7898c8ba8f0f
3382b045
1 parent
a4cecd5e
add moment.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
front/src/Components/Message.js
front/src/Components/Message.js
View file @
3382b04
import
React
from
"react"
;
import
styled
from
"styled-components"
;
import
ProfileIcon
from
"./ProfileIcon"
;
import
moment
from
"moment"
;
const
MessageWrapper
=
styled
.
div
`
display: flex;
...
...
@@ -45,7 +46,8 @@ const Time = styled.span`
font-size: 15px;
`
;
export
default
({
text
,
avatar
})
=>
{
export
default
({
text
,
avatar
,
time
})
=>
{
let
UTCTime
=
moment
.
utc
(
time
).
format
(
"HH:mm"
);
return
(
<
MessageWrapper
className
=
"MessageWrapper"
>
<
MsgContainer
>
...
...
@@ -55,7 +57,7 @@ export default ({ text, avatar }) => {
<
Msg
>
{
text
}
<
/Msg
>
<
/MsgBox
>
<
TimeBox
>
<
Time
>
1
<
/Time
>
<
Time
>
{
UTCTime
}
<
/Time
>
<
/TimeBox
>
<
/ColumnBox
>
<
/MsgContainer
>
...
...
Please
register
or
login
to post a comment