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

LD-531 - Adds correct margin/padding to last carousel image #1556

Merged
merged 5 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Fixes scrollable tab bar on global saves & follows - ash & ashley
- Requires phone number during bidder registration - sweir27
- Migrates to React Native 0.57.x - orta/alloy/luc/justin
- Adds correct margin/padding to last carousel image - kieran

### 1.9.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export class Carousel extends React.Component<Props> {
const { sources } = this.props

return sources.map((source, i) => (
<Flex key={this.keyForSource(source)} mr={1} alignItems="flex-start">
<Flex
key={this.keyForSource(source)}
mr={i === sources.length - 1 ? 2 : 1}
pr={i === sources.length - 1 ? 2 : 0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We repeat this logic twice: i === sources.length - 1. Maybe we could put it in a local var? It'd make it easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, just updated

alignItems="flex-start"
>
<ImageView {...source} isFirst={i === 0} />
</Flex>
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -105,12 +107,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -134,12 +138,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -163,12 +169,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -192,12 +200,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -221,12 +231,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -250,12 +262,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -279,12 +293,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -308,12 +324,14 @@ exports[`Carousel renders properly 1`] = `
<View
alignItems="flex-start"
mr={1}
pr={0}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"paddingRight": 0,
},
undefined,
]
Expand All @@ -336,13 +354,15 @@ exports[`Carousel renders properly 1`] = `
</View>
<View
alignItems="flex-start"
mr={1}
mr={2}
pr={2}
style={
Array [
Object {
"alignItems": "flex-start",
"display": "flex",
"marginRight": 4,
"marginRight": 8,
"paddingRight": 8,
},
undefined,
]
Expand Down
175 changes: 89 additions & 86 deletions storybook/storyLoader.js
Original file line number Diff line number Diff line change
@@ -1,99 +1,102 @@

// Auto-generated file created by react-native-storybook-loader
// Do not edit.
//
// https://github.com/elderfo/react-native-storybook-loader.git

function loadStories() {
require("../src/lib/Components/Artist/__stories__/ArtistArticles.story")
require("../src/lib/Components/Artist/__stories__/ArtistHeader.story")
require("../src/lib/Components/Bidding/Components/__stories__/Checkbox.story")
require("../src/lib/Components/Bidding/Components/__stories__/Input.story")
require("../src/lib/Components/Bidding/Components/__stories__/Timer.story")
require("../src/lib/Components/Bidding/Screens/__stories__/BidResult.story")
require("../src/lib/Components/Bidding/Screens/__stories__/RegistrationResult.story")
require("../src/lib/Components/Bidding/__stories__/BidFlow.story")
require("../src/lib/Components/Buttons/__stories__/Buttons.story")
require("../src/lib/Components/Consignments/__stories__/BottomAligned.story")
require("../src/lib/Components/Consignments/__stories__/Consignments.story")
require("../src/lib/Components/Consignments/__stories__/ImageSelection.story")
require("../src/lib/Components/Consignments/__stories__/Search.story")
require("../src/lib/Components/Consignments/__stories__/Style.story")
require("../src/lib/Components/Consignments/__stories__/Todo.story")
require("../src/lib/Components/Inbox/ActiveBids/__stories__/ActiveBids.story")
require("../src/lib/Components/Inbox/Conversations/Preview/__stories__/InvoicePreview.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/ArtworkPreview.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/Avatar.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/Composer.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/ConversationSnippet.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/Inbox.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/Message.story")
require("../src/lib/Components/Inbox/Conversations/__stories__/ZeroStateInbox.story")
require("../src/lib/Components/States/__stories__/ZeroState.story")
require("../src/lib/Components/Text/__stories__/Typography.story")
require("../src/lib/Components/__stories__/DottedLine.story")
require("../src/lib/Components/__stories__/Markdown.story")
require("../src/lib/Components/__stories__/Modal.story")
require("../src/lib/Components/__stories__/TabBar.story")
require("../src/lib/Components/__stories__/Video.story")
require("../src/lib/Containers/__stories__/Artist.story")
require("../src/lib/Containers/__stories__/Gene.story")
require("../src/lib/Containers/__stories__/Inquiry.story")
require("../src/lib/Containers/__stories__/Sale.story")
require("../src/lib/Scenes/Fair/__stories__/Fair.story")
require("../src/lib/Scenes/Favorites/__stories__/Favorites.story")
require("../src/lib/Scenes/Home/Components/Sales/Components/__stories__/LotsByFollowedArtists.story")
require("../src/lib/Scenes/Home/__stories__/Home.story")
require("../src/lib/Scenes/Map/__stories__/Map.story")
require("../src/lib/Scenes/Settings/__stories__/Settings.story")
require("../src/lib/Scenes/Show/__stories__/Show.story")
require('../src/lib/Components/Artist/__stories__/ArtistArticles.story');
require('../src/lib/Components/Artist/__stories__/ArtistHeader.story');
require('../src/lib/Components/Bidding/Components/__stories__/Checkbox.story');
require('../src/lib/Components/Bidding/Components/__stories__/Input.story');
require('../src/lib/Components/Bidding/Components/__stories__/Timer.story');
require('../src/lib/Components/Bidding/Screens/__stories__/BidResult.story');
require('../src/lib/Components/Bidding/Screens/__stories__/RegistrationResult.story');
require('../src/lib/Components/Bidding/__stories__/BidFlow.story');
require('../src/lib/Components/Buttons/__stories__/Buttons.story');
require('../src/lib/Components/Consignments/__stories__/BottomAligned.story');
require('../src/lib/Components/Consignments/__stories__/Consignments.story');
require('../src/lib/Components/Consignments/__stories__/ImageSelection.story');
require('../src/lib/Components/Consignments/__stories__/Search.story');
require('../src/lib/Components/Consignments/__stories__/Style.story');
require('../src/lib/Components/Consignments/__stories__/Todo.story');
require('../src/lib/Components/Inbox/ActiveBids/__stories__/ActiveBids.story');
require('../src/lib/Components/Inbox/Conversations/Preview/__stories__/InvoicePreview.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/ArtworkPreview.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/Avatar.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/Composer.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/ConversationSnippet.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/Inbox.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/Message.story');
require('../src/lib/Components/Inbox/Conversations/__stories__/ZeroStateInbox.story');
require('../src/lib/Components/States/__stories__/ZeroState.story');
require('../src/lib/Components/Text/__stories__/Typography.story');
require('../src/lib/Components/__stories__/DottedLine.story');
require('../src/lib/Components/__stories__/Markdown.story');
require('../src/lib/Components/__stories__/Modal.story');
require('../src/lib/Components/__stories__/TabBar.story');
require('../src/lib/Components/__stories__/Video.story');
require('../src/lib/Containers/__stories__/Artist.story');
require('../src/lib/Containers/__stories__/Gene.story');
require('../src/lib/Containers/__stories__/Inquiry.story');
require('../src/lib/Containers/__stories__/Sale.story');
require('../src/lib/Scenes/Fair/__stories__/Fair.story');
require('../src/lib/Scenes/Favorites/__stories__/Favorites.story');
require('../src/lib/Scenes/Home/Components/Sales/Components/__stories__/LotsByFollowedArtists.story');
require('../src/lib/Scenes/Home/__stories__/Home.story');
require('../src/lib/Scenes/Map/__stories__/Map.story');
require('../src/lib/Scenes/Settings/__stories__/Settings.story');
require('../src/lib/Scenes/Show/__stories__/Show.story');

}

const stories = [
"../src/lib/Components/Artist/__stories__/ArtistArticles.story",
"../src/lib/Components/Artist/__stories__/ArtistHeader.story",
"../src/lib/Components/Bidding/Components/__stories__/Checkbox.story",
"../src/lib/Components/Bidding/Components/__stories__/Input.story",
"../src/lib/Components/Bidding/Components/__stories__/Timer.story",
"../src/lib/Components/Bidding/Screens/__stories__/BidResult.story",
"../src/lib/Components/Bidding/Screens/__stories__/RegistrationResult.story",
"../src/lib/Components/Bidding/__stories__/BidFlow.story",
"../src/lib/Components/Buttons/__stories__/Buttons.story",
"../src/lib/Components/Consignments/__stories__/BottomAligned.story",
"../src/lib/Components/Consignments/__stories__/Consignments.story",
"../src/lib/Components/Consignments/__stories__/ImageSelection.story",
"../src/lib/Components/Consignments/__stories__/Search.story",
"../src/lib/Components/Consignments/__stories__/Style.story",
"../src/lib/Components/Consignments/__stories__/Todo.story",
"../src/lib/Components/Inbox/ActiveBids/__stories__/ActiveBids.story",
"../src/lib/Components/Inbox/Conversations/Preview/__stories__/InvoicePreview.story",
"../src/lib/Components/Inbox/Conversations/__stories__/ArtworkPreview.story",
"../src/lib/Components/Inbox/Conversations/__stories__/Avatar.story",
"../src/lib/Components/Inbox/Conversations/__stories__/Composer.story",
"../src/lib/Components/Inbox/Conversations/__stories__/ConversationSnippet.story",
"../src/lib/Components/Inbox/Conversations/__stories__/Inbox.story",
"../src/lib/Components/Inbox/Conversations/__stories__/Message.story",
"../src/lib/Components/Inbox/Conversations/__stories__/ZeroStateInbox.story",
"../src/lib/Components/States/__stories__/ZeroState.story",
"../src/lib/Components/Text/__stories__/Typography.story",
"../src/lib/Components/__stories__/DottedLine.story",
"../src/lib/Components/__stories__/Markdown.story",
"../src/lib/Components/__stories__/Modal.story",
"../src/lib/Components/__stories__/TabBar.story",
"../src/lib/Components/__stories__/Video.story",
"../src/lib/Containers/__stories__/Artist.story",
"../src/lib/Containers/__stories__/Gene.story",
"../src/lib/Containers/__stories__/Inquiry.story",
"../src/lib/Containers/__stories__/Sale.story",
"../src/lib/Scenes/Fair/__stories__/Fair.story",
"../src/lib/Scenes/Favorites/__stories__/Favorites.story",
"../src/lib/Scenes/Home/Components/Sales/Components/__stories__/LotsByFollowedArtists.story",
"../src/lib/Scenes/Home/__stories__/Home.story",
"../src/lib/Scenes/Map/__stories__/Map.story",
"../src/lib/Scenes/Settings/__stories__/Settings.story",
"../src/lib/Scenes/Show/__stories__/Show.story",
]
'../src/lib/Components/Artist/__stories__/ArtistArticles.story',
'../src/lib/Components/Artist/__stories__/ArtistHeader.story',
'../src/lib/Components/Bidding/Components/__stories__/Checkbox.story',
'../src/lib/Components/Bidding/Components/__stories__/Input.story',
'../src/lib/Components/Bidding/Components/__stories__/Timer.story',
'../src/lib/Components/Bidding/Screens/__stories__/BidResult.story',
'../src/lib/Components/Bidding/Screens/__stories__/RegistrationResult.story',
'../src/lib/Components/Bidding/__stories__/BidFlow.story',
'../src/lib/Components/Buttons/__stories__/Buttons.story',
'../src/lib/Components/Consignments/__stories__/BottomAligned.story',
'../src/lib/Components/Consignments/__stories__/Consignments.story',
'../src/lib/Components/Consignments/__stories__/ImageSelection.story',
'../src/lib/Components/Consignments/__stories__/Search.story',
'../src/lib/Components/Consignments/__stories__/Style.story',
'../src/lib/Components/Consignments/__stories__/Todo.story',
'../src/lib/Components/Inbox/ActiveBids/__stories__/ActiveBids.story',
'../src/lib/Components/Inbox/Conversations/Preview/__stories__/InvoicePreview.story',
'../src/lib/Components/Inbox/Conversations/__stories__/ArtworkPreview.story',
'../src/lib/Components/Inbox/Conversations/__stories__/Avatar.story',
'../src/lib/Components/Inbox/Conversations/__stories__/Composer.story',
'../src/lib/Components/Inbox/Conversations/__stories__/ConversationSnippet.story',
'../src/lib/Components/Inbox/Conversations/__stories__/Inbox.story',
'../src/lib/Components/Inbox/Conversations/__stories__/Message.story',
'../src/lib/Components/Inbox/Conversations/__stories__/ZeroStateInbox.story',
'../src/lib/Components/States/__stories__/ZeroState.story',
'../src/lib/Components/Text/__stories__/Typography.story',
'../src/lib/Components/__stories__/DottedLine.story',
'../src/lib/Components/__stories__/Markdown.story',
'../src/lib/Components/__stories__/Modal.story',
'../src/lib/Components/__stories__/TabBar.story',
'../src/lib/Components/__stories__/Video.story',
'../src/lib/Containers/__stories__/Artist.story',
'../src/lib/Containers/__stories__/Gene.story',
'../src/lib/Containers/__stories__/Inquiry.story',
'../src/lib/Containers/__stories__/Sale.story',
'../src/lib/Scenes/Fair/__stories__/Fair.story',
'../src/lib/Scenes/Favorites/__stories__/Favorites.story',
'../src/lib/Scenes/Home/Components/Sales/Components/__stories__/LotsByFollowedArtists.story',
'../src/lib/Scenes/Home/__stories__/Home.story',
'../src/lib/Scenes/Map/__stories__/Map.story',
'../src/lib/Scenes/Settings/__stories__/Settings.story',
'../src/lib/Scenes/Show/__stories__/Show.story',

];

module.exports = {
loadStories,
stories,
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing these changes locally to, let's commit them here 👍