Skip to content

Commit

Permalink
Merge pull request #5709 from artsy/revert-5647-top-works-rail
Browse files Browse the repository at this point in the history
Revert "Re-style Artist Page Header + Replace Carousel w/ Top works Rail"
  • Loading branch information
sweir27 authored Jun 3, 2020
2 parents 612e493 + 0268adc commit 5c6543b
Show file tree
Hide file tree
Showing 30 changed files with 1,568 additions and 2,339 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, color, Flex, Image, Sans } from "@artsy/palette"
import { Box, Flex, Image, Sans, Serif, color } from "@artsy/palette"
import { ArtistCollectionEntity_collection } from "v2/__generated__/ArtistCollectionEntity_collection.graphql"
import { track } from "v2/Artsy/Analytics"
import * as Schema from "v2/Artsy/Analytics/Schema"
Expand Down Expand Up @@ -105,7 +105,7 @@ export class ArtistCollectionEntity extends React.Component<CollectionProps> {
}
}

const CollectionTitle = styled(Sans)`
const CollectionTitle = styled(Serif)`
width: max-content;
`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import { ArtistCollectionEntityFragmentContainer as ArtistCollectionEntity } fro

interface ArtistCollectionsRailProps {
collections: ArtistCollectionsRail_collections
includeTopSpacer?: boolean
}

@track(null, {
dispatch: data => Events.postEvent(data),
})
export class ArtistCollectionsRail extends React.Component<
ArtistCollectionsRailProps
ArtistCollectionsRailProps
> {
@track({
action_type: Schema.ActionType.Impression,
Expand All @@ -42,16 +43,20 @@ export class ArtistCollectionsRail extends React.Component<
// noop
}

static defaultProps = {
includeTopSpacer: true,
}

render() {
const { collections } = this.props
const { collections, includeTopSpacer } = this.props
if (collections.length > 3) {
return (
<Box>
<Waypoint onEnter={once(this.trackImpression.bind(this))} />

<Separator my={3} />
{includeTopSpacer && <Separator my={3} />}

<Sans size="4" color="black100" my={1}>
<Sans size="5" color="black100" mb={2}>
Iconic Collections
</Sans>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ describe("CollectionsRail", () => {
it("Tracks impressions", () => {
const { Component, dispatch } = mockTracking(ArtistCollectionsRail)
const component = mount(<Component {...props} />)
component.find(Waypoint).getElement().props.onEnter()
component
.find(Waypoint)
.getElement()
.props.onEnter()

expect(dispatch).toBeCalledWith({
action_type: "Impression",
Expand Down Expand Up @@ -120,7 +123,10 @@ describe("CollectionsRail", () => {
const updatedCollections = { collections: collectionsCopy }
const { Component, dispatch } = mockTracking(ArtistCollectionsRail)
const component = mount(<Component {...updatedCollections} />)
component.find(ArrowButton).at(1).simulate("click")
component
.find(ArrowButton)
.at(1)
.simulate("click")
// Settimeout needed here for carousel render
setTimeout(() => {
expect(dispatch).toBeCalledWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ArtistCollectionsRailFragmentContainer as ArtistCollectionsRail } from
interface Props {
artistID: string
isFeaturedArtistContent?: boolean
includeTopSpacer?: boolean
}

export const ArtistCollectionsRailContent: React.SFC<Props> = passedProps => {
Expand Down
Loading

0 comments on commit 5c6543b

Please sign in to comment.