Skip to content

Commit d56d472

Browse files
SaraVieiraCompuIves
authored andcommitted
fix modal on mobile (codesandbox#1375)
1 parent f60893d commit d56d472

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

packages/app/src/app/pages/Curator/SandboxCard/index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// @ts-check
22
/* eslint-disable react/prefer-stateless-function */
33
import React from 'react';
4-
import history from 'app/utils/history';
54
import { sandboxUrl, profileUrl } from 'common/utils/url-generator';
65

76
import { observer } from 'mobx-react';
@@ -64,16 +63,9 @@ class SandboxItem extends React.Component<Props> {
6463
}
6564
}
6665

67-
openSandbox = (openNewWindow = false) => {
68-
// Git sandboxes aren't shown here anyway
66+
openSandbox = () => {
6967
const url = sandboxUrl({ id: this.props.id });
70-
if (openNewWindow === true) {
71-
window.open(url, '_blank');
72-
} else {
73-
history.push(url);
74-
}
75-
76-
return true;
68+
window.open(url, '_blank');
7769
};
7870

7971
openUser = username => {

packages/homepage/src/screens/explore/Modal/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const Content = styled.div`
3030
width: 1000px;
3131
margin-top: 5%;
3232
z-index: 20;
33+
max-width: 90%;
3334
`;
3435

3536
export default class Modal extends React.PureComponent {

packages/homepage/src/screens/explore/_SandboxModal.elements.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,20 @@ export const StyledRightArrow = styled(RightArrow)`
3232
position: absolute;
3333
right: -54px;
3434
${ArrowStyles};
35+
36+
@media screen and (max-width: 800px) {
37+
right: -40px;
38+
}
3539
`;
3640

3741
export const StyledLeftArrow = styled(LeftArrow)`
3842
position: absolute;
3943
left: -54px;
4044
${ArrowStyles};
45+
46+
@media screen and (max-width: 800px) {
47+
left: -40px;
48+
}
4149
`;
4250

4351
export const SandboxInfoContianer = styled.div`

0 commit comments

Comments
 (0)