Skip to content

Commit

Permalink
update type
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Oct 22, 2024
1 parent fccc98b commit 8175add
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,25 @@ import {
import { SPACING } from '../../../ui-style-constants'

interface ListItemDescriptorProps {
type: 'default' | 'mini'
paddingType: 'default' | 'large'
type: 'default' | 'large'
description: JSX.Element | string
content: JSX.Element | string
}

export const ListItemDescriptor = (
props: ListItemDescriptorProps
): JSX.Element => {
const { description, content, type, paddingType } = props
const { description, content, type } = props
return (
<Flex
flexDirection={DIRECTION_ROW}
gridGap={SPACING.spacing8}
width="100%"
alignItems={ALIGN_FLEX_START}
justifyContent={type === 'mini' ? JUSTIFY_SPACE_BETWEEN : 'none'}
padding={paddingType === 'default' ? SPACING.spacing4 : SPACING.spacing12}
justifyContent={type === 'default' ? JUSTIFY_SPACE_BETWEEN : 'none'}
padding={type === 'default' ? SPACING.spacing4 : SPACING.spacing12}
>
<Flex
// flex={type === 'default' && '1'}
// width={type === 'mini' ? FLEX_AUTO : '40%'}
// width="13.75rem"
minWidth="13.75rem"
>
{description}
</Flex>
<Flex minWidth="13.75rem">{description}</Flex>
<Flex width="100%">{content}</Flex>
</Flex>
)
Expand Down
9 changes: 3 additions & 6 deletions protocol-designer/src/organisms/MaterialsListModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ export function MaterialsListModal({
? fixtures.map(fixture => (
<ListItem type="noActive" key={fixture.id}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={
fixture.location != null ? (
<DeckInfoLabel
Expand Down Expand Up @@ -129,8 +128,7 @@ export function MaterialsListModal({
return (
<ListItem type="noActive" key={`hardware${id}`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={
<DeckInfoLabel deckLabel={formatLocation(hw.slot)} />
}
Expand Down Expand Up @@ -189,8 +187,7 @@ export function MaterialsListModal({
return (
<ListItem type="noActive" key={`labware_${lw.id}`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={
<DeckInfoLabel deckLabel={deckLabelSlot} />
}
Expand Down
6 changes: 2 additions & 4 deletions protocol-designer/src/organisms/SlotInformation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export const SlotInformation: React.FC<SlotInformationProps> = ({
{liquids.length > 1 ? (
<ListItem type="noActive">
<ListItemDescriptor
paddingType="default"
type="mini"
type="default"
content={liquids.join(', ')}
description={t('liquid')}
/>
Expand Down Expand Up @@ -114,8 +113,7 @@ function StackInfo({ title, stackInformation }: StackInfoProps): JSX.Element {
return (
<ListItem type="noActive">
<ListItemDescriptor
paddingType="default"
type="mini"
type="default"
content={
stackInformation != null ? (
<StyledText
Expand Down
12 changes: 4 additions & 8 deletions protocol-designer/src/pages/ProtocolOverview/InstrumentsInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ export function InstrumentsInfo({
<Flex flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing4}>
<ListItem type="noActive" key={`ProtocolOverview_robotType`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={t('robotType')}
content={
robotType === FLEX_ROBOT_TYPE
Expand All @@ -104,25 +103,22 @@ export function InstrumentsInfo({
</ListItem>
<ListItem type="noActive" key={`ProtocolOverview_left`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={t('left_pip')}
content={pipetteInfo(leftPipette)}
/>
</ListItem>
<ListItem type="noActive" key={`ProtocolOverview_right`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={t('right_pip')}
content={pipetteInfo(rightPipette)}
/>
</ListItem>
{robotType === FLEX_ROBOT_TYPE ? (
<ListItem type="noActive" key={`ProtocolOverview_gripper`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={t('extension')}
content={isGripperAttached ? t('gripper') : t('na')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export function LiquidDefinitions({
key={`${liquid.name}_${liquid.displayColor}_${index}`}
>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={
<Flex alignItems={ALIGN_CENTER} gridGap={SPACING.spacing8}>
<LiquidIcon color={liquid.displayColor} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export function ProtocolMetadata({
return (
<ListItem type="noActive" key={`ProtocolOverview_${title}`}>
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={t(`${title}`)}
content={value ?? t('na')}
/>
Expand All @@ -71,8 +70,7 @@ export function ProtocolMetadata({
})}
<ListItem type="noActive" key="ProtocolOverview_robotVersion">
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={t('required_app_version')}
content={t('app_version', {
version: REQUIRED_APP_VERSION,
Expand Down
3 changes: 1 addition & 2 deletions protocol-designer/src/pages/ProtocolOverview/StepsInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export function StepsInfo({ savedStepForms }: StepsInfoProps): JSX.Element {
) : (
<ListItem type="noActive" key="ProtocolOverview_Step">
<ListItemDescriptor
paddingType="large"
type="default"
type="large"
description={
<StyledText
desktopStyle="bodyDefaultRegular"
Expand Down

0 comments on commit 8175add

Please sign in to comment.