-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
136 additions
and
141 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
example/src/components/CardCSS/CardCSS.tsx → demo/src/components/CardCSS/CardCSS.tsx
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...StyledComponents/CardStyledComponents.tsx → ...StyledComponents/CardStyledComponents.tsx
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,11 @@ | ||
import * as React from 'react'; | ||
import { LiveProvider, LiveEditor } from 'react-live'; | ||
import cardInlineCode from './cardInline.code'; | ||
|
||
const CardCode = () => ( | ||
<LiveProvider code={cardInlineCode}> | ||
<LiveEditor contentEditable={false}/> | ||
</LiveProvider> | ||
); | ||
|
||
export default CardCode; |
File renamed without changes.
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,28 @@ | ||
import * as React from 'react'; | ||
// import styled from 'styled-components'; | ||
import CardStyledComponents from '../components/CardStyledComponents/CardStyledComponents'; | ||
import CardInlineStyles from '../components/CardInlineStyles/CardInlineStyles'; | ||
import CardCSS from '../components/CardCSS/CardCSS'; | ||
import data, { ApplicationState } from '../data'; | ||
|
||
const fakeAPI = () => new Promise<ApplicationState>((resolve, reject) => setTimeout(() => resolve(data), 10000002500)); | ||
|
||
class Home extends React.Component<{}, ApplicationState> { | ||
state = {} as ApplicationState; | ||
|
||
componentWillMount() { | ||
fakeAPI().then((response) => this.setState(response)); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<CardInlineStyles card={this.state.cardA}/> | ||
<CardStyledComponents card={this.state.cardB} title="A title"/> | ||
<CardCSS card={this.state.cardC}/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Home; |
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,29 @@ | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
import CardCode from '../components/cardCode'; | ||
import data, { ApplicationState } from '../data'; | ||
|
||
const fakeAPI = () => new Promise<ApplicationState>((resolve, reject) => setTimeout(() => resolve(data), 10000002500)); | ||
|
||
const P = styled.p` | ||
font-size: 20px; | ||
`; | ||
|
||
class Home extends React.Component<{}, ApplicationState> { | ||
state = {} as ApplicationState; | ||
|
||
componentWillMount() { | ||
fakeAPI().then((response) => this.setState(response)); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<P>Display a skeleton preview of your application's content before the data get loaded</P> | ||
<CardCode/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Home; |
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,47 @@ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { Router, Route, browserHistory, Link, IndexRoute } from 'react-router'; | ||
import styled from 'styled-components'; | ||
import Examples from './examples'; | ||
import Home from './home'; | ||
|
||
const Title = styled.h1` | ||
font-family: open-sans, sans-serif; | ||
font-size: 24px; | ||
text-align: center; | ||
`; | ||
|
||
const Nav = styled.nav` | ||
text-align: center; | ||
`; | ||
|
||
const StyledLink = styled(Link)` | ||
margin: 0px 4px; | ||
`; | ||
|
||
const Root: React.StatelessComponent<void> = ({ children }) => ( | ||
<div> | ||
<Title>React-skeletor</Title> | ||
<Nav> | ||
<StyledLink to="/">home</StyledLink> | ||
<StyledLink to="/demo">Examples</StyledLink> | ||
</Nav> | ||
{ | ||
children | ||
} | ||
</div> | ||
); | ||
|
||
function render() { | ||
ReactDOM.render( | ||
<Router history={browserHistory}> | ||
<Route path="/" component={Root}> | ||
<IndexRoute component={Home}/> | ||
<Route path="/demo" component={Examples}/> | ||
</Route> | ||
</Router>, | ||
document.getElementById('root') | ||
); | ||
} | ||
|
||
render(); |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
}, | ||
"exclude": [ | ||
"src/__tests__", | ||
"example", | ||
"demo", | ||
"node_modules", | ||
"lib" | ||
] | ||
|