-
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
Showing
6 changed files
with
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
|
||
> .content-component { | ||
flex: 1 1 0; | ||
background-color: #333; | ||
background-color: #eee; | ||
} | ||
} | ||
} |
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 +1,2 @@ | ||
@import "./app/app"; | ||
@import "./app/app"; | ||
@import "./sidebar/sidebar"; |
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,7 +1,24 @@ | ||
import * as React from "react"; | ||
|
||
export class ContentComponent extends React.Component { | ||
interface Props { | ||
readonly selectedNavigationItem: string; | ||
} | ||
|
||
export class ContentComponent extends React.Component<Props> { | ||
render() { | ||
return <div className="content-component"></div>; | ||
return ( | ||
<div className="content-component"> | ||
{this.renderContent(this.props.selectedNavigationItem)} | ||
</div> | ||
); | ||
} | ||
|
||
private renderContent = (navigationItem: string) => { | ||
switch (navigationItem) { | ||
case "Übersicht": | ||
return <div>Übersicht</div>; | ||
default: | ||
return <div>Alles andere</div>; | ||
} | ||
}; | ||
} |
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,7 @@ | ||
.sidebar-component { | ||
button { | ||
display: block; | ||
margin-top: 10px; | ||
background-color: transparent; | ||
} | ||
} |
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,7 +1,27 @@ | ||
import * as React from "react"; | ||
|
||
export class SidebarComponent extends React.Component { | ||
interface Props { | ||
readonly selectNavigationItem: (navigationItem: string) => void; | ||
} | ||
|
||
interface State { | ||
|
||
} | ||
|
||
export class SidebarComponent extends React.Component<Props, State> { | ||
render() { | ||
return <aside className="sidebar-component"></aside>; | ||
const selectNavigationItem = this.props.selectNavigationItem; | ||
|
||
return ( | ||
<aside className="sidebar-component"> | ||
{navigationItems.map(navigationItem => | ||
<button key={navigationItem} | ||
onClick={() => selectNavigationItem(navigationItem)}>{navigationItem}</button>)} | ||
</aside> | ||
); | ||
} | ||
} | ||
} | ||
|
||
const navigationItems = [ | ||
"Übersicht", "Disposition", "Meldungen" | ||
]; |