Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {t} from 'sentry/locale';
import {formatBytesBase10} from 'sentry/utils/bytes/formatBytesBase10';
import {getFormattedDate} from 'sentry/utils/dates';
import {unreachable} from 'sentry/utils/unreachable';
import useOrganization from 'sentry/utils/useOrganization';
import {openInstallModal} from 'sentry/views/preprod/components/installModal';
import {
BuildDetailsSizeAnalysisState,
Expand Down Expand Up @@ -70,14 +71,21 @@ interface BuildDetailsSidebarAppInfoProps {
}

export function BuildDetailsSidebarAppInfo(props: BuildDetailsSidebarAppInfoProps) {
const organization = useOrganization();
const labels = getLabels(props.appInfo.platform ?? undefined);

let iconUrl = null;
if (props.appInfo.app_icon_id) {
iconUrl = `/api/0/projects/${organization.slug}/${props.projectId}/files/app-icons/${props.appInfo.app_icon_id}/`;
}

return (
<Flex direction="column" gap="xl">
<Flex align="center" gap="sm">
<AppIcon>
{iconUrl && <img src={iconUrl} alt="App Icon" width={24} height={24} />}
{!iconUrl && (
<AppIconPlaceholder>{props.appInfo.name?.charAt(0) || ''}</AppIconPlaceholder>
</AppIcon>
)}
{props.appInfo.name && <Heading as="h3">{props.appInfo.name}</Heading>}
</Flex>

Expand Down Expand Up @@ -187,19 +195,16 @@ export function BuildDetailsSidebarAppInfo(props: BuildDetailsSidebarAppInfoProp
);
}

const AppIcon = styled('div')`
const AppIconPlaceholder = styled('div')`
width: 24px;
height: 24px;
border-radius: 4px;
background: #ff6600;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
`;

const AppIconPlaceholder = styled('div')`
color: white;
background: ${p => p.theme.purple400};
color: ${p => p.theme.white};
font-weight: ${p => p.theme.fontWeight.bold};
font-size: ${p => p.theme.fontSize.sm};
`;
Expand Down
1 change: 1 addition & 0 deletions static/app/views/preprod/types/buildDetailsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface BuildDetailsApiResponse {
}

export interface BuildDetailsAppInfo {
app_icon_id?: string | null;
app_id?: string | null;
artifact_type?: BuildDetailsArtifactType | null;
build_configuration?: string | null;
Expand Down
Loading