
* Upgrade to ESLint v8 * Upgrade TypeScript, api-types, react-intl * Remove unnecessary dependencies * Update to React 17.0.2 * npm audit fixes, remove storybook * Lock some packages * Remove nan patch * Remove some deprecated dependencies * Fix lint/type/tests * Merge'd * Fix bad use of spawn * Fix notarize * Fix afterpack, switch to tsc es2020 * Fix api types * Use @mattermost/eslint-plugin
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
import {Row, Button} from 'react-bootstrap';
|
|
import {FormattedMessage} from 'react-intl';
|
|
|
|
type Props = {
|
|
darkMode?: boolean;
|
|
goBack?: () => void;
|
|
show?: boolean;
|
|
};
|
|
|
|
export default class ExtraBar extends React.PureComponent<Props> {
|
|
handleBack = () => {
|
|
if (this.props.goBack) {
|
|
this.props.goBack();
|
|
}
|
|
};
|
|
render() {
|
|
let barClass = 'clear-mode';
|
|
if (!this.props.show) {
|
|
barClass = 'hidden';
|
|
} else if (this.props.darkMode) {
|
|
barClass = 'dark-mode';
|
|
}
|
|
|
|
return (
|
|
<Row
|
|
id={'extra-bar'}
|
|
className={barClass}
|
|
>
|
|
<div
|
|
className={'container-fluid'}
|
|
onClick={this.handleBack}
|
|
>
|
|
<Button
|
|
variant={'link'}
|
|
size={'sm'}
|
|
>
|
|
<span className={'backIcon icon-arrow-left'}/>
|
|
<span className={'backLabel'}>
|
|
<FormattedMessage
|
|
id='renderer.components.extraBar.back'
|
|
defaultMessage='Back'
|
|
/>
|
|
</span>
|
|
</Button>
|
|
</div>
|
|
</Row>
|
|
);
|
|
}
|
|
}
|