Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat: move panes to lsg
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpeschel committed Dec 14, 2017
1 parent a90f70c commit 53fd5fa
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 37 deletions.
43 changes: 6 additions & 37 deletions src/component/app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Chrome } from './container/chrome';
import { colors } from '../lsg/patterns/colors';
import { WebviewTag } from 'electron';
import ElementPane from '../lsg/patterns/panes/element-pane';
import { ElementList } from './container/element_list';
import globalStyles from '../lsg/patterns/global-styles';
import { IconName, IconRegistry } from '../lsg/patterns/icons';
Expand All @@ -12,44 +12,18 @@ import { observer } from 'mobx-react';
import DevTools from 'mobx-react-devtools';
import { Page } from '../store/page';
import { PatternList } from './container/pattern_list';
import PatternsPane from '../lsg/patterns/panes/patterns-pane';
import PreviewPane from '../lsg/patterns/panes/preview-pane';
import ProjectPane from '../lsg/patterns/panes/project-pane';
import { ProjectList } from './container/project_list';
import PropertyPane from '../lsg/patterns/panes/property-pane';
import { PropertyList } from './container/property_list';
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Store } from '../store';
import styledComponents from 'styled-components';

globalStyles();

const ElementPane = styledComponents.div`
flex: 3 0 60%;
overflow: scroll;
`;

const PropertyPane = styledComponents.div`
flex: 2 0 0px;
`;

const PatternsPane = styledComponents.div`
flex: 2 0 40%;
overflow: scroll;
border-top: 2px solid ${colors.grey70.toString()};
box-sizing: border-box;
padding: 18px 0;
`;

const ProjectPane = styledComponents.div`
flex: 3 0 0px;
`;

const PreviewPane = styledComponents.div`
flex: 2 0 0px;
background-color: #ffffff;
border-radius: 6px 6px 0 0;
box-shadow: 0 3px 9px 0 rgba(0,0,0,.15);
overflow: hidden;
`;

interface AppProps {
store: Store;
}
Expand Down Expand Up @@ -103,12 +77,7 @@ class App extends React.Component<AppProps> {
</PatternsPane>
</SideBar>

<PreviewPane
dangerouslySetInnerHTML={{
__html:
'<webview id="preview" style="height: 100%;" src="./preview.html" partition="electron" nodeintegration />'
}}
/>
<PreviewPane />
<SideBar directionVertical hasPaddings>
<PropertyPane>
<PropertyList store={this.props.store} />
Expand Down
25 changes: 25 additions & 0 deletions src/lsg/patterns/panes/element-pane/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as React from 'react';
import styled from 'styled-components';

const StyledElementPane = styled.div`
position: relative;
flex-grow: 3;
flex-shrink: 0;
flex-basis: 60%;
overflow: scroll;
/*FadeOut*/
&::after {
content: '';
position: sticky;
bottom: 0;
display: block;
width: 100%;
height: 40px;
background: linear-gradient(to bottom, rgba(247,247,247,0) 0%, rgba(247,247,247,0.5) 15%, rgba(247,247,247,1) 100%);
}
`;

const ElementPane: React.StatelessComponent<{}> = props => <StyledElementPane>{props.children}</StyledElementPane>;

export default ElementPane;
9 changes: 9 additions & 0 deletions src/lsg/patterns/panes/element-pane/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "element-pane",
"displayName": "Element Pane",
"flag": "alpha",
"version": "1.0.0",
"tags": ["atom", "element-pane"],
"patterns": {
}
}
16 changes: 16 additions & 0 deletions src/lsg/patterns/panes/patterns-pane/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { colors } from '../../colors';
import * as React from 'react';
import styled from 'styled-components';

const StyledPatternsPane = styled.div`
box-sizing: border-box;
flex-grow: 2;
flex-shrink: 0;
flex-basis: 40%;
border-top: 2px solid ${colors.grey70.toString()};
overflow: scroll;
`;

const PatternsPane: React.StatelessComponent<{}> = props => <StyledPatternsPane>{props.children}</StyledPatternsPane>;

export default PatternsPane;
10 changes: 10 additions & 0 deletions src/lsg/patterns/panes/patterns-pane/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "patterns-pane",
"displayName": "Patterns Pane",
"flag": "alpha",
"version": "1.0.0",
"tags": ["atom", "patterns-pane"],
"patterns": {
"color": "color"
}
}
19 changes: 19 additions & 0 deletions src/lsg/patterns/panes/preview-pane/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { colors } from '../../colors';
import * as React from 'react';
import styled from 'styled-components';

const StyledPreviewPane = styled.div`
flex-grow: 1;
flex-shrink: 0;
background: ${colors.white.toString()};
border-radius: 6px 6px 0 0;
box-shadow: 0 3px 9px 0 ${colors.black.toRGBString(0.15)};
overflow: hidden;
`;

const PreviewPane: React.StatelessComponent<{}> = props => <StyledPreviewPane dangerouslySetInnerHTML={{
__html:
'<webview id="preview" style="height: 100%;" src="./preview.html" partition="electron" nodeintegration />'
}} />;

export default PreviewPane;
10 changes: 10 additions & 0 deletions src/lsg/patterns/panes/preview-pane/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "preview-pane",
"displayName": "Preview Pane",
"flag": "alpha",
"version": "1.0.0",
"tags": ["atom", "preview-pane"],
"patterns": {
"colors": "colors"
}
}
12 changes: 12 additions & 0 deletions src/lsg/patterns/panes/project-pane/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as React from 'react';
import styled from 'styled-components';

const StyledProjectPane = styled.div`
flex-grow: 1;
flex-shrink: 0;
flex-basis: 60%;
`;

const ProjectPane: React.StatelessComponent<{}> = props => <StyledProjectPane>{props.children}</StyledProjectPane>;

export default ProjectPane;
9 changes: 9 additions & 0 deletions src/lsg/patterns/panes/project-pane/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "project-pane",
"displayName": "Project Pane",
"flag": "alpha",
"version": "1.0.0",
"tags": ["atom", "project-pane"],
"patterns": {
}
}
12 changes: 12 additions & 0 deletions src/lsg/patterns/panes/property-pane/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as React from 'react';
import styled from 'styled-components';

const StyledPropertyPane = styled.div`
flex-grow: 1;
flex-shrink: 0;
flex-basis: 40%;
`;

const PropertyPane: React.StatelessComponent<{}> = props => <StyledPropertyPane>{props.children}</StyledPropertyPane>;

export default PropertyPane;
9 changes: 9 additions & 0 deletions src/lsg/patterns/panes/property-pane/pattern.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "property-pane",
"displayName": "Property Pane",
"flag": "alpha",
"version": "1.0.0",
"tags": ["atom", "property-pane"],
"patterns": {
}
}

0 comments on commit 53fd5fa

Please sign in to comment.