-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
a878d48
commit 8ee8fe3
Showing
10 changed files
with
257 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,75 @@ | ||
import React, { Component } from 'react'; | ||
import styled, { keyframes } from 'styled-components'; | ||
import logo from './reactStuttgartLogo.jpg'; | ||
import React, { Component } from 'react' | ||
import { | ||
BrowserRouter as Router, | ||
Route, | ||
Link | ||
} from 'react-router-dom' | ||
import styled, { keyframes } from 'styled-components' | ||
import ThirdParty from './pages/ThirdParty' | ||
import PassedProps from './pages/PassedProps' | ||
import AdaptingProps from './pages/AdaptingProps' | ||
import OverridingStyles from './pages/OverridingStyles' | ||
import HoverState from './pages/HoverState' | ||
import logo from './reactStuttgartLogo.jpg' | ||
|
||
const AppWrapper = styled.div` | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
const AppHeader = styled.div` | ||
flex: 1; | ||
background-color: #222; | ||
height: 200px; | ||
padding: 20px; | ||
color: white; | ||
`; | ||
` | ||
|
||
const ContentWrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
` | ||
|
||
const DemoBox = styled.div` | ||
flex: 0 1 50%; | ||
` | ||
|
||
const AppIntro = styled.p` | ||
font-size: large; | ||
`; | ||
` | ||
|
||
const rotate360 = keyframes` | ||
from { transform: rotate(0deg); } | ||
to { transform: rotate(360deg); } | ||
`; | ||
` | ||
|
||
const Logo = styled.img` | ||
animation: ${rotate360} infinite 20s linear; | ||
height: 80px; | ||
`; | ||
` | ||
|
||
class App extends Component { | ||
render() { | ||
return ( | ||
<AppWrapper> | ||
<AppHeader> | ||
<Logo src={logo} alt="logo" /> | ||
<h2>Welcome to ReactStuttgart</h2> | ||
</AppHeader> | ||
<AppIntro> | ||
6. Meetup - React Stuttgart @ ITM | ||
</AppIntro> | ||
<AppIntro> | ||
Freitag, 24. März 2017 - 18:30 | ||
</AppIntro> | ||
</AppWrapper> | ||
<Router> | ||
<AppWrapper> | ||
<AppHeader> | ||
<Logo src={logo} alt="logo" /> | ||
<h2>Welcome to ReactStuttgart</h2> | ||
</AppHeader> | ||
<ContentWrapper> | ||
<Route exact path="/" component={ThirdParty}/> | ||
<Route path="/thirdparty" component={ThirdParty}/> | ||
<Route path="/passedprops" component={PassedProps}/> | ||
<Route path="/adaptingprops" component={AdaptingProps}/> | ||
<Route path="/overridingstyles" component={OverridingStyles}/> | ||
<Route path="/hoverstate" component={HoverState}/> | ||
</ContentWrapper> | ||
</AppWrapper> | ||
</Router> | ||
); | ||
} | ||
} | ||
|
||
export default App; | ||
export default 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import styled from 'styled-components'; | ||
|
||
const Button = styled.button` | ||
background-color: red; | ||
color: white; | ||
font-size: 1em; | ||
margin: 1em; | ||
padding: 0.25em 1em; | ||
border: 2px solid yellow; | ||
border-radius: 3px; | ||
`; | ||
|
||
export default Button; |
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,30 @@ | ||
import React, { Component } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const Button = styled.button` | ||
/* Adapt the colors based on primary prop */ | ||
background: ${props => props.primary ? 'red' : 'white'}; | ||
color: ${props => props.primary ? 'white' : 'red'}; | ||
font-size: ${props => props.bigger ? '2em' : '1em'}; | ||
margin: 1em; | ||
padding: 0.25em 1em; | ||
border: 2px solid palevioletred; | ||
border-radius: 3px; | ||
`; | ||
|
||
class PassedProps extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h2>Adapting based on props</h2> | ||
<p> | ||
<Button>Normal</Button> | ||
<Button primary>Primary</Button> | ||
<Button primary bigger>Primary Bigger</Button> | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PassedProps; |
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,35 @@ | ||
import React, { Component } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const Button = styled.button` | ||
/* Adapt the colors based on primary prop */ | ||
background: white; | ||
color: red; | ||
margin: 1em; | ||
padding: 0.25em 1em; | ||
border: 2px solid palevioletred; | ||
border-radius: 3px; | ||
cursor: pointer; | ||
&:hover { | ||
background-color: ${props => props.correct ? 'green' : 'red'}; | ||
} | ||
`; | ||
|
||
class PassedProps extends Component { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<h2>Hover</h2> | ||
<input type="checkbox"/> | ||
<label>Bestätigung AGB</label> | ||
<p> | ||
<Button>Normal</Button> | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PassedProps; |
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,23 @@ | ||
import React, { Component } from 'react' | ||
import styled from 'styled-components' | ||
import Button from '../components/Button' | ||
|
||
const UppercaseButton = styled(Button)` | ||
text-transform: uppercase; | ||
` | ||
|
||
class PassedProps extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h2>Overriding Styles</h2> | ||
<p> | ||
<Button>Normal</Button> | ||
<UppercaseButton>Uppercase</UppercaseButton> | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PassedProps; |
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,27 @@ | ||
import React, { Component } from 'react'; | ||
import styled from 'styled-components'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const Input = styled.input` | ||
font-size: 1.25em; | ||
padding: 0.5em; | ||
color: palevioletred; | ||
background: gray; | ||
border: none; | ||
border-radius: 3px; | ||
`; | ||
|
||
class PassedProps extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h2>Passed Props</h2> | ||
<p> | ||
<Input placeholder="passedProps" type="text" /> | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PassedProps; |
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,26 @@ | ||
import React, { Component } from 'react'; | ||
import styled from 'styled-components'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const StyledLink = styled(Link)` | ||
background-color: red; | ||
color: white; | ||
`; | ||
|
||
class ThirdPartyComponents extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<h2>Third-party components</h2> | ||
<p> | ||
<Link to="/">Standard, unstyled Link</Link> | ||
</p> | ||
<p> | ||
<StyledLink to="/">This Link is styled!</StyledLink> | ||
</p> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default ThirdPartyComponents; |
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