-
Notifications
You must be signed in to change notification settings - Fork 1
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
45 changed files
with
556 additions
and
155 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "react-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 @@ | ||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" /> |
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,7 @@ | ||
module.exports = { | ||
excludes: ['node_modules/**/test/**'], | ||
aliases: { | ||
$: 'third-party-libs/jquery', | ||
_: 'third-party-libs/underscore', | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import type { Screen, System } from '../../types' | ||
import FontAwesome from 'react-fontawesome' | ||
import LinearProgress from 'material-ui/LinearProgress' | ||
|
||
export type Props = {} | ||
|
||
const LoadingIndicator = ({ }: Props) => ( | ||
<LinearProgress mode="indeterminate" /> | ||
) | ||
const LoadingIndicator = () => <LinearProgress mode="indeterminate" /> | ||
|
||
export default LoadingIndicator |
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,121 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import TextField from 'material-ui/TextField' | ||
import RaisedButton from 'material-ui/RaisedButton' | ||
import { List, ListItem } from 'material-ui/List' | ||
import FontAwesome from 'react-fontawesome' | ||
import styled from 'styled-components' | ||
import type { Tag } from '../../types' | ||
|
||
export type Props = { | ||
tags: Tag[], | ||
searchSubmit: Function, | ||
} | ||
|
||
type State = { | ||
qText: string, | ||
tagText: string, | ||
} | ||
|
||
const Wrapper = styled.div` | ||
padding: 10px; | ||
` | ||
|
||
const Inputs = styled.div` | ||
width: 70%; | ||
` | ||
|
||
const Row = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
` | ||
|
||
const IconWrap = styled.div` | ||
margin: 15px auto; | ||
width: 2em; | ||
` | ||
|
||
class Component extends React.Component<Props, State> { | ||
constructor(props: Props) { | ||
super(props) | ||
this.state = { | ||
qText: '', | ||
tagText: '', | ||
} | ||
} | ||
render() { | ||
const { props, state } = this | ||
const filteredTags = props.tags.filter( | ||
tag => tag.name.indexOf(state.tagText) !== -1, | ||
) | ||
return ( | ||
<Wrapper> | ||
<Row> | ||
<Inputs> | ||
<Row> | ||
<IconWrap> | ||
<FontAwesome name="search" /> | ||
</IconWrap> | ||
<TextField | ||
hintText="キーワード・作品・キャラ" | ||
value={state.qText} | ||
onChange={(event: Object, newValue: string) => { | ||
this.setState({ | ||
qText: newValue, | ||
}) | ||
}} | ||
/> | ||
</Row> | ||
<Row> | ||
<IconWrap> | ||
<FontAwesome name="tag" /> | ||
</IconWrap> | ||
<TextField | ||
hintText="タグ" | ||
value={state.tagText} | ||
onChange={(event: Object, newValue: string) => { | ||
console.log(newValue) | ||
this.setState({ | ||
tagText: newValue, | ||
}) | ||
}} | ||
/> | ||
</Row> | ||
</Inputs> | ||
<RaisedButton | ||
style={{ margin: 5, height: 50, width: 50 }} | ||
label="検索" | ||
onClick={() => { | ||
props.searchSubmit(state.qText, state.tagText) | ||
}} | ||
/> | ||
</Row> | ||
<p>タグ数:{props.tags.length}</p> | ||
<p>絞り込み:{filteredTags.length}</p> | ||
<List> | ||
{filteredTags.map(tag => { | ||
// HACKME | ||
const selected = tag.name === state.tagText | ||
return ( | ||
<ListItem | ||
key={tag.id} | ||
rightIcon={ | ||
<FontAwesome | ||
name={selected ? 'times-circle-o' : 'circle-thin'} | ||
/> | ||
} | ||
primaryText={tag.name} | ||
onClick={() => { | ||
this.setState({ tagText: selected ? '' : tag.name }) | ||
}} | ||
secondaryText="..." | ||
/> | ||
) | ||
})} | ||
</List> | ||
</Wrapper> | ||
) | ||
} | ||
} | ||
|
||
export default Component |
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
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
Oops, something went wrong.