Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused import, values #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bestsellers/BookItem.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from "react";

import { StyleSheet, Text, View, Image, ListView } from "react-native";
import { StyleSheet, Text, View, Image } from "react-native";

const styles = StyleSheet.create({
bookItem: {
Expand Down
2 changes: 1 addition & 1 deletion src/bestsellers/BookList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from "react";

import { StyleSheet, Text, View, Image, FlatList } from "react-native";
import { StyleSheet, View, FlatList } from "react-native";

import BookItem from "./BookItem";
import NYT from "./NYT";
Expand Down
48 changes: 21 additions & 27 deletions src/bestsellers/BookSectionList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from "react";

import { StyleSheet, Text, View, Image, SectionList } from "react-native";
import { StyleSheet, Text, View, SectionList } from "react-native";

import BookItem from "./BookItem";
import NYT from "./NYT";
Expand All @@ -25,29 +25,27 @@ class BookList extends Component {
};

_refreshData = () => {
Promise
.all([
NYT.fetchBooks("hardcover-fiction"),
NYT.fetchBooks("hardcover-nonfiction")
])
.then(results => {
if (results.length !== 2) {
console.error("Unexpected results");
}
Promise.all([
NYT.fetchBooks("hardcover-fiction"),
NYT.fetchBooks("hardcover-nonfiction")
]).then(results => {
if (results.length !== 2) {
console.error("Unexpected results");
}

this.setState({
sections: [
{
title: "Hardcover Fiction",
data: this._addKeysToBooks(results[0])
},
{
title: "Hardcover NonFiction",
data: this._addKeysToBooks(results[1])
}
]
});
this.setState({
sections: [
{
title: "Hardcover Fiction",
data: this._addKeysToBooks(results[0])
},
{
title: "Hardcover NonFiction",
data: this._addKeysToBooks(results[1])
}
]
});
});
};

_renderItem = ({ item }) => {
Expand All @@ -61,11 +59,7 @@ class BookList extends Component {
};

_renderHeader = ({ section }) => {
return (
<Text style={styles.headingText}>
{section.title}
</Text>
);
return <Text style={styles.headingText}>{section.title}</Text>;
};

render() {
Expand Down
8 changes: 5 additions & 3 deletions src/bestsellers/MockBookList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from "react";

import { StyleSheet, Text, View, Image, FlatList } from "react-native";
import { StyleSheet, FlatList } from "react-native";

import BookItem from "./BookItem";

Expand All @@ -9,13 +9,15 @@ const mockBooks = [
rank: 1,
title: "GATHERING PREY",
author: "John Sandford",
book_image: "http://du.ec2.nytimes.com.s3.amazonaws.com/prd/books/9780399168796.jpg"
book_image:
"http://du.ec2.nytimes.com.s3.amazonaws.com/prd/books/9780399168796.jpg"
},
{
rank: 2,
title: "MEMORY MAN",
author: "David Baldacci",
book_image: "http://du.ec2.nytimes.com.s3.amazonaws.com/prd/books/9781455586387.jpg"
book_image:
"http://du.ec2.nytimes.com.s3.amazonaws.com/prd/books/9781455586387.jpg"
}
];

Expand Down
2 changes: 1 addition & 1 deletion src/bestsellers/NYT.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const API_KEY = "73b19491b83909c7e07016f4bb4644f9:2:60667290";
const LIST_NAME = "hardcover-fiction";
const API_STEM = "https://api.nytimes.com/svc/books/v3/lists";

function fetchBooks(list_name = LIST_NAME) {
function fetchBooks() {
let url = `${API_STEM}/${LIST_NAME}?response-format=json&api-key=${API_KEY}`;
return fetch(url)
.then(response => response.json())
Expand Down
3 changes: 0 additions & 3 deletions src/bestsellers/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import SimpleList from "./SimpleList";
import MockBookList from "./MockBookList";
import BookList from "./BookList";
import BookSectionList from "./BookSectionList";

export default BookSectionList;
2 changes: 1 addition & 1 deletion src/depends/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import { StyleSheet, View } from "react-native";

import _ from "lodash";
import Video from "react-native-video";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import DeckModel from "./../../data/Deck";
import Button from "./../Button";
import NormalText from "./../NormalText";
import colors from "./../../styles/colors";
Expand All @@ -20,7 +19,6 @@ class Deck extends Component {
render() {
return (
<View style={styles.deckGroup}>

<Button style={styles.deckButton} onPress={this._review}>
<NormalText>
{this.props.deck.name}: {this.props.count} cards
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import { CreateDeckButton, EnterDeck } from "./DeckCreationFields";

Expand All @@ -9,7 +8,7 @@ class DeckCreation extends Component {
this.state = { showingNameField: false };
}

_newDeck = name => {
_newDeck = () => {
console.warn("Not implemented");
this.setState({ showingNameField: false });
};
Expand All @@ -19,9 +18,11 @@ class DeckCreation extends Component {
};

render() {
let contents = this.state.showingNameField
? <EnterDeck create={this._newDeck} />
: <CreateDeckButton onPress={this._showField} />;
let contents = this.state.showingNameField ? (
<EnterDeck create={this._newDeck} />
) : (
<CreateDeckButton onPress={this._showField} />
);
return contents;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_01/components/HeadingText.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import { StyleSheet, Text } from "react-native";

import { fonts, scalingFactors } from "./../styles/fonts";
import Dimensions from "Dimensions";
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_01/components/Input.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, TextInput, View } from "react-native";
import { StyleSheet, TextInput } from "react-native";

import colors from "./../styles/colors";
import { fonts } from "./../styles/fonts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import DeckModel from "./../../data/Deck";

import Button from "../Button";
import LabeledInput from "../LabeledInput";
import NormalText from "../NormalText";
Expand Down
4 changes: 2 additions & 2 deletions src/flashcards/src_checkpoint_01/components/NormalText.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import { StyleSheet, Text } from "react-native";

import { fonts, scalingFactors } from "./../styles/fonts";
import Dimensions from "Dimensions";
Expand All @@ -18,7 +18,7 @@ class NormalText extends Component {
}

const scaled = StyleSheet.create({
normal: { fontSize: width * 1.0 / scalingFactors.normal }
normal: { fontSize: (width * 1.0) / scalingFactors.normal }
});

export default NormalText;
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import { StyleSheet } from "react-native";

import Button from "./../Button";
import NormalText from "./../NormalText";
import HeadingText from "./../HeadingText";
import colors from "./../../styles/colors";

class ContinueButton extends Component {
Expand Down Expand Up @@ -65,9 +64,7 @@ function mkAnswerButtons(
selectAnswerFunc(isCorrectAnswer);
}}
>
<NormalText>
{a}
</NormalText>
<NormalText>{a}</NormalText>
</Button>
);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from "react";
import React from "react";
import { StyleSheet, View } from "react-native";

import HeadingText from "./../HeadingText";
Expand All @@ -9,9 +9,7 @@ import colors from "./../../styles/colors";
function mkReviewSummary(percentCorrect, quitFunc) {
return (
<View style={styles.done}>
<HeadingText style={styles.alternate}>
Reviews cleared!
</HeadingText>
<HeadingText style={styles.alternate}>Reviews cleared!</HeadingText>
<NormalText style={styles.alternate}>
{Math.round(percentCorrect * 100)}% correct
</NormalText>
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_02/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, View, TouchableOpacity } from "react-native";
import { StyleSheet, TouchableOpacity } from "react-native";

import colors from "./../styles/colors";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import DeckModel from "./../../data/Deck";
import Button from "./../Button";
import NormalText from "./../NormalText";
import colors from "./../../styles/colors";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import { CreateDeckButton, EnterDeck } from "./DeckCreationFields";

Expand All @@ -19,9 +18,11 @@ class DeckCreation extends Component {
};

render() {
let contents = this.state.showingNameField
? <EnterDeck create={this._newDeck} />
: <CreateDeckButton onPress={this._showField} />;
let contents = this.state.showingNameField ? (
<EnterDeck create={this._newDeck} />
) : (
<CreateDeckButton onPress={this._showField} />
);
return contents;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/flashcards/src_checkpoint_02/components/Flashcards.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import React from "react";
import { StackNavigator } from "react-navigation";

import Logo from "./Header/Logo";
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_02/components/HeadingText.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import { StyleSheet, Text } from "react-native";

import { fonts, scalingFactors } from "./../styles/fonts";
import Dimensions from "Dimensions";
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_02/components/Input.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, TextInput, View } from "react-native";
import { StyleSheet, TextInput } from "react-native";

import colors from "./../styles/colors";
import { fonts } from "./../styles/fonts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import DeckModel from "./../../data/Deck";

import Button from "../Button";
import LabeledInput from "../LabeledInput";
import NormalText from "../NormalText";
Expand Down
4 changes: 2 additions & 2 deletions src/flashcards/src_checkpoint_02/components/NormalText.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import { StyleSheet, Text } from "react-native";

import { fonts, scalingFactors } from "./../styles/fonts";
import Dimensions from "Dimensions";
Expand All @@ -18,7 +18,7 @@ class NormalText extends Component {
}

const scaled = StyleSheet.create({
normal: { fontSize: width * 1.0 / scalingFactors.normal }
normal: { fontSize: (width * 1.0) / scalingFactors.normal }
});

export default NormalText;
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_03/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, View, TouchableOpacity } from "react-native";
import { StyleSheet, TouchableOpacity } from "react-native";

import colors from "./../styles/colors";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import DeckModel from "./../../data/Deck";
import Button from "./../Button";
import NormalText from "./../NormalText";
import colors from "./../../styles/colors";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";

import { CreateDeckButton, EnterDeck } from "./DeckCreationFields";

Expand All @@ -19,9 +18,11 @@ class DeckCreation extends Component {
};

render() {
let contents = this.state.showingNameField
? <EnterDeck create={this._newDeck} />
: <CreateDeckButton onPress={this._showField} />;
let contents = this.state.showingNameField ? (
<EnterDeck create={this._newDeck} />
) : (
<CreateDeckButton onPress={this._showField} />
);
return contents;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/flashcards/src_checkpoint_03/components/Flashcards.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import { StackNavigator } from "react-navigation";
import { createStore } from "redux";
import { Provider } from "react-redux";
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_03/components/HeadingText.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, Text, View } from "react-native";
import { StyleSheet, Text } from "react-native";

import { fonts, scalingFactors } from "./../styles/fonts";
import Dimensions from "Dimensions";
Expand Down
2 changes: 1 addition & 1 deletion src/flashcards/src_checkpoint_03/components/Input.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StyleSheet, TextInput, View } from "react-native";
import { StyleSheet, TextInput } from "react-native";

import colors from "./../styles/colors";
import { fonts } from "./../styles/fonts";
Expand Down
Loading