Fix: Consistent avatars for show pages (#1776)

- consistent avatars for show pages
This commit is contained in:
brendanlaschke
2023-09-30 08:32:00 +02:00
committed by GitHub
parent c06712f161
commit e3485cc609
3 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import { Tooltip } from 'react-tooltip';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { v4 as uuidV4 } from 'uuid'; import { v4 as uuidV4 } from 'uuid';
import { Avatar } from '@/users/components/Avatar'; import { Avatar, AvatarType } from '@/users/components/Avatar';
import { import {
beautifyExactDateTime, beautifyExactDateTime,
beautifyPastDateRelativeToNow, beautifyPastDateRelativeToNow,
@ -18,6 +18,7 @@ type OwnProps = {
date: string; date: string;
renderTitleEditComponent?: () => JSX.Element; renderTitleEditComponent?: () => JSX.Element;
onUploadPicture?: (file: File) => void; onUploadPicture?: (file: File) => void;
avatarType: AvatarType;
}; };
const StyledShowPageSummaryCard = styled.div` const StyledShowPageSummaryCard = styled.div`
@ -77,6 +78,7 @@ export const ShowPageSummaryCard = ({
logoOrAvatar, logoOrAvatar,
title, title,
date, date,
avatarType,
renderTitleEditComponent, renderTitleEditComponent,
onUploadPicture, onUploadPicture,
}: OwnProps) => { }: OwnProps) => {
@ -102,7 +104,7 @@ export const ShowPageSummaryCard = ({
size="xl" size="xl"
colorId={id} colorId={id}
placeholder={title} placeholder={title}
type="rounded" type={avatarType}
/> />
<StyledFileInput <StyledFileInput
ref={inputFileRef} ref={inputFileRef}

View File

@ -90,6 +90,7 @@ export const CompanyShow = () => {
renderTitleEditComponent={() => ( renderTitleEditComponent={() => (
<CompanyNameEditableField company={company} /> <CompanyNameEditableField company={company} />
)} )}
avatarType="squared"
/> />
<PropertyBox extraPadding={true}> <PropertyBox extraPadding={true}>
{companyShowFieldDefinition.map((fieldDefinition) => { {companyShowFieldDefinition.map((fieldDefinition) => {

View File

@ -116,6 +116,7 @@ export const PersonShow = () => {
) )
} }
onUploadPicture={onUploadPicture} onUploadPicture={onUploadPicture}
avatarType="rounded"
/> />
<PropertyBox extraPadding={true}> <PropertyBox extraPadding={true}>
{personShowFieldDefinition.map((fieldDefinition) => { {personShowFieldDefinition.map((fieldDefinition) => {