Skip to content
This repository was archived by the owner on Jun 3, 2022. It is now read-only.

Commit 873f087

Browse files
authored
Moves page layout to new template. (#6)
1 parent 77f5d3f commit 873f087

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

src/PageLayout.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/** @license
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy
6+
* of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
import * as React from "react";
18+
19+
/** Returns a stateless page layout template. */
20+
export function PageLayout(props: any) {
21+
return (
22+
<div className="mdl-layout mdl-js-layout mdl-layout--fixed-header">
23+
<header className="mdl-layout__header">
24+
<div className="mdl-layout__header-row">
25+
<img src="remixer.svg" alt="Remixer Remote" />
26+
</div>
27+
</header>
28+
<main className="mdl-layout__content">
29+
<div className="page-content">
30+
{props.children}
31+
</div>
32+
</main>
33+
</div>
34+
);
35+
}

src/RemoteController.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { remixer } from "../node_modules/material-remixer/src/core/Remixer";
2323
import { ConstraintType, DataType } from "../node_modules/material-remixer/src/lib/Constants";
2424
import { LocalStorage } from "../node_modules/material-remixer/src/lib/LocalStorage";
2525
import { OverlayController } from "../node_modules/material-remixer/src/ui/OverlayController";
26+
import { PageLayout } from "./PageLayout";
2627
import { Variable } from "../node_modules/material-remixer/src/core/variables/Variable";
2728

2829
/** The globally exposed library MDL exposes as `window['componentHandler']`. */
@@ -116,15 +117,17 @@ class RemoteController {
116117
}
117118
}
118119

119-
/** Renders the OverlayController component to the DOM. */
120+
/** Renders the remote controller to the DOM. */
120121
private redraw(): void {
121122
const overlayWrapper = document.getElementById("remixer-remote");
122123
ReactDOM.render(
123-
<OverlayController
124-
wrapperElement={overlayWrapper}
125-
variables={this.variables}
126-
updateVariable={this.updateVariable.bind(this)}
127-
/>,
124+
<PageLayout>
125+
<OverlayController
126+
wrapperElement={overlayWrapper}
127+
variables={this.variables}
128+
updateVariable={this.updateVariable.bind(this)}
129+
/>
130+
</PageLayout>,
128131
overlayWrapper,
129132
);
130133

src/remote-style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ body {
2727
padding: 0 40px 0 40px;
2828
}
2929

30+
.mdl-layout__header-row img {
31+
height: 32px;
32+
}
33+
3034
.page-content {
3135
padding: 40px;
3236
}

0 commit comments

Comments
 (0)