The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/app/ui/client/lib/UserCard.js

39 lines
782 B

[NEW] User profile and User card (#18194) * Handle Avatar on Error * User Status Component * User Card Component * More variations * More Variations * Loading State * useTimezoneTime Hook * UTCClock Component * Fix BaseAvatar * getStatus Helper * Rewrite User info to reuse + Stories * Changes to open on Channels * ??? * Fix reactAdapters * Translation Provider * Fix lint * Improve loading state * WIP * UserCard and UserInfo Actions * Lint * Review * wip * Fix user info * Update fuselage * Update fuselage 0.13.0 * sad * sad[2] * fix camelCase paths * Fix Ghost menu * Fix some weird behaviors * Fix missing user ID on actions * Fix visual * Fix VerticalBar * Opss missing email field * Missing some fields * Update Fuselage * Update app/theme/client/imports/components/contextual-bar.css Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> * Remove Old userInfo template * UserCard Api * Update client/admin/customEmoji/CustomEmojiRoute.js Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> * Remove unused variables * Fix contextual-bar CSS selectors * Destructure additional props in UserInfoWithData * Remove obsolete props from VerticalBar * Remove commented code * Place useSetModal hook * Apply suggestions from code review Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> * Fiz markdown * Update client/components/basic/UserCard.js Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> * Update client/components/basic/avatar/UserAvatar.js Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> * rename base avatar Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> Co-authored-by: Gabriel Henriques <gabriel.henriques@rocket.chat>
5 years ago
import { Tracker } from 'meteor/tracker';
import { createEphemeralPortal } from '../../../../client/reactAdapters';
const Dep = new Tracker.Dependency();
let state;
let dom;
let unregister;
const createAchor = () => {
const div = document.createElement('div');
div.id = 'react-user-card';
document.body.appendChild(div);
return div;
};
export const closeUserCard = () => {
if (!dom) {
return;
}
unregister();
unregister = undefined;
};
const props = () => {
Dep.depend();
return state;
};
export const openUserCard = async ({ ...args }) => {
dom = dom || createAchor();
state = {
onClose: closeUserCard,
...args,
};
Dep.changed();
unregister = unregister || await createEphemeralPortal(() => import('../../../../client/channel/UserCard'), props, dom);
};