Skip to content

Commit

Permalink
Fix whitespace per figma comments. Closes #47348 (#47350)
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz authored Nov 14, 2019
1 parent 1f6b520 commit 4cbd647
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import React, { Fragment, ReactNode } from 'react';
import { EuiFlexGrid, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui';
import { PackageList, PackageListItem } from '../../common/types';
import { PackageList } from '../../common/types';
import { PackageCard, BadgeProps } from './package_card';

type ListProps = {
Expand All @@ -19,24 +19,10 @@ export function PackageListGrid({ controls, title, list, showInstalledBadge }: L
const gridContent = <GridColumn list={list} showInstalledBadge={showInstalledBadge} />;

return (
<Fragment>
<EuiSpacer size="l" />
<EuiFlexGroup>
<EuiFlexItem grow={1}>{controlsContent}</EuiFlexItem>
<EuiFlexItem grow={3}>{gridContent}</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="xxl" />
</Fragment>
);
}

type GridItemProps = PackageListItem & BadgeProps;

function GridItem(item: GridItemProps) {
return (
<EuiFlexItem>
<PackageCard {...item} showInstalledBadge={item.showInstalledBadge} />
</EuiFlexItem>
<EuiFlexGroup>
<EuiFlexItem grow={1}>{controlsContent}</EuiFlexItem>
<EuiFlexItem grow={3}>{gridContent}</EuiFlexItem>
</EuiFlexGroup>
);
}

Expand Down Expand Up @@ -68,11 +54,9 @@ function GridColumn({ list, showInstalledBadge }: GridColumnProps) {
return (
<EuiFlexGrid gutterSize="l" columns={3}>
{list.map(item => (
<GridItem
key={`${item.name}-${item.version}`}
{...item}
showInstalledBadge={showInstalledBadge}
/>
<EuiFlexItem key={`${item.name}-${item.version}`}>
<PackageCard {...item} />
</EuiFlexItem>
))}
</EuiFlexGrid>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function Home() {
{state.installedPackages.length ? (
<Fragment>
<InstalledPackages list={state.installedPackages} />
<EuiHorizontalRule margin="l" />
<EuiHorizontalRule margin="xxl" />
</Fragment>
) : null}
<AvailablePackages {...state} />
Expand All @@ -54,13 +54,9 @@ export function Home() {
<Fragment>
<Header restrictWidth={maxContentWidth} onSearch={state.setSearchTerm} />
<EuiHorizontalRule margin="none" />
<EuiSpacer size="xxl" />
<FullBleedPage>
<EuiPageBody restrictWidth={maxContentWidth}>
<Fragment>
<EuiSpacer size="l" />
{body}
</Fragment>
</EuiPageBody>
<EuiPageBody restrictWidth={maxContentWidth}>{body}</EuiPageBody>
</FullBleedPage>
</Fragment>
);
Expand Down

0 comments on commit 4cbd647

Please sign in to comment.