From f470636a70943a8ecad8bddc791a1c2dddd28e1e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 4 May 2019 21:13:12 +0300 Subject: Components -> UI --- vnext/src/ui/Contacts.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 vnext/src/ui/Contacts.js (limited to 'vnext/src/ui/Contacts.js') diff --git a/vnext/src/ui/Contacts.js b/vnext/src/ui/Contacts.js new file mode 100644 index 00000000..3852b26f --- /dev/null +++ b/vnext/src/ui/Contacts.js @@ -0,0 +1,49 @@ +import React, { useEffect, useState } from 'react'; + +import { getChats } from '../api'; + + +import Contact from './Contact.js'; +import { ChatSpinner } from './Spinner'; + +export default function Contacts(props) { + const [pms, setPms] = useState([]); + useEffect(() => { + getChats() + .then(response => { + setPms(response.data.pms); + }); + }, []); + return ( +