Skip to content

Commit

Permalink
feat(events-v2) Add responsive views for events modal
Browse files Browse the repository at this point in the history
Adjust layout at our breakpoints so that the modal is readable in each
layout mode.

Refs SEN-729
  • Loading branch information
markstory committed Jun 11, 2019
1 parent dc4fbea commit 20d689d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import AsyncComponent from 'app/components/asyncComponent';
import InlineSvg from 'app/components/inlineSvg';
import withApi from 'app/utils/withApi';
import space from 'app/styles/space';
import theme from 'app/utils/theme';

import EventModalContent from './eventModalContent';
import {getQuery} from './utils';
Expand Down Expand Up @@ -148,6 +149,10 @@ const ModalContainer = styled('div')`
box-shadow: ${p => p.theme.dropShadowHeavy};
z-index: ${p => p.theme.zIndex.modal};
@media (max-width: ${theme.breakpoints[1]}) {
margin: ${space(2)};
}
`;

const CircleButton = styled('button')`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import React from 'react';
import styled from 'react-emotion';

import {INTERFACES} from 'app/components/events/eventEntries';
import {getMessage, getTitle} from 'app/utils/events';
import {objectIsEmpty, toTitleCase} from 'app/utils';
import {t} from 'app/locale';
import DateTime from 'app/components/dateTime';
import ErrorBoundary from 'app/components/errorBoundary';
Expand All @@ -16,8 +14,12 @@ import ExternalLink from 'app/components/links/externalLink';
import FileSize from 'app/components/fileSize';
import NavTabs from 'app/components/navTabs';
import SentryTypes from 'app/sentryTypes';
import getDynamicText from 'app/utils/getDynamicText';
import overflowEllipsis from 'app/styles/overflowEllipsis';
import space from 'app/styles/space';
import {objectIsEmpty, toTitleCase} from 'app/utils';
import {getMessage, getTitle} from 'app/utils/events';
import getDynamicText from 'app/utils/getDynamicText';
import theme from 'app/utils/theme';

import LinkedIssuePreview from './linkedIssuePreview';
import ModalPagination from './modalPagination';
Expand Down Expand Up @@ -172,7 +174,7 @@ const EventHeader = props => {
const {title} = getTitle(props.event);
return (
<div>
<h2>{title}</h2>
<OverflowHeader>{title}</OverflowHeader>
<p>{getMessage(props.event)}</p>
</div>
);
Expand Down Expand Up @@ -206,6 +208,10 @@ EventMetadata.propTypes = {
eventJsonUrl: PropTypes.string.isRequired,
};

const OverflowHeader = styled('h2')`
${overflowEllipsis}
`;

const MetadataContainer = styled('div')`
display: flex;
justify-content: space-between;
Expand All @@ -219,6 +225,15 @@ const ColumnGrid = styled('div')`
grid-template-columns: 70% 28%;
grid-template-rows: auto;
grid-column-gap: 2%;
@media (max-width: ${theme.breakpoints[1]}) {
grid-template-columns: 60% 38%;
}
@media (max-width: ${theme.breakpoints[0]}) {
display: flex;
flex-direction: column;
}
`;

const HeaderBox = styled('div')`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Link from 'app/components/links/link';
import SentryTypes from 'app/sentryTypes';
import InlineSvg from 'app/components/inlineSvg';
import space from 'app/styles/space';
import theme from 'app/utils/theme';

const ModalPagination = props => {
const {location, event} = props;
Expand Down Expand Up @@ -75,13 +76,22 @@ ModalPagination.propTypes = {
const StyledLink = styled(Link, {shouldForwardProp: isPropValid})`
color: ${p => (p.disabled ? p.theme.disabled : p.theme.gray3)};
font-size: ${p => p.fontSizeMedium};
text-align: center;
padding: ${space(0.5)} ${space(1.5)};
${p => (p.isLast ? '' : `border-right: 1px solid ${p.theme.borderDark};`)}
${p => (p.disabled ? 'pointer-events: none;' : '')}
@media(max-width: ${theme.breakpoints[0]}) {
flex-grow: 1;
}
`;

const Wrapper = styled('div')`
display: flex;
@media (max-width: ${theme.breakpoints[0]}) {
width: 100%;
}
`;

const ShadowBox = styled('div')`
Expand All @@ -92,6 +102,10 @@ const ShadowBox = styled('div')`
margin-bottom: ${space(3)};
box-shadow: 3px 3px 0 ${p => p.theme.offWhite}, 3px 3px 0 1px ${p => p.theme.borderDark},
7px 7px ${p => p.theme.offWhite}, 7px 7px 0 1px ${p => p.theme.borderDark};
@media (max-width: ${theme.breakpoints[0]}) {
width: 100%;
}
`;

export default ModalPagination;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const TagsTable = props => {
return (
<div>
<TagHeading>{t('Tags')}</TagHeading>
<table>
<StyledTable>
<tbody>
{props.tags.map(tag => (
<StyledTr key={tag.key}>
Expand All @@ -25,7 +25,7 @@ const TagsTable = props => {
</StyledTr>
))}
</tbody>
</table>
</StyledTable>
</div>
);
};
Expand Down Expand Up @@ -57,4 +57,8 @@ const TagValue = styled(TagKey)`
text-align: right;
`;

const StyledTable = styled('table')`
width: 100%;
`;

export default withRouter(TagsTable);

0 comments on commit 20d689d

Please sign in to comment.