mirror of https://github.com/buster-so/buster.git
Update avatar url stuff
This commit is contained in:
parent
7e132ad76b
commit
3b5995f4e8
|
@ -42,15 +42,13 @@ const mockSearchTextData: SearchTextData = {
|
||||||
reports: [],
|
reports: [],
|
||||||
collections: [],
|
collections: [],
|
||||||
},
|
},
|
||||||
createdBy: {
|
|
||||||
id: 'abc123',
|
createdBy: '123e4567-e89b-12d3-a456-426614174000',
|
||||||
name: 'John Doe',
|
createdByName: 'John Doe',
|
||||||
email: 'john.doe@example.com',
|
createdByAvatarUrl: faker.image.url({
|
||||||
avatarUrl: faker.image.url({
|
width: 200,
|
||||||
width: 200,
|
height: 200,
|
||||||
height: 200,
|
}),
|
||||||
}),
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Default: Story = {
|
export const Default: Story = {
|
||||||
|
|
|
@ -24,8 +24,17 @@ export type GlobalSearchSecondaryContentProps = {
|
||||||
export const GlobalSearchSecondaryContent: React.FC<GlobalSearchSecondaryContentProps> = ({
|
export const GlobalSearchSecondaryContent: React.FC<GlobalSearchSecondaryContentProps> = ({
|
||||||
selectedItem,
|
selectedItem,
|
||||||
}) => {
|
}) => {
|
||||||
const { assetId, assetType, title, ancestors, updatedAt, screenshotUrl, createdBy } =
|
const {
|
||||||
selectedItem;
|
assetId,
|
||||||
|
assetType,
|
||||||
|
title,
|
||||||
|
ancestors,
|
||||||
|
updatedAt,
|
||||||
|
screenshotUrl,
|
||||||
|
createdBy,
|
||||||
|
createdByAvatarUrl,
|
||||||
|
createdByName,
|
||||||
|
} = selectedItem;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="px-3 pt-3 pb-3 min-w-[420px] min-h-[420px] flex flex-col gap-y-3 flex-1 h-full">
|
<div className="px-3 pt-3 pb-3 min-w-[420px] min-h-[420px] flex flex-col gap-y-3 flex-1 h-full">
|
||||||
|
@ -35,7 +44,12 @@ export const GlobalSearchSecondaryContent: React.FC<GlobalSearchSecondaryContent
|
||||||
<ScreenshotImage screenshotUrl={screenshotUrl} assetType={assetType} />
|
<ScreenshotImage screenshotUrl={screenshotUrl} assetType={assetType} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<MetaContent updatedAt={updatedAt} createdBy={createdBy} />
|
<MetaContent
|
||||||
|
updatedAt={updatedAt}
|
||||||
|
createdBy={createdBy}
|
||||||
|
createdByAvatarUrl={createdByAvatarUrl}
|
||||||
|
createdByName={createdByName}
|
||||||
|
/>
|
||||||
|
|
||||||
<hr className="border-t" />
|
<hr className="border-t" />
|
||||||
|
|
||||||
|
@ -174,7 +188,12 @@ const MetricScreenshotContainer = ({
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const MetaContent = ({ updatedAt, createdBy }: Pick<SearchTextData, 'updatedAt' | 'createdBy'>) => {
|
const MetaContent = ({
|
||||||
|
updatedAt,
|
||||||
|
createdBy,
|
||||||
|
createdByAvatarUrl,
|
||||||
|
createdByName,
|
||||||
|
}: Pick<SearchTextData, 'updatedAt' | 'createdBy' | 'createdByAvatarUrl' | 'createdByName'>) => {
|
||||||
const PillContainer = ({ children }: { children: React.ReactNode }) => {
|
const PillContainer = ({ children }: { children: React.ReactNode }) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -193,13 +212,13 @@ const MetaContent = ({ updatedAt, createdBy }: Pick<SearchTextData, 'updatedAt'
|
||||||
{createdBy && (
|
{createdBy && (
|
||||||
<PillContainer>
|
<PillContainer>
|
||||||
<img
|
<img
|
||||||
src={createdBy.avatarUrl ?? ''}
|
src={createdByAvatarUrl ?? ''}
|
||||||
alt="Avatar"
|
alt="Avatar"
|
||||||
className="w-3 h-3 rounded-full border object-contain bg-gray-light/50"
|
className="w-3 h-3 rounded-full border object-contain bg-gray-light/50"
|
||||||
style={{ objectFit: 'contain' }}
|
style={{ objectFit: 'contain' }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{createdBy?.name}
|
{createdByName}
|
||||||
</PillContainer>
|
</PillContainer>
|
||||||
)}
|
)}
|
||||||
<PillContainer>
|
<PillContainer>
|
||||||
|
|
Loading…
Reference in New Issue