15 | {timeString} 16 | {props.message.from}: {props.incoming ? props.message.body : {props.message.body}} 17 |
18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /signal-protocol-client/src/messages/ui/message-list.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { ProcessedChatMessage } from '../types' 3 | 4 | import MessageView from './message-view' 5 | 6 | export interface MessageListProps { 7 | messages: ProcessedChatMessage[] 8 | remoteUserName: string 9 | } 10 | 11 | export default function MessageList(props: MessageListProps): JSX.Element { 12 | return ( 13 |
19 | {children}
20 |
21 | )
22 | }
23 | }
24 |
25 | export default CodeBlock
--------------------------------------------------------------------------------
/signal-protocol-client/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | import './index.css'
4 | import App from './App'
5 | import reportWebVitals from './reportWebVitals'
6 | import TimeAgo from 'javascript-time-ago'
7 |
8 | import en from 'javascript-time-ago/locale/en.json'
9 |
10 | console.log('add locale', { en })
11 | TimeAgo.addLocale(en)
12 | TimeAgo.addDefaultLocale(en)
13 |
14 | ReactDOM.render(
15 | 16 | A demonstration of the Signal Protocol Typescript SDK. 17 | Source code available here. 18 | 19 |
20 |Look up a user by username and start and end-to-end-encrypted chat
18 | { 22 | setRemoteUsername(event.target.value) 23 | }} 24 | > 25 | 28 |