Skip to content
Snippets Groups Projects
Unverified Commit f16bf7b0 authored by Ariya Hidayat's avatar Ariya Hidayat Committed by GitHub
Browse files

GridItem should not use prop shorthand (#17610)

parent 1b75128f
No related branches found
No related tags found
No related merge requests found
...@@ -66,8 +66,8 @@ function BulkActions(props) { ...@@ -66,8 +66,8 @@ function BulkActions(props) {
to the main content above to ensure the bulk checkbox lines up */} to the main content above to ensure the bulk checkbox lines up */}
<Box px={[2, 4]} py={1}> <Box px={[2, 4]} py={1}>
<Grid> <Grid>
<GridItem w={[1, 1 / 3]} /> <GridItem width={[1, 1 / 3]} />
<GridItem w={[1, 2 / 3]} px={[1, 2]}> <GridItem width={[1, 2 / 3]} px={[1, 2]}>
<Flex align="center" justify="center" px={2}> <Flex align="center" justify="center" px={2}>
<SelectionControls {...props} /> <SelectionControls {...props} />
<BulkActionControls <BulkActionControls
......
...@@ -33,7 +33,7 @@ function CollectionList({ ...@@ -33,7 +33,7 @@ function CollectionList({
{collections {collections
.filter(c => c.id !== currentUser.personal_collection_id) .filter(c => c.id !== currentUser.personal_collection_id)
.map(collection => ( .map(collection => (
<GridItem w={w} key={collection.id}> <GridItem width={w} key={collection.id}>
<CollectionItem <CollectionItem
collection={collection} collection={collection}
event={`${analyticsContext};Collection List;Collection click`} event={`${analyticsContext};Collection List;Collection click`}
......
...@@ -139,7 +139,7 @@ export const ExploreList = ({ ...@@ -139,7 +139,7 @@ export const ExploreList = ({
<Grid> <Grid>
{candidates && {candidates &&
candidates.map((option, index) => ( candidates.map((option, index) => (
<GridItem w={gridColumns} key={index}> <GridItem width={gridColumns} key={index}>
{asCards ? ( {asCards ? (
<Card hoverable p={2}> <Card hoverable p={2}>
<ExploreOption option={option} /> <ExploreOption option={option} />
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
import React from "react"; import React from "react";
import { Box, Flex } from "grid-styled"; import { Box, Flex } from "grid-styled";
export const GridItem = ({ children, w, px, py, ...props }) => ( export const GridItem = ({ children, width, px, py, ...props }) => (
<Box px={px} py={py} {...props} width={w}> <Box px={px} py={py} {...props} width={width}>
{children} {children}
</Box> </Box>
); );
GridItem.defaultProps = { GridItem.defaultProps = {
w: 1 / 4, width: 1 / 4,
px: 1, px: 1,
py: 1, py: 1,
}; };
......
...@@ -164,7 +164,7 @@ class Overworld extends React.Component { ...@@ -164,7 +164,7 @@ class Overworld extends React.Component {
{items.map(pin => { {items.map(pin => {
return ( return (
<GridItem <GridItem
w={[1, 1 / 2, 1 / 3]} width={[1, 1 / 2, 1 / 3]}
key={`${pin.model}-${pin.id}`} key={`${pin.model}-${pin.id}`}
> >
<Link <Link
...@@ -288,7 +288,7 @@ class Overworld extends React.Component { ...@@ -288,7 +288,7 @@ class Overworld extends React.Component {
<Box mb={4}> <Box mb={4}>
<Grid> <Grid>
{databases.map(database => ( {databases.map(database => (
<GridItem w={[1, 1 / 3]} key={database.id}> <GridItem width={[1, 1 / 3]} key={database.id}>
<Link <Link
to={Urls.browseDatabase(database)} to={Urls.browseDatabase(database)}
hover={{ color: color("brand") }} hover={{ color: color("brand") }}
......
...@@ -44,7 +44,7 @@ const UserCollectionList = ({ collectionsById }) => ( ...@@ -44,7 +44,7 @@ const UserCollectionList = ({ collectionsById }) => (
list.map( list.map(
user => user =>
user.personal_collection_id && ( user.personal_collection_id && (
<GridItem w={1 / 3} key={user.personal_collection_id}> <GridItem width={1 / 3} key={user.personal_collection_id}>
<Link <Link
to={Urls.collection( to={Urls.collection(
collectionsById[user.personal_collection_id], collectionsById[user.personal_collection_id],
......
...@@ -83,7 +83,7 @@ export default class NewQueryOptions extends Component { ...@@ -83,7 +83,7 @@ export default class NewQueryOptions extends Component {
<Box my="auto" mx={PAGE_PADDING}> <Box my="auto" mx={PAGE_PADDING}>
<Grid className="justifyCenter"> <Grid className="justifyCenter">
{hasDataAccess && ( {hasDataAccess && (
<GridItem w={ITEM_WIDTHS}> <GridItem width={ITEM_WIDTHS}>
<NewQueryOption <NewQueryOption
image="app/img/simple_mode_illustration" image="app/img/simple_mode_illustration"
title={t`Simple question`} title={t`Simple question`}
...@@ -95,7 +95,7 @@ export default class NewQueryOptions extends Component { ...@@ -95,7 +95,7 @@ export default class NewQueryOptions extends Component {
</GridItem> </GridItem>
)} )}
{hasDataAccess && ( {hasDataAccess && (
<GridItem w={ITEM_WIDTHS}> <GridItem width={ITEM_WIDTHS}>
<NewQueryOption <NewQueryOption
image="app/img/notebook_mode_illustration" image="app/img/notebook_mode_illustration"
title={t`Custom question`} title={t`Custom question`}
...@@ -107,7 +107,7 @@ export default class NewQueryOptions extends Component { ...@@ -107,7 +107,7 @@ export default class NewQueryOptions extends Component {
</GridItem> </GridItem>
)} )}
{hasNativeWrite && ( {hasNativeWrite && (
<GridItem w={ITEM_WIDTHS}> <GridItem width={ITEM_WIDTHS}>
<NewQueryOption <NewQueryOption
image="app/img/sql_illustration" image="app/img/sql_illustration"
title={t`Native query`} title={t`Native query`}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment