You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
5 years ago
|
import React from 'react';
|
||
|
import { SessionIconButton, SessionIconSize, SessionIconType } from '../icon';
|
||
|
|
||
|
import { SettingsViewProps } from './SessionSettings';
|
||
|
|
||
|
export class SettingsHeader extends React.Component<SettingsViewProps> {
|
||
|
public constructor(props: any) {
|
||
|
super(props);
|
||
|
}
|
||
|
|
||
|
public focusSearch() {
|
||
|
$('.left-pane-setting-section .session-search-input input').focus();
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
const category = String(this.props.category);
|
||
|
const categoryTitlePrefix = category[0].toUpperCase() + category.substr(1);
|
||
|
// Remove 's' on the end to keep words in singular form
|
||
|
const categoryTitle =
|
||
|
categoryTitlePrefix[categoryTitlePrefix.length - 1] === 's'
|
||
|
? categoryTitlePrefix.slice(0, -1) + ' Settings'
|
||
|
: categoryTitlePrefix + ' Settings';
|
||
|
|
||
|
return (
|
||
|
<div className="session-settings-header">
|
||
|
{categoryTitle}
|
||
|
<SessionIconButton
|
||
|
iconType={SessionIconType.Search}
|
||
|
iconSize={SessionIconSize.Large}
|
||
|
onClick={this.focusSearch}
|
||
|
/>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
}
|