mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Fix code style inconsistencies
This commit is contained in:
@@ -4,7 +4,7 @@ interface CounterState {
|
||||
currentCount: number;
|
||||
}
|
||||
|
||||
export class Counter extends React.Component<void, CounterState> {
|
||||
export class Counter extends React.Component<any, CounterState> {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = { currentCount: 0 };
|
||||
|
||||
@@ -5,7 +5,7 @@ interface FetchDataExampleState {
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
export class FetchData extends React.Component<void, FetchDataExampleState> {
|
||||
export class FetchData extends React.Component<any, FetchDataExampleState> {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = { forecasts: [], loading: true };
|
||||
@@ -31,7 +31,7 @@ export class FetchData extends React.Component<void, FetchDataExampleState> {
|
||||
}
|
||||
|
||||
private static renderForecastsTable(forecasts: WeatherForecast[]) {
|
||||
return <table className="table">
|
||||
return <table className='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export class Home extends React.Component<void, void> {
|
||||
export class Home extends React.Component<any, void> {
|
||||
public render() {
|
||||
return <div>
|
||||
<h1>Hello, world!</h1>
|
||||
<p>Welcome to your new single-page application, built with:</p>
|
||||
<ul>
|
||||
<li><a href="https://get.asp.net/">ASP.NET Core</a> and <a href="https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx">C#</a> for cross-platform server-side code</li>
|
||||
<li><a href="https://facebook.github.io/react/">React</a> and <a href="http://www.typescriptlang.org/">TypeScript</a> for client-side code</li>
|
||||
<li><a href="https://webpack.github.io/">Webpack</a> for building and bundling client-side resources</li>
|
||||
<li><a href="http://getbootstrap.com/">Bootstrap</a> for layout and styling</li>
|
||||
<li><a href='https://get.asp.net/'>ASP.NET Core</a> and <a href='https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx'>C#</a> for cross-platform server-side code</li>
|
||||
<li><a href='https://facebook.github.io/react/'>React</a> and <a href='http://www.typescriptlang.org/'>TypeScript</a> for client-side code</li>
|
||||
<li><a href='https://webpack.github.io/'>Webpack</a> for building and bundling client-side resources</li>
|
||||
<li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li>
|
||||
</ul>
|
||||
<p>To help you get started, we've also set up:</p>
|
||||
<ul>
|
||||
|
||||
@@ -7,12 +7,12 @@ export interface LayoutProps {
|
||||
|
||||
export class Layout extends React.Component<LayoutProps, void> {
|
||||
public render() {
|
||||
return <div className="container-fluid">
|
||||
<div className="row">
|
||||
<div className="col-sm-3">
|
||||
return <div className='container-fluid'>
|
||||
<div className='row'>
|
||||
<div className='col-sm-3'>
|
||||
<NavMenu />
|
||||
</div>
|
||||
<div className="col-sm-9">
|
||||
<div className='col-sm-9'>
|
||||
{ this.props.body }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
import * as React from 'react';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
export class NavMenu extends React.Component<void, void> {
|
||||
export class NavMenu extends React.Component<any, void> {
|
||||
public render() {
|
||||
return <div className="main-nav">
|
||||
<div className="navbar navbar-inverse">
|
||||
<div className="navbar-header">
|
||||
<button type="button" className="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span className="sr-only">Toggle navigation</span>
|
||||
<span className="icon-bar"></span>
|
||||
<span className="icon-bar"></span>
|
||||
<span className="icon-bar"></span>
|
||||
return <div className='main-nav'>
|
||||
<div className='navbar navbar-inverse'>
|
||||
<div className='navbar-header'>
|
||||
<button type='button' className='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>
|
||||
<span className='sr-only'>Toggle navigation</span>
|
||||
<span className='icon-bar'></span>
|
||||
<span className='icon-bar'></span>
|
||||
<span className='icon-bar'></span>
|
||||
</button>
|
||||
<Link className="navbar-brand" to={ '/' }>WebApplicationBasic</Link>
|
||||
<Link className='navbar-brand' to={ '/' }>WebApplicationBasic</Link>
|
||||
</div>
|
||||
<div className="clearfix"></div>
|
||||
<div className="navbar-collapse collapse">
|
||||
<ul className="nav navbar-nav">
|
||||
<div className='clearfix'></div>
|
||||
<div className='navbar-collapse collapse'>
|
||||
<ul className='nav navbar-nav'>
|
||||
<li>
|
||||
<Link to={ '/' } activeClassName='active'>
|
||||
<span className="glyphicon glyphicon-home"></span> Home
|
||||
<span className='glyphicon glyphicon-home'></span> Home
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={ '/counter' } activeClassName='active'>
|
||||
<span className="glyphicon glyphicon-education"></span> Counter
|
||||
<span className='glyphicon glyphicon-education'></span> Counter
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to={ '/fetchdata' } activeClassName='active'>
|
||||
<span className="glyphicon glyphicon-th-list"></span> Fetch data
|
||||
<span className='glyphicon glyphicon-th-list'></span> Fetch data
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { FetchData } from './components/FetchData';
|
||||
import { Counter } from './components/Counter';
|
||||
|
||||
export const routes = <Route component={ Layout }>
|
||||
<Route path="/" components={{ body: Home }} />
|
||||
<Route path="/counter" components={{ body: Counter }} />
|
||||
<Route path="/fetchdata" components={{ body: FetchData }} />
|
||||
<Route path='/' components={{ body: Home }} />
|
||||
<Route path='/counter' components={{ body: Counter }} />
|
||||
<Route path='/fetchdata' components={{ body: FetchData }} />
|
||||
</Route>;
|
||||
|
||||
Reference in New Issue
Block a user