Skip to content
Merged
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
23 changes: 18 additions & 5 deletions src/MasterMix/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { toggleElement } from '@mll-lab/js-utils';
import React, { useState } from 'react';
import styled from 'styled-components';

import { Card } from '../Card';
import { Table } from '../Table';
Expand All @@ -16,6 +17,14 @@ export {
PipettingLossByFactor,
} from './types';

const TOTAL_VOLUME_ROW_CLASS = 'total-volume-row';

const MasterMixTable = styled(Table)`
.${TOTAL_VOLUME_ROW_CLASS} {
background-color: lightgrey;
}
`;

/**
* The reactants can be clicked and marked as pipetted.
*/
Expand Down Expand Up @@ -43,13 +52,17 @@ export function MasterMix(props: MasterMixProps) {
<Typography.Title level={5}>{props.name} MasterMix</Typography.Title>
}
>
<Table
<MasterMixTable
style={{ maxWidth: 400 }}
rowClassName={(record) =>
highlightedEntries.includes(record.key.toString())
rowClassName={(record, index) => {
if (index === props.ingredients.length) {
return TOTAL_VOLUME_ROW_CLASS;
}

return highlightedEntries.includes(record.key.toString())
? 'mll-ant-table-row-selected'
: ''
}
: '';
}}
dataSource={ingredientsWithSumRow}
rowKey={(record) => record.key}
pagination={{ defaultPageSize: 10, hideOnSinglePage: true }}
Expand Down
Loading