Skip to content

Commit 475903b

Browse files
committed
Wireup app icon frontend
1 parent ce29114 commit 475903b

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

static/app/views/preprod/buildDetails/sidebar/buildDetailsSidebarAppInfo.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {t} from 'sentry/locale';
1010
import {formatBytesBase10} from 'sentry/utils/bytes/formatBytesBase10';
1111
import {getFormat, getFormattedDate, getUtcToSystem} from 'sentry/utils/dates';
1212
import {unreachable} from 'sentry/utils/unreachable';
13+
import useOrganization from 'sentry/utils/useOrganization';
1314
import {openInstallModal} from 'sentry/views/preprod/components/installModal';
1415
import {
1516
BuildDetailsSizeAnalysisState,
@@ -70,19 +71,26 @@ interface BuildDetailsSidebarAppInfoProps {
7071
}
7172

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

7577
const datetimeFormat = getFormat({
7678
seconds: true,
7779
timeZone: true,
7880
});
7981

82+
let iconUrl = null;
83+
if (props.appInfo.app_icon_id) {
84+
iconUrl = `/api/0/projects/${organization.slug}/${props.projectId}/files/app-icons/${props.appInfo.app_icon_id}/`;
85+
}
86+
8087
return (
8188
<Flex direction="column" gap="xl">
8289
<Flex align="center" gap="sm">
83-
<AppIcon>
90+
{iconUrl && <img src={iconUrl} alt="App Icon" width={24} height={24} />}
91+
{!iconUrl && (
8492
<AppIconPlaceholder>{props.appInfo.name?.charAt(0) || ''}</AppIconPlaceholder>
85-
</AppIcon>
93+
)}
8694
{props.appInfo.name && <Heading as="h3">{props.appInfo.name}</Heading>}
8795
</Flex>
8896

@@ -196,19 +204,16 @@ export function BuildDetailsSidebarAppInfo(props: BuildDetailsSidebarAppInfoProp
196204
);
197205
}
198206

199-
const AppIcon = styled('div')`
207+
const AppIconPlaceholder = styled('div')`
200208
width: 24px;
201209
height: 24px;
202210
border-radius: 4px;
203-
background: #ff6600;
204211
display: flex;
205212
align-items: center;
206213
justify-content: center;
207214
flex-shrink: 0;
208-
`;
209-
210-
const AppIconPlaceholder = styled('div')`
211-
color: white;
215+
background: ${p => p.theme.purple400};
216+
color: ${p => p.theme.white};
212217
font-weight: ${p => p.theme.fontWeight.bold};
213218
font-size: ${p => p.theme.fontSize.sm};
214219
`;

static/app/views/preprod/types/buildDetailsTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface BuildDetailsApiResponse {
99
}
1010

1111
export interface BuildDetailsAppInfo {
12+
app_icon_id?: string | null;
1213
app_id?: string | null;
1314
apple_app_info?: AppleAppInfo | null;
1415
artifact_type?: BuildDetailsArtifactType | null;

0 commit comments

Comments
 (0)