Skip to content

Commit

Permalink
#4380 - Bugfix (MonomerWithIDTAliasesPreview): Recover className
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriiP-EPAM committed May 14, 2024
1 parent 991d22c commit a3e15d1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import { useMemo } from 'react';
import { selectShowPreview } from 'state/common';
import { preview as previewConstants } from '../../../constants';
import { Container, MonomerName, StyledStructRender } from './styles';
import { MonomerWithIDTAliasesPreviewProps } from './types';

const MonomerWithIDTAliasesPreview = () => {
const MonomerWithIDTAliasesPreview = ({
className,
}: MonomerWithIDTAliasesPreviewProps) => {
const preview = useAppSelector(selectShowPreview);
const ContainerDynamic = useMemo(
() => styled(Container)`
Expand All @@ -39,7 +42,10 @@ const MonomerWithIDTAliasesPreview = () => {

return (
preview.monomer && (
<ContainerDynamic data-testid="polymer-library-preview">
<ContainerDynamic
className={className}
data-testid="polymer-library-preview"
>
<MonomerName>{preview.monomer.struct.name}</MonomerName>
<StyledStructRender struct={preview.monomer.struct} />
{idtAliases && <IDTAliases aliases={idtAliases}></IDTAliases>}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/****************************************************************************
* Copyright 2021 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/

export interface MonomerWithIDTAliasesPreviewProps {
readonly className: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Preview = () => {
]);
const monomerClass = preview?.monomer?.props.MonomerClass;
if (ketMonomerWithIDTAliasesClassSet.has(monomerClass)) {
return <MonomerWithIDTAliasesPreview />;
return <MonomerWithIDTAliasesPreview className="polymer-library-preview" />;
}

return <MonomerPreview className="polymer-library-preview" />;
Expand Down

0 comments on commit a3e15d1

Please sign in to comment.