Skip to content

Commit

Permalink
Add mailing list form to our start page (microsoft#15816)
Browse files Browse the repository at this point in the history
* Add mailing list form to our start page

* Really format with prettier

* mess up with formatting

* Format with prettier once again:
  • Loading branch information
luabud authored Apr 9, 2021
1 parent ba80e4d commit 830065a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"StartPage.openInteractiveWindow": "Use the Interactive Window to develop Python Scripts",
"StartPage.interactiveWindowDesc": "- You can create cells on a Python file by typing \"#%%\" <br /> - Use \"<div class=\"italics\">Shift + Enter</div> \" to run a cell, the output will be shown in the interactive window",
"StartPage.releaseNotes": "Take a look at our <a class=\"link\" href={0}>Release Notes</a> to learn more about the latest features.",
"StartPage.mailingList": "<a class=\"link\" href={0}>Sign up</a> for tips and tutorials through our mailing list.",
"StartPage.tutorialAndDoc": "Explore more features in our <a class=\"link\" href={0}>Tutorials</a> or check <a class=\"link\" href={1}>Documentation</a> for tips and troubleshooting.",
"StartPage.dontShowAgain": "Don't show this page again",
"StartPage.helloWorld": "Hello world",
Expand Down
4 changes: 4 additions & 0 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ export namespace StartPage {
'StartPage.tutorialAndDoc',
'Explore more features in our <a class="link" href={0}>Tutorials</a> or check <a class="link" href={1}>Documentation</a> for tips and troubleshooting.',
);
export const mailingList = localize(
'StartPage.mailingList',
'<a class="link" href={0}>Sign up</a> for tips and tutorials through our mailing list.',
);
export const dontShowAgain = localize('StartPage.dontShowAgain', "Don't show this page again");
export const helloWorld = localize('StartPage.helloWorld', 'Hello world');
// When localizing sampleNotebook, the translated notebook must also be included in
Expand Down
15 changes: 15 additions & 0 deletions src/startPage-ui/startPage/startPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
<div className="releaseNotesRow">
{this.renderReleaseNotesLink()}
{this.renderTutorialAndDoc()}
{this.renderMailingList()}
</div>
<div className="block">
<input
Expand Down Expand Up @@ -262,6 +263,20 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
);
}

private renderMailingList(): JSX.Element {
return (
<div
className="paragraph"
dangerouslySetInnerHTML={{
__html: getLocString(
'StartPage.mailingList',
'<a class="link" href={0}>Sign up</a> for tips and tutorials through our mailing list.',
).format('https://aka.ms/AAbopxr'),
}}
/>
);
}

private openBlankNotebook = () => {
this.postOffice.sendMessage<IStartPageMapping>(StartPageMessages.OpenBlankNotebook);
};
Expand Down

0 comments on commit 830065a

Please sign in to comment.