-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prepare NMRium structure for printing
- Loading branch information
1 parent
d43911d
commit ae9d1f7
Showing
5 changed files
with
130 additions
and
56 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { CSSProperties, RefObject } from 'react'; | ||
|
||
import Viewer1D from '../1d/Viewer1D'; | ||
import FloatMoleculeStructures from '../1d-2d/components/FloatMoleculeStructures'; | ||
import Viewer2D from '../2d/Viewer2D'; | ||
import { useChartData } from '../context/ChartContext'; | ||
|
||
import { NMRiumProps } from './NMRium'; | ||
|
||
interface NMRiumViewerProps { | ||
emptyText: NMRiumProps['emptyText']; | ||
viewerRef: RefObject<HTMLDivElement>; | ||
style?: CSSProperties; | ||
} | ||
|
||
export function NMRiumViewer(props: NMRiumViewerProps) { | ||
const { emptyText, viewerRef, style = {} } = props; | ||
const { displayerMode } = useChartData(); | ||
|
||
return ( | ||
<div | ||
id="nmrium-viewer" | ||
data-testid="viewer" | ||
ref={viewerRef} | ||
style={{ | ||
width: '100%', | ||
height: '100%', | ||
position: 'relative', | ||
...style, | ||
}} | ||
> | ||
<FloatMoleculeStructures /> | ||
{displayerMode === '1D' ? ( | ||
<Viewer1D emptyText={emptyText} /> | ||
) : ( | ||
<Viewer2D emptyText={emptyText} /> | ||
)} | ||
</div> | ||
); | ||
} |
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
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
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