Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
[Cleanup] Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed Dec 8, 2017
1 parent 603c19f commit 5e0b8db
Show file tree
Hide file tree
Showing 38 changed files with 230 additions and 269 deletions.
9 changes: 2 additions & 7 deletions src/lib/AppRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ import HomeScene from "./Scenes/Home"
import renderWithLoadProgress from "./utils/renderWithLoadProgress"
import { Schema, screenTrack as track } from "./utils/track"

// FIXME: This isnt being used
// Analytics wrapper for all of our top level React components
// function AddTrack(_pageName: string) {
// return component => component
// }

interface ArtistProps {
artistID: string
isPad: boolean
}

const Artist: React.SFC<ArtistProps> = track<ArtistProps>(props => {
return {
context_screen: Schema.PageNames.ArtistPage,
Expand All @@ -35,7 +30,7 @@ const Artist: React.SFC<ArtistProps> = track<ArtistProps>(props => {
}
})(props => <ArtistRenderer {...props} render={renderWithLoadProgress(Containers.Artist, props)} />)

const Inbox: React.SFC<{}> = track<{}>(_props => {
const Inbox: React.SFC<{}> = track<{}>(() => {
return { context_screen: Schema.PageNames.InboxPage, context_screen_owner_type: null }
})(() => <InboxRenderer render={renderWithLoadProgress(Containers.Inbox)} />)

Expand Down
40 changes: 13 additions & 27 deletions src/lib/Components/Artist/Articles/Article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@ import fonts from "lib/data/fonts"
import SwitchBoard from "lib/NativeModules/SwitchBoard"
import ImageView from "../../OpaqueImageView"

interface Props extends ViewProperties {
article: {
href: string
author: {
name
}
thumbnail_image: {
url
}
thumbnail_title: string
}
}

class Article extends React.Component<Props, {}> {
class Article extends React.Component<RelayProps & ViewProperties> {
handleTap() {
SwitchBoard.presentNavigationViewController(this, this.props.article.href)
}
Expand Down Expand Up @@ -101,16 +88,15 @@ export default createFragmentContainer(
`
)

// FIXME: This is being unused in code
// interface RelayProps {
// article: {
// thumbnail_title: string | null
// href: string | null
// author: {
// name: string | null
// } | null
// thumbnail_image: {
// url: string | null
// } | null
// }
// }
interface RelayProps {
article: {
thumbnail_title: string | null
href: string | null
author: {
name: string | null
} | null
thumbnail_image: {
url: string | null
} | null
}
}
15 changes: 7 additions & 8 deletions src/lib/Components/Artist/Articles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { createFragmentContainer, graphql } from "react-relay"
import SerifText from "../../Text/Serif"
import Article from "./Article"

interface Props extends ViewProperties {
interface Props extends RelayProps, ViewProperties {
articles: any[]
}

class Articles extends React.Component<Props, {}> {
class Articles extends React.Component<Props> {
render() {
const articles = this.props.articles
return (
Expand Down Expand Up @@ -49,9 +49,8 @@ export default createFragmentContainer(
`
)

// FIXME: This is being unused in code
// interface RelayProps {
// articles: Array<{
// __id: string
// } | null> | null
// }
interface RelayProps {
articles: Array<{
__id: string
} | null> | null
}
31 changes: 11 additions & 20 deletions src/lib/Components/Artist/Artworks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ interface RenderSectionParams {
mapPropsToArtworksConnection: (Props) => any
}

interface Props extends ViewProperties {
artist: {
counts: {
for_sale_artworks: number
artworks: number
}
not_for_sale_artworks: any[]
for_sale_artworks: any[]
}
interface Props extends RelayProps, ViewProperties {
relay: any
}

Expand Down Expand Up @@ -138,14 +130,13 @@ export default createFragmentContainer(
`
)

// FIXME: This is unused in code
// interface RelayProps {
// artist: {
// counts: {
// artworks: boolean | number | string | null
// for_sale_artworks: boolean | number | string | null
// } | null
// for_sale_artworks: Array<boolean | number | string | null> | null
// not_for_sale_artworks: Array<boolean | number | string | null> | null
// }
// }
interface RelayProps {
artist: {
counts: {
artworks: number | null
for_sale_artworks: number | null
} | null
for_sale_artworks: Array<number | null> | null
not_for_sale_artworks: Array<boolean | number | string | null> | null
}
}
19 changes: 7 additions & 12 deletions src/lib/Components/Artist/Biography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import SerifText from "../Text/Serif"

const sideMargin = Dimensions.get("window").width > 700 ? 50 : 0

interface Props extends ViewProperties {
artist: any
}

class Biography extends React.Component<Props, any> {
class Biography extends React.Component<RelayProps & ViewProperties> {
render() {
const artist = this.props.artist
if (!artist.blurb && !artist.bio) {
Expand Down Expand Up @@ -70,10 +66,9 @@ export default createFragmentContainer(
`
)

// FIXME: This isn't being used in code
// interface RelayProps {
// artist: {
// bio: string | null
// blurb: string | null
// }
// }
interface RelayProps {
artist: {
bio: string | null
blurb: string | null
}
}
2 changes: 1 addition & 1 deletion src/lib/Components/Artist/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Header extends React.Component<Props, State> {
NativeModules.ARTemporaryAPIModule.followStatusForArtist(this.props.artist._id, (error, following) => {
if (error) {
// FIXME: Handle error
console.error("Artist/Header.tsx |", error)
console.error("Artist/Header.tsx", error.message)
}
this.setState({ following })
})
Expand Down
49 changes: 16 additions & 33 deletions src/lib/Components/Artist/Shows/Metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@ import SerifText from "lib/Components/Text/Serif"
import colors from "lib/data/colors"
import fonts from "lib/data/fonts"

interface Props extends ViewProperties {
show: {
name: string
kind: string
exhibition_period: string
location?: {
city: string
}
status_update?: string
status: string
partner?: {
name: string
}
}
}

class Metadata extends React.Component<Props, any> {
class Metadata extends React.Component<RelayProps & ViewProperties> {
render() {
const partnerName = this.props.show.partner && this.props.show.partner.name
return (
Expand Down Expand Up @@ -120,19 +104,18 @@ export default createFragmentContainer(
`
)

// FIXME: This isn't being used in code
// interface RelayProps {
// show: {
// kind: string | null
// name: string | null
// exhibition_period: string | null
// status_update: string | null
// status: string | null
// partner: {
// name: string | null
// } | null
// location: {
// city: string | null
// } | null
// }
// }
interface RelayProps {
show: {
kind: string | null
name: string | null
exhibition_period: string | null
status_update: string | null
status: string | null
partner: {
name: string | null
} | null
location: {
city: string | null
} | null
}
}
25 changes: 9 additions & 16 deletions src/lib/Components/Artist/Shows/Show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import SwitchBoard from "../../../NativeModules/SwitchBoard"
import OpaqueImageView from "../../OpaqueImageView"
import Metadata from "./Metadata"

interface Props extends ViewProperties {
show: {
href: string
cover_image: {
url: string
}
}
interface Props extends RelayProps, ViewProperties {
styles?: {
container?: any
image?: any
Expand Down Expand Up @@ -56,12 +50,11 @@ export default createFragmentContainer(
`
)

// FIXME: This isn't being used in code
// interface RelayProps {
// show: {
// href: string | null
// cover_image: {
// url: string | null
// } | null
// }
// }
interface RelayProps {
show: {
href: string | null
cover_image: {
url: string | null
} | null
}
}
13 changes: 4 additions & 9 deletions src/lib/Components/Artist/Shows/SmallList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import Show from "./Show"

import colors from "lib/data/colors"

interface Props extends ViewProperties {
shows: any[]
}

interface State {
dataSource: ListViewDataSource
}

class SmallList extends React.Component<Props, State> {
class SmallList extends React.Component<RelayProps & ViewProperties, State> {
constructor(props) {
super(props)
this.state = {
Expand Down Expand Up @@ -72,7 +68,6 @@ export default createFragmentContainer(
`
)

// FIXME: This isn't being used in code
// interface RelayProps {
// shows: Array<{} | null> | null
// }
interface RelayProps {
shows: Array<{} | null> | null
}
13 changes: 6 additions & 7 deletions src/lib/Components/Artist/Shows/VariableSizeShowsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LayoutChangeEvent, StyleSheet, View, ViewProperties, ViewStyle } from "

import Show from "./Show"

interface Props extends ViewProperties {
interface Props extends RelayProps, ViewProperties {
showSize: "medium" | "large"
shows: any[]
}
Expand Down Expand Up @@ -102,9 +102,8 @@ export default createFragmentContainer(
`
)

// FIXME: This isn't being used in code
// interface RelayProps {
// shows: Array<{
// __id: string
// } | null> | null
// }
interface RelayProps {
shows: Array<{
__id: string
} | null> | null
}
2 changes: 1 addition & 1 deletion src/lib/Components/Artist/Shows/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SerifText from "../../Text/Serif"
import SmallList from "./SmallList"
import VariableSizeShowsList from "./VariableSizeShowsList"

class Shows extends React.Component<RelayProps, any> {
class Shows extends React.Component<RelayProps> {
render() {
return (
<View style={styles.container}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Components/ArtworkGrids/InfiniteScrollGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class InfiniteScrollArtworksGrid extends React.Component<Props, State> {
this.props.relay.loadMore(PAGE_SIZE, error => {
if (error) {
// FIXME: Handle error
console.error("InfiniteScrollGrid.tsx |", error)
console.error("InfiniteScrollGrid.tsx", error.message)
}
this.setState({ fetchingNextPage: false })
if (!this.artworksConnection().pageInfo.hasNextPage && this.props.onComplete) {
Expand Down
3 changes: 0 additions & 3 deletions src/lib/Components/Consignments/Screens/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@ export default class Info extends React.Component<Props, State> {

const isPad = Dimensions.get("window").width > 700

// TODO: Reenable when used
// const isPadHorizontal = Dimensions.get("window").height > 700

return (
<ConsignmentBG showCloseButton>
<ScrollView style={{ flex: 1 }} alwaysBounceVertical={false} centerContent>
Expand Down
3 changes: 0 additions & 3 deletions src/lib/Components/Consignments/Screens/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export default class Welcome extends React.Component<Props, null> {
render() {
const isPad = Dimensions.get("window").width > 700

// TODO: Reenable when used
// const isPadHorizontal = Dimensions.get("window").height > 700

const TOS = () =>
<Text style={{ textDecorationStyle: "solid", textDecorationLine: "underline" }} onPress={this.TOSTapped}>
Terms of Sevice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,9 @@ export const uploadFileToS3 = async (file: string, req: GeminiCredsInput, res: G
const bucket = asset.policy_document.conditions.bucket
const uploadURL = `https://${bucket}.s3.amazonaws.com`

// FIXME: This is being unused in 103; does this uploader work?
// const filename = file.split(/\//g).pop()

const data = {
"Content-Type": "image/jpg",
key: geminiKey + "/${filename}",
key: geminiKey + "/${filename}", // NOTE: This form (which _looks_ like ES6 interpolation) is required by AWS
AWSAccessKeyId: asset.credentials,
acl: req.acl,
success_action_status: asset.policy_document.conditions.success_action_status,
Expand Down
Loading

0 comments on commit 5e0b8db

Please sign in to comment.