Skip to content

Commit 9a5cb57

Browse files
author
yinm
committed
Bootstrapで見た目を整える
1 parent 2fc915a commit 9a5cb57

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

app/assets/javascripts/Task.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class Task extends React.Component {
1313
{this.props.content}
1414
</td>
1515
<td>
16-
<select defaultValue={this.props.status} onChange={this.handleUpdate.bind(this)} >
16+
<select className="form-control" defaultValue={this.props.status} onChange={this.handleUpdate.bind(this)} >
1717
<option value="todo" key="todo">todo</option>
1818
<option value="doing" key="doing">doing</option>
1919
<option value="done" key="done">done</option>

app/assets/javascripts/TaskApp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class TaskApp extends React.Component {
6868
<div className="TaskApp">
6969
<TaskForm
7070
onTaskSubmit={this.handleTaskSubmit.bind(this)} />
71-
<table>
71+
<table className="table table-striped">
7272
<thead>
7373
<tr>
7474
<th>Content</th>

app/assets/javascripts/TaskForm.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ export default class TaskForm extends React.Component {
1616
render() {
1717
return (
1818
<form className="todoForm" onSubmit={this.handleSubmit.bind(this)}>
19-
<input type="text" placeholder="ToDo" ref="content" />
20-
<input type="submit" value="登録" />
19+
<div className="input-group">
20+
<input type="text" className="form-control" placeholder="ToDo" ref="content" />
21+
<span className="input-group-btn">
22+
<input type="submit" className="btn btn-primary" value="登録" />
23+
</span>
24+
</div>
2125
</form>
2226
);
2327
}

app/views/layouts/application.html.erb

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<title>Todo</title>
5+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
56
<%= csrf_meta_tags %>
67

78
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>

app/views/welcome/index.html.erb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<h1>Listing Tasks</h1>
21
<div id="container">
2+
<h1 class="page-header">Listing Tasks</h1>
3+
<div id="container"></div>
34
</div>

0 commit comments

Comments
 (0)