Cleanup part IV
parent
d6e2758406
commit
7903e502b5
|
@ -81,7 +81,7 @@ const MUST_LOAD: ResourceName[] = [
|
|||
export class App extends React.Component<AppProps, {}> {
|
||||
componentDidCatch(x: Error, y: React.ErrorInfo) { catchErrors(x, y); }
|
||||
|
||||
get isLoaded() {
|
||||
private get isLoaded() {
|
||||
return (MUST_LOAD.length ===
|
||||
_.intersection(this.props.loaded, MUST_LOAD).length);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export class ControlsPopup extends React.Component<Props, Partial<State>> {
|
|||
stepSize: 100
|
||||
};
|
||||
|
||||
toggle = (property: keyof State) => () =>
|
||||
private toggle = (property: keyof State) => () =>
|
||||
this.setState({ [property]: !this.state[property] });
|
||||
|
||||
public render() {
|
||||
|
|
|
@ -61,10 +61,10 @@ export class HotKeys extends React.Component<Props, Partial<State>> {
|
|||
</div>;
|
||||
}
|
||||
|
||||
toggle = (property: keyof State) => () =>
|
||||
private toggle = (property: keyof State) => () =>
|
||||
this.setState({ [property]: !this.state[property] });
|
||||
|
||||
hotkeys(dispatch: Function, slug: string) {
|
||||
private hotkeys(dispatch: Function, slug: string) {
|
||||
const idx = _.findIndex(links, { slug });
|
||||
const right = "/app/" + (links[idx + 1] || links[0]).slug;
|
||||
const left = "/app/" + (links[idx - 1] || links[links.length - 1]).slug;
|
||||
|
@ -103,7 +103,7 @@ export class HotKeys extends React.Component<Props, Partial<State>> {
|
|||
return hotkeyMap;
|
||||
}
|
||||
|
||||
renderHotkeys() {
|
||||
public renderHotkeys() {
|
||||
const slug = getPathArray()[2];
|
||||
return <Hotkeys>
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import axios from "axios";
|
||||
import { InitOptions } from "i18next";
|
||||
|
||||
/** @public */
|
||||
export function generateUrl(langCode: string) {
|
||||
const lang = langCode.slice(0, 2);
|
||||
const url = "//" + location.host.split(":")
|
||||
|
|
|
@ -43,7 +43,7 @@ export class RootComponent extends React.Component<RootComponentProps, {}> {
|
|||
* based on the device (mobile or desktop) for optimization/css purposes.
|
||||
* Open to revision.
|
||||
*/
|
||||
maybeReplaceDesignerModules(next: RouterState, replace: RedirectFunction) {
|
||||
private maybeReplaceDesignerModules(next: RouterState, replace: RedirectFunction) {
|
||||
if (next.location.pathname === "/app/designer") {
|
||||
replace(`${next.location.pathname}/plants`);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ export class RootComponent extends React.Component<RootComponentProps, {}> {
|
|||
/app/404 => 404
|
||||
*/
|
||||
|
||||
routes = {
|
||||
private routes = {
|
||||
component: App,
|
||||
indexRoute: controlsRoute,
|
||||
childRoutes: [
|
||||
|
|
Loading…
Reference in New Issue