Skip to content

Commit

Permalink
fix(UI): reaction scheme - sample names style (#2193)
Browse files Browse the repository at this point in the history
remove name truncation (from 460542b) and move css class up to  parent div (div from 8ea0734)
  • Loading branch information
PiTrem authored Oct 2, 2024
1 parent 79dd20f commit dfb34c7
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,9 @@ class Material extends Component {
};

const idCheck = /^\d+$/;
const truncatedSampleName = material.molecule_iupac_name?.length > 20 && materialGroup === 'reactants'
? material.molecule_iupac_name?.substring(1, 25) : material.molecule_iupac_name;

if (skipIupacName) {
let materialDisplayName = truncatedSampleName || material.name;
let materialDisplayName = material.molecule_iupac_name || material.name;
if (materialGroup === 'solvents' || materialGroup === 'purification_solvents') {
materialDisplayName = material.external_label || materialDisplayName;
}
Expand All @@ -961,7 +959,7 @@ class Material extends Component {
tabIndex={0}
onClick={() => this.handleMaterialClick(material)}
style={{ cursor: 'pointer' }}
><span className="reaction-material-link">{materialDisplayName}</span></a>
><span>{materialDisplayName}</span></a>
);
} else {
materialName = <span>{materialDisplayName}</span>;
Expand All @@ -977,7 +975,7 @@ class Material extends Component {
tabIndex={0}
onClick={() => this.handleMaterialClick(material)}
style={{ cursor: 'pointer' }}
><span className="reaction-material-link">{materialDisplayName}</span></a>
><span>{materialDisplayName}</span></a>
);

if (material.isNew) { materialName = materialDisplayName; }
Expand Down Expand Up @@ -1006,7 +1004,7 @@ class Material extends Component {
</OverlayTrigger>
&nbsp;
<OverlayTrigger placement="bottom" overlay={iupacNameTooltip(material)}>
<div>
<div className={'reaction-material-link'}>
{materialName}
</div>
</OverlayTrigger>
Expand Down

0 comments on commit dfb34c7

Please sign in to comment.