This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(electron): move preview in webview
- Loading branch information
Lasse Küchler
committed
Dec 8, 2017
1 parent
9fd4013
commit 3cebb70
Showing
5 changed files
with
63 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Layout from '../lsg/patterns/layout'; | ||
import DevTools from 'mobx-react-devtools'; | ||
import { Preview } from './presentation/preview'; | ||
import * as React from 'react'; | ||
import * as ReactDom from 'react-dom'; | ||
import { Store } from '../store'; | ||
import styledComponents from 'styled-components'; | ||
|
||
const PreviewPane = styledComponents.div` | ||
flex: 2 0 0px; | ||
padding: 10px; | ||
box-shadow: inset 0 0 10px 0 rgba(0,0,0,.25); | ||
`; | ||
|
||
interface AppProps { | ||
store: Store; | ||
} | ||
|
||
class App extends React.Component<AppProps> { | ||
public constructor(props: AppProps) { | ||
super(props); | ||
} | ||
|
||
public render(): JSX.Element { | ||
return ( | ||
<Layout> | ||
<PreviewPane> | ||
<Preview store={this.props.store} /> | ||
</PreviewPane> | ||
<DevTools /> | ||
</Layout> | ||
); | ||
} | ||
} | ||
|
||
const store = new Store(); | ||
store.openStyleguide('../stacked-example'); | ||
store.openPage('my-project', 'mypage'); | ||
|
||
ReactDom.render(<App store={store} />, document.getElementById('app')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
<script>require('../../dist/component/app.js')</script> | ||
</body> | ||
|
||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html> | ||
|
||
<head> | ||
<title>Stacked™</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app" style="position: absolute; top:0; bottom:0; left:0; right:0;"></div> | ||
<script>require('../../dist/component/preview.js')</script> | ||
</body> | ||
|
||
</html> |