fastcomments-react-native-sdk
Version:
React Native FastComments Components. Add live commenting to any React Native application.
15 lines (14 loc) • 623 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { View } from "react-native";
export function CommentUserActivityIcon({ disableLiveCommenting, userId, anonUserId, userPresenceState, styles }) {
if (disableLiveCommenting) {
return null;
}
const isUserOnline = (userId && userPresenceState.usersOnlineMap[userId].get()) || (anonUserId && userPresenceState.usersOnlineMap[anonUserId].get());
if (isUserOnline) {
return _jsx(View, { style: styles.commentUserActivityIcon?.online });
}
else {
return _jsx(View, { style: styles.commentUserActivityIcon?.offline });
}
}