UNPKG

profile-pics

Version:

17 lines 901 B
import React from 'react'; import style from './ProfilePictureView.module.scss'; import { linkedComponent } from '../package.js'; import { ProfilePicture } from '../shapes/ProfilePicture.js'; import { cl } from 'lincd/utils/ClassNames'; import { getResizedImagePath } from 'lincd-server-utils/utils/ImageResize'; import { replaceLocalhostWithSiteRoot } from '../utils/helper.js'; const query = ProfilePicture.query((p) => { return p.cropped.contentUrl; }); export const ProfilePictureView = linkedComponent(query, ({ cropped: { contentUrl }, className, width = 190 }) => { let imageSrc = getResizedImagePath(replaceLocalhostWithSiteRoot(contentUrl), width); return (React.createElement("img", { className: cl(style.ProfilePictureView, className), src: imageSrc })); }); //register all components in this file // registerPackageModule(module); //# sourceMappingURL=ProfilePictureView.js.map