/* * Wire * Copyright (C) 2019 Wire Swiss GmbH * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * */ import {useEffect, CSSProperties} from 'react'; import {amplify} from 'amplify'; import {ErrorBoundary} from 'react-error-boundary'; import {WebAppEvents} from '@wireapp/webapp-events'; import {Avatar, AVATAR_SIZE} from 'Components/Avatar'; import {UserBlockedBadge, UserVerificationBadges} from 'Components/Badge'; import {UserClassifiedBar} from 'Components/ClassifiedBar/ClassifiedBar'; import {ErrorFallback} from 'Components/ErrorFallback'; import * as Icon from 'Components/Icon'; import {UserInfo} from 'Components/UserInfo'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {User} from '../../entity/User'; interface UserDetailsProps { badge?: string; groupId?: string; classifiedDomains?: string[]; isGroupAdmin?: boolean; isVerified?: boolean; participant: User; avatarStyles?: CSSProperties; } const UserDetailsComponent = ({ badge, participant, groupId, isGroupAdmin, avatarStyles, classifiedDomains, }: UserDetailsProps) => { const user = useKoSubscribableChildren(participant, [ 'isDirectGuest', 'isTemporaryGuest', 'expirationText', 'isAvailable', 'isBlocked', ]); useEffect(() => { // This will trigger a user refresh amplify.publish(WebAppEvents.USER.UPDATE, participant.qualifiedId); }, [participant]); return (
{participant.handle}
)} {classifiedDomains &&