-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f251878
commit 94d1dbb
Showing
6 changed files
with
407 additions
and
15 deletions.
There are no files selected for viewing
14 changes: 10 additions & 4 deletions
14
packages/connect-examples/expo-example/src/views/FirmwareScreen/DeviceField.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
import { memo } from 'react'; | ||
import { Stack, Text } from 'tamagui'; | ||
import { Text, XStack } from 'tamagui'; | ||
|
||
interface DeviceFieldProps { | ||
field: string; | ||
value: string | null | undefined; | ||
} | ||
function DeviceFieldView({ field, value }: DeviceFieldProps) { | ||
return ( | ||
<Stack | ||
<XStack | ||
width="100%" | ||
flexWrap="wrap" | ||
gap="$2" | ||
$gtSm={{ | ||
width: '48%', | ||
}} | ||
$gtLg={{ | ||
width: '30%', | ||
}} | ||
> | ||
<Text color={value == null ? '$textCritical' : '$text'}>{`${field}: ${value ?? ''}`}</Text> | ||
</Stack> | ||
<Text | ||
color={value == null ? '$textCritical' : '$text'} | ||
fontWeight="bold" | ||
>{`${field}: `}</Text> | ||
<Text color={value == null ? '$textCritical' : '$text'}>{`${value ?? ''}`}</Text> | ||
</XStack> | ||
); | ||
} | ||
export const DeviceField = memo(DeviceFieldView); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.