Skip to content

Commit 3b25ef4

Browse files
committed
test(discover2): Test fix on Percy snapshots
1 parent 61c29e1 commit 3b25ef4

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

src/sentry/static/sentry/app/views/eventsV2/results.tsx

+20-25
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class Results extends React.Component<Props, State> {
141141
location={location}
142142
eventView={eventView}
143143
/>
144-
<ContentBox>
144+
<StyledPageContent>
145145
<Top>
146146
<StyledSearchBar
147147
organization={organization}
@@ -176,19 +176,36 @@ class Results extends React.Component<Props, State> {
176176
/>
177177
</Main>
178178
<Side eventView={eventView}>{this.renderTagsTable()}</Side>
179-
</ContentBox>
179+
</StyledPageContent>
180180
</NoProjectMessage>
181181
</React.Fragment>
182182
</SentryDocumentTitle>
183183
);
184184
}
185185
}
186186

187+
const StyledPageContent = styled(PageContent)`
188+
margin: 0;
189+
190+
@media (min-width: ${p => p.theme.breakpoints[1]}) {
191+
display: grid;
192+
/* HACK(leedongwei): Hardcoded height for search bar and graph */
193+
grid-template-rows: 270px auto;
194+
grid-template-columns: 66% auto;
195+
grid-column-gap: ${space(3)};
196+
}
197+
198+
@media (min-width: ${p => p.theme.breakpoints[2]}) {
199+
grid-template-columns: auto 325px;
200+
}
201+
`;
202+
187203
const StyledSearchBar = styled(SearchBar)`
188204
margin-bottom: ${space(2)};
189205
`;
190-
191206
const StyledPanel = styled(Panel)`
207+
/* HACK(leedongwei): Hardcoded height for graph */
208+
height: 200px;
192209
margin-bottom: ${space(1.5)};
193210
194211
.echarts-for-react div:first-child {
@@ -200,38 +217,16 @@ const Top = styled('div')`
200217
grid-column: 1/3;
201218
flex-grow: 0;
202219
`;
203-
204220
const Main = styled('div')<{eventView: EventView}>`
205221
grid-column: ${p => (p.eventView.tags.length <= 0 ? '1/3' : '1/2')};
206-
207-
/* Defining the width prevent child elements from expanding the grid
208-
past the width of the screen */
209-
width: 100%;
210222
max-width: 100%;
211223
overflow: hidden;
212224
`;
213-
214225
const Side = styled('div')<{eventView: EventView}>`
215226
display: ${p => (p.eventView.tags.length <= 0 ? 'none' : 'initial')};
216227
grid-column: 2/3;
217228
`;
218229

219-
const ContentBox = styled(PageContent)`
220-
margin: 0;
221-
222-
@media (min-width: ${p => p.theme.breakpoints[1]}) {
223-
display: grid;
224-
grid-template-rows: 270px auto; /* HACK(leedongwei): Hard-coded height for
225-
search bar and graph */
226-
grid-template-columns: 65% auto;
227-
grid-column-gap: ${space(3)};
228-
}
229-
230-
@media (min-width: ${p => p.theme.breakpoints[2]}) {
231-
grid-template-columns: auto 325px;
232-
}
233-
`;
234-
235230
export function generateDiscoverResultsRoute(orgSlug: string): string {
236231
return `/organizations/${orgSlug}/eventsv2/results/`;
237232
}

0 commit comments

Comments
 (0)