Skip to content

Commit

Permalink
Add a fancy new Umbrel Home device icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankchhabra authored and lukechilds committed Nov 25, 2024
1 parent cd8b94f commit 1dcfec6
Show file tree
Hide file tree
Showing 4 changed files with 831 additions and 3 deletions.
19 changes: 19 additions & 0 deletions packages/ui/public/figma-exports/umbrel-home-certifications.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {cn} from '@/shadcn-lib/utils'
import {maybeT, t} from '@/utils/i18n'
import {tw} from '@/utils/tw'

import AnimatedUmbrelHomeIcon from './device-info-umbrel-home'

export function DeviceInfoContent({
umbrelHostEnvironment,
device,
Expand All @@ -21,12 +23,16 @@ export function DeviceInfoContent({
return (
<div className='space-y-6'>
<div className='flex justify-center py-2'>
<HostEnvironmentIcon environment={umbrelHostEnvironment} />
<HostEnvironmentIcon
environment={umbrelHostEnvironment}
modelNumber={modelNumber}
serialNumber={serialNumber}
/>
</div>
<div className={listClass}>
<div className={listItemClassNarrow}>
<span>{t('device-info.device')}</span>
<span className='pr-6 font-normal'>{maybeT(device)}</span>
<span className={cn('font-normal', (modelNumber || serialNumber) && 'pr-6')}>{maybeT(device)}</span>
</div>
{modelNumber && (
<div className={listItemClassNarrow}>
Expand All @@ -52,14 +58,26 @@ const listClass = tw`divide-y divide-white/6 overflow-hidden rounded-12 bg-white
const listItemClass = tw`flex items-center gap-3 px-3 h-[50px] text-15 font-medium -tracking-3 justify-between`
const listItemClassNarrow = cn(listItemClass, tw`h-[42px]`)

export const HostEnvironmentIcon = ({environment}: {environment?: UmbrelHostEnvironment}) => {
export const HostEnvironmentIcon = ({
environment,
modelNumber,
serialNumber,
}: {
environment?: UmbrelHostEnvironment
modelNumber?: string
serialNumber?: string
}) => {
const iconDimensions = {
'umbrel-home': 128,
'raspberry-pi': 64,
'docker-container': 72,
unknown: 128,
}

if (environment === 'umbrel-home') {
return <AnimatedUmbrelHomeIcon modelNumber={modelNumber} serialNumber={serialNumber} />
}

const icon =
environment && hostEnvironmentMap[environment]?.icon ? (
<FadeInImg
Expand Down
Loading

0 comments on commit 1dcfec6

Please sign in to comment.