35 | {children} 36 |
37 | ); 38 | }; 39 | 40 | export default AnimatedShinyText; 41 | -------------------------------------------------------------------------------- /src/hooks/useOnlineUsers.ts: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from 'react'; 2 | import { query, ref, orderByChild, onValue, limitToLast } from 'firebase/database'; 3 | import { rtdb } from '../lib/firebase'; 4 | 5 | import { UserStatus } from '../types'; 6 | import { reverse } from 'lodash'; 7 | 8 | interface UseOnlineUsersOptions { 9 | limit?: number; 10 | } 11 | 12 | const useOnlineUsers = ({ limit = 25 }: UseOnlineUsersOptions = {}) => { 13 | const [users, setUsers] = useState{typingUsers.map(u => u.name).join(', ')} is typing...
21 |35 | Last Seen: 36 | {user.isOnline ? 'Online' : formatDistanceToNow(user.updatedAt, { addSuffix: true })} 37 |
38 |Loading
*/} 45 |Loading
46 |30 | {/* Mobile view */} 31 | 32 | {showUsers ? ( 33 | 34 | ) : ( 35 | <> 36 | {onlineCount} 37 | > 38 | )} 39 | 40 | 41 | {/* Desktop view */} 42 | 43 | {onlineCount} 44 | 45 |
46 | ); 47 | }; 48 | 49 | const ChatHeader: React.FC
32 |
Loading Messages...
29 |88 | Experience a simple, seamless way to chat. Just enter your name and join the global community. No signup, no hassle. 89 |
90 | 91 |
111 | {/* @ts-ignore */}
112 |
116 |
121 | {format(timestamp?.toDate(), 'hh:mm a')} 122 |
123 | )} 124 |