Skip to content

Commit 8f46625

Browse files
committed
web: add changelog modal
1 parent 80de458 commit 8f46625

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

web/src/ChangeLogModal.tsx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React from 'react';
2+
import { Modal } from 'office-ui-fabric-react/lib/Modal';
3+
import { Link } from 'office-ui-fabric-react/lib/Link';
4+
import {getTheme, IconButton } from 'office-ui-fabric-react';
5+
import {getContentStyles, getIconButtonStyles} from './styles/modal';
6+
import config from './services/config';
7+
8+
const TITLE_ID = 'ChangeLogTitle';
9+
const SUB_TITLE_ID = 'ChangeLogSubtitle';
10+
11+
interface ChangeLogModalProps {
12+
isOpen: boolean
13+
onClose: () => void
14+
}
15+
16+
export default function ChangeLogModal(props: ChangeLogModalProps) {
17+
const theme = getTheme();
18+
const contentStyles = getContentStyles(theme);
19+
const iconButtonStyles = getIconButtonStyles(theme);
20+
21+
return (
22+
<Modal
23+
titleAriaId={TITLE_ID}
24+
subtitleAriaId={SUB_TITLE_ID}
25+
isOpen={props.isOpen}
26+
onDismiss={props.onClose}
27+
containerClassName={contentStyles.container}
28+
>
29+
<div className={contentStyles.header}>
30+
<span id={TITLE_ID}>Changelog</span>
31+
<IconButton
32+
iconProps={{ iconName: 'Cancel' }}
33+
styles={iconButtonStyles}
34+
ariaLabel='Close popup modal'
35+
onClick={props.onClose as any}
36+
/>
37+
</div>
38+
<div id={SUB_TITLE_ID} className={contentStyles.body}>
39+
<p>
40+
<b>Interface - Global</b>
41+
<ul>
42+
<li>Added list of snippets with <u>templates and tutorials</u> near <b>Open</b> menu item</li>
43+
<li>Moved <b>Settings</b> menu button from drop-down to main section</li>
44+
</ul>
45+
</p>
46+
<p>
47+
<b>Interface - Settings</b>
48+
<ul>
49+
<li>Added editor fonts selector</li>
50+
<li>Added support of font code ligatures</li>
51+
<li>Fixed fallback font issue that might cause issues on Linux</li>
52+
</ul>
53+
</p>
54+
<p>
55+
And more!
56+
</p>
57+
<p>
58+
Full release notes for {config.appVersion} are available <Link href={`${config.githubUrl}/releases/latest`} target='_blank'>here</Link>
59+
</p>
60+
</div>
61+
</Modal>
62+
)
63+
}
64+
65+
ChangeLogModal.defaultProps = {isOpen: false};

web/src/Header.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ import {
1717
saveFileDispatcher,
1818
shareSnippetDispatcher
1919
} from './store';
20+
import ChangeLogModal from "./ChangeLogModal";
2021

2122

2223

2324
interface HeaderState {
2425
showSettings: boolean
2526
showAbout: boolean
27+
showChangelog: boolean
2628
loading: boolean
2729
}
2830

@@ -36,6 +38,7 @@ export class Header extends React.Component<any, HeaderState> {
3638
this.state = {
3739
showSettings: false,
3840
showAbout: false,
41+
showChangelog: false,
3942
loading: false
4043
};
4144
}
@@ -118,6 +121,16 @@ export class Header extends React.Component<any, HeaderState> {
118121

119122
get asideItems(): ICommandBarItemProps[] {
120123
return [
124+
{
125+
key: 'changelog',
126+
text: 'What\'s new',
127+
ariaLabel: 'Changelog',
128+
disabled: this.props.loading,
129+
iconProps: {iconName: 'Giftbox'},
130+
onClick: () => {
131+
this.setState({showChangelog: true});
132+
}
133+
},
121134
{
122135
key: 'format',
123136
text: 'Format',
@@ -209,6 +222,7 @@ export class Header extends React.Component<any, HeaderState> {
209222
/>
210223
<SettingsModal onClose={(args) => this.onSettingsClose(args)} isOpen={this.state.showSettings} />
211224
<AboutModal onClose={() => this.setState({showAbout: false})} isOpen={this.state.showAbout} />
225+
<ChangeLogModal onClose={() => this.setState({showChangelog: false})} isOpen={this.state.showChangelog} />
212226
</header>;
213227
}
214228
}

0 commit comments

Comments
 (0)