-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#437 Add possibility to save structure as PNG
- Loading branch information
1 parent
97c408a
commit c53b4cf
Showing
4 changed files
with
173 additions
and
88 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
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 |
---|---|---|
|
@@ -56,9 +56,4 @@ | |
cursor: text; | ||
resize: both; | ||
} | ||
|
||
footer { | ||
display: flex; | ||
justify-content: space-around; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/ketcher-react/src/script/ui/views/modal/components/document/Save/SaveImageTab.jsx
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,34 @@ | ||
import React from 'react' | ||
|
||
const SaveImageTab = ({ dimensions, changeImageFormat }) => { | ||
const formats = [ | ||
{ extension: 'svg', text: 'SVG Document' }, | ||
{ extension: 'png', text: 'PNG Image' } | ||
] | ||
|
||
const renderOptions = formats => { | ||
return formats.map(format => { | ||
const { extension, text } = format | ||
return ( | ||
<option key={extension} value={extension}> | ||
{text} | ||
</option> | ||
) | ||
}) | ||
} | ||
|
||
const handleChange = ({ target }) => { | ||
changeImageFormat(target.value) | ||
} | ||
|
||
return ( | ||
<div style={dimensions}> | ||
<label> | ||
Image Format: | ||
<select onChange={handleChange}>{renderOptions(formats)}</select> | ||
</label> | ||
</div> | ||
) | ||
} | ||
|
||
export default SaveImageTab |