Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiText,
useIsWithinBreakpoints,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
Expand All @@ -34,8 +35,10 @@ export function ServiceGroupsCard({
href,
servicesCount,
}: Props) {
const isMobile = useIsWithinBreakpoints(['xs', 's']);

const cardProps: EuiCardProps = {
style: { width: 286 },
style: { width: isMobile ? '100%' : 286 },
icon: (
<EuiAvatar
name={serviceGroup.groupName}
Expand Down Expand Up @@ -80,8 +83,12 @@ export function ServiceGroupsCard({
};

return (
<EuiFlexItem key={serviceGroup.groupName}>
<EuiCard layout="vertical" {...cardProps} />
<EuiFlexItem key={serviceGroup.groupName} grow={false}>
<EuiCard
layout="vertical"
{...cardProps}
data-test-subj="serviceGroupCard"
/>
</EuiFlexItem>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { EuiFlexGrid } from '@elastic/eui';
import { EuiFlexGroup } from '@elastic/eui';
import React from 'react';
import { SavedServiceGroup } from '../../../../../common/service_groups';
import { ServiceGroupsCard } from './service_group_card';
import { useApmRouter } from '../../../../hooks/use_apm_router';
import { useApmParams } from '../../../../hooks/use_apm_params';
import { useApmRouter } from '../../../../hooks/use_apm_router';
import { useDefaultEnvironment } from '../../../../hooks/use_default_environment';
import { ServiceGroupsCard } from './service_group_card';

interface Props {
items: SavedServiceGroup[];
Expand All @@ -25,7 +25,7 @@ export function ServiceGroupsListItems({ items, servicesCounts }: Props) {
const environment = useDefaultEnvironment();

return (
<EuiFlexGrid gutterSize="m">
<EuiFlexGroup gutterSize="m" wrap>
{items.map((item) => (
<ServiceGroupsCard
serviceGroup={item}
Expand All @@ -40,6 +40,6 @@ export function ServiceGroupsListItems({ items, servicesCounts }: Props) {
})}
/>
))}
</EuiFlexGrid>
</EuiFlexGroup>
);
}