Skip to content

Commit

Permalink
chore: Code Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhunty committed Sep 5, 2018
1 parent 01c08bc commit 39b4457
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,7 @@ exports[`2. a full article with an image as the lead asset 1`] = `
</View>
</View>
<View>
<View
style={
Object {
"flexDirection": "column",
"paddingBottom": 25,
"width": "100%",
}
}
>
<View>
<Video />
<View>
<View
Expand Down Expand Up @@ -635,19 +627,7 @@ exports[`5. an article with ads 1`] = `
</View>
</View>
<View>
<Ad
style={
Object {
"borderBottomColor": "#DBDBDB",
"borderBottomWidth": 1,
"borderTopColor": "#DBDBDB",
"borderTopWidth": 1,
"marginBottom": 20,
"paddingBottom": 10,
"paddingTop": 10,
}
}
/>
<Ad />
</View>
<View />
<View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,7 @@ exports[`2. a full article with an image as the lead asset 1`] = `
</View>
</View>
<View>
<View
style={
Object {
"flexDirection": "column",
"paddingBottom": 25,
"width": "100%",
}
}
>
<View>
<Video />
<View>
<View
Expand Down Expand Up @@ -623,19 +615,7 @@ exports[`5. an article with ads 1`] = `
</View>
</View>
<View>
<Ad
style={
Object {
"borderBottomColor": "#DBDBDB",
"borderBottomWidth": 1,
"borderTopColor": "#DBDBDB",
"borderTopWidth": 1,
"marginBottom": 20,
"paddingBottom": 10,
"paddingTop": 10,
}
}
/>
<Ad />
</View>
<View />
<View>
Expand Down
26 changes: 2 additions & 24 deletions packages/article/src/article-body/article-body-row.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Dimensions, StyleSheet, View } from "react-native";
import { Dimensions, View } from "react-native";
import PropTypes from "prop-types";
import ArticleImage from "@times-components/article-image";
import Ad from "@times-components/ad";
Expand All @@ -8,33 +8,11 @@ import KeyFacts from "@times-components/key-facts";
import { renderTree } from "@times-components/markup-forest";
import coreRenderers from "@times-components/markup";
import PullQuote from "@times-components/pull-quote";
import { colours, spacing } from "@times-components/styleguide";
import Video from "@times-components/video";
import BodyParagraph from "./article-body-paragraph";
import ArticleLink from "./article-link";
import InsetCaption from "./inset-caption";

const styles = StyleSheet.create({
ad: {
borderTopColor: colours.functional.keyline,
borderBottomColor: colours.functional.keyline,
borderTopWidth: 1,
borderBottomWidth: 1,
paddingTop: spacing(2),
paddingBottom: spacing(2),
marginBottom: spacing(4)
},
interactiveContainer: {
paddingRight: spacing(2),
paddingLeft: spacing(2),
marginBottom: spacing(4)
},
primaryContainer: {
width: "100%",
flexDirection: "column",
paddingBottom: spacing(5)
}
});
import styles from "../styles/article-body";

const ArticleRow = ({
content: { data, index },
Expand Down
19 changes: 19 additions & 0 deletions packages/article/src/styles/article-body/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ const sharedStyles = scale => {
}),
marginBottom: spacing(5),
marginTop: 0
},
ad: {
borderTopColor: colours.functional.keyline,
borderBottomColor: colours.functional.keyline,
borderTopWidth: 1,
borderBottomWidth: 1,
paddingTop: spacing(2),
paddingBottom: spacing(2),
marginBottom: spacing(4)
},
interactiveContainer: {
paddingRight: spacing(2),
paddingLeft: spacing(2),
marginBottom: spacing(4)
},
primaryContainer: {
width: "100%",
flexDirection: "column",
paddingBottom: spacing(5)
}
};
};
Expand Down
2 changes: 1 addition & 1 deletion packages/interactive-wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ yarn test:all

Visit the official
[storybook](http://components.thetimes.co.uk/?knob-Size%20of%20ad%20placeholder%3A=default&knob-Interactive=chapterHeading&knob-Interactive%20Wrapper=chapterHeading&selectedKind=Primitives%2FInteractive%20Wrapper&selectedStory=Interactive%20Wrapper&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybooks%2Fstorybook-addon-knobs)
to see our available image templates.
to see our available interactives.
7 changes: 4 additions & 3 deletions packages/interactive-wrapper/src/interactive-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React, { Component } from "react";
import { Linking, Platform, View, WebView } from "react-native";
import PropTypes from "prop-types";

const editorialLambdaUrl =
"https://cwfiyvo20d.execute-api.eu-west-1.amazonaws.com/dev/component";

class InteractiveWrapper extends Component {
static postMessageBugWorkaround() {
return Platform.select({
Expand Down Expand Up @@ -75,9 +78,7 @@ class InteractiveWrapper extends Component {
this.webview = webview;
}}
source={{
uri: `https://cwfiyvo20d.execute-api.eu-west-1.amazonaws.com/dev/component/${
this.props.id
}`
uri: `${editorialLambdaUrl}/${this.props.id}`
}}
style={{ height: this.state.height }}
{...InteractiveWrapper.postMessageBugWorkaround()}
Expand Down

0 comments on commit 39b4457

Please sign in to comment.