Partial export processing
This commit is contained in:
@@ -20,16 +20,46 @@ const mapDispatchToProps = dispatch => {
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
||||
let msg = props.InfoMessage.message;
|
||||
const classes = ['InfoDetailsContent'];
|
||||
if (props.InfoMessage.message.startsWith('!alternate!')) {
|
||||
classes.push('Alternate');
|
||||
msg = props.InfoMessage.message.substr('!alternate!'.length)
|
||||
|
||||
let changed = true;
|
||||
let copyable = false;
|
||||
while (changed) {
|
||||
changed = false;
|
||||
if (msg.startsWith('!alternate!')) {
|
||||
classes.push('Alternate');
|
||||
msg = msg.substr('!alternate!'.length);
|
||||
changed = true;
|
||||
}
|
||||
if (msg.startsWith('!copyable!')) {
|
||||
classes.push('Copyable');
|
||||
msg = msg.substr('!copyable!'.length);
|
||||
copyable = changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
const scrollToTop = textArea => {
|
||||
if (!textArea.firstClick) {
|
||||
textArea.firstClick = true;
|
||||
textArea.scrollTop = 0;
|
||||
textArea.setSelectionRange(0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
|
||||
<h1 className={'InfoDetailsHeading'}>{props.InfoMessage.title}</h1>
|
||||
<div className={classes.join(' ')}>
|
||||
<p style={{textAlign: 'left'}}>{msg}</p>
|
||||
{
|
||||
copyable ? (
|
||||
<textarea autoFocus
|
||||
rows={9}
|
||||
value={msg}
|
||||
className={'SkynetImportTextArea'}
|
||||
onClick={e => scrollToTop(e.target)}/>
|
||||
) : (
|
||||
<p style={{textAlign: 'left'}}>{msg}</p>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<Button clicked={props.dismissInfo}>Dismiss</Button>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user