Big refactor: ts/ directory for all typescript, including react

Split out test-specific and general utility react components too.

And moved our test/legacy* files for the Style Guide into a styleguide/
subdirectory of test/.

I think we'll be able to live in this directory structure for a while.
This commit is contained in:
Scott Nonnenberg 2018-04-05 15:30:40 -07:00
parent 50d4dbaae7
commit 23537546fe
No known key found for this signature in database
GPG key ID: 5F82280C35134661
18 changed files with 54 additions and 37 deletions

View file

@ -1,5 +1,6 @@
/* global window: false */
// Because we aren't hosting the styleguide in Electron, we can't rely on preload.js
// Because we aren't hosting the Style Guide in Electron, we can't rely on preload.js
// to set things up for us. This gives us the minimum bar shims for everything it
// provdes.
//
@ -17,14 +18,14 @@ window.Signal.Migrations = {
getPlaceholderMigrations: () => {},
};
window.Signal.React = window.Signal.React = {};
window.Signal.React = {};
window.EmojiConvertor = function EmojiConvertor() {};
window.EmojiConvertor.prototype.init_colons = () => {};
window.EmojiConvertor.prototype.signalReplace = html => html;
window.EmojiConvertor.prototype.replace_unified = string => string;
window.EmojiConvertor.prototype.img_sets = {
apple: {}
apple: {},
};
window.i18n = () => '';

View file

@ -1,20 +1,27 @@
/* global window: false */
// Taken from background.html.
// Templates are here solely to support the Backbone views rendered in the styleguide.
// Templates are here solely to support the Backbone views rendered in the Style Guide.
// Note: Any change here must be reflected in background.html to be reflected in the app
// and test/index.html to be reflected in the unit tests.
window.Whisper.View.Templates = {
hasRetry: `
{{ messageNotSent }}
<span href='#' class='retry'>{{ resend }}</span>
{{ messageNotSent }} <span href='#' class='retry'>{{ resend }}</span>
`,
'some-failed': `
{{ someFailed }}
`,
keychange: `
<span class='content' dir='auto'><span class='shield icon'></span> {{ content }}</span>
<span class='content' dir='auto'>
<span class='shield icon'></span> {{ content }}
</span>
`,
'verified-change': `
<span class='content' dir='auto'><span class='{{ icon }} icon'></span> {{ content }}</span>
<span class='content' dir='auto'>
<span class='{{ icon }} icon'></span> {{ content }}
</span>
`,
message: `
{{> avatar }}
@ -41,5 +48,5 @@ window.Whisper.View.Templates = {
`,
expirationTimerUpdate: `
<span class='content'><span class='icon clock'></span> {{ content }}</span>
`
`,
};