Skip to content

Commit

Permalink
Step 2.4: Use Material components
Browse files Browse the repository at this point in the history
  • Loading branch information
Urigo committed May 20, 2020
1 parent b78def5 commit 239a7e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/components/ChatsListScreen/ChatsList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import { chats } from '../../db';
import moment from 'moment';
import { List, ListItem } from '@material-ui/core';

const ChatsList: React.FC = () => (
<div>
<ul>
<List>
{chats.map((chat) => (
<li key={chat.id}>
<ListItem key={chat.id} button>
<img src={chat.picture} alt="Profile" />
<div>{chat.name}</div>
{chat.lastMessage && (
Expand All @@ -15,9 +16,9 @@ const ChatsList: React.FC = () => (
<div>{moment(chat.lastMessage.createdAt).format('HH:mm')}</div>
</React.Fragment>
)}
</li>
</ListItem>
))}
</ul>
</List>
</div>
);

Expand Down
3 changes: 2 additions & 1 deletion src/components/ChatsListScreen/ChatsNavbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Toolbar } from '@material-ui/core';

const ChatsNavbar: React.FC = () => <div>Whatsapp Clone</div>;
const ChatsNavbar: React.FC = () => <Toolbar>Whatsapp Clone</Toolbar>;

export default ChatsNavbar;

0 comments on commit 239a7e1

Please sign in to comment.