Skip to content

fix(ui) Make the close button and margins more like the mockup #13509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2019
Merged
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 @@ -4,7 +4,7 @@ import {browserHistory} from 'react-router';
import PropTypes from 'prop-types';

import AsyncComponent from 'app/components/asyncComponent';
import Button from 'app/components/button';
import InlineSvg from 'app/components/inlineSvg';
import withApi from 'app/utils/withApi';
import space from 'app/styles/space';

Expand Down Expand Up @@ -39,7 +39,7 @@ class EventDetails extends AsyncComponent {
const [projectId, _] = this.props.eventSlug.split(':');
return (
<ModalContainer>
<CloseButton onClick={this.handleClose} size="zero" icon="icon-close" />
<CloseButton onClick={this.handleClose} size={30} />
<EventModalContent
onTabChange={this.handleTabChange}
event={this.state.event}
Expand All @@ -58,7 +58,7 @@ const ModalContainer = styled('div')`
right: 0px;
background: #fff;

margin: ${space(2)};
margin: ${space(3)};
padding: ${space(3)};
border: 1px solid ${p => p.theme.borderLight};
border-radius: ${p => p.theme.borderRadius};
Expand All @@ -67,13 +67,31 @@ const ModalContainer = styled('div')`
z-index: ${p => p.theme.zIndex.modal};
`;

const CloseButton = styled(Button)`
position: absolute;
top: -10px;
right: -10px;
padding: 10px;
border-radius: 20px;
const CircleButton = styled('button')`
background: #fff;
border-radius: ${p => p.size / 2}px;
padding: ${p => p.size / 4}px;
line-height: ${p => p.size * 0.4}px;
height: ${p => p.size}px;
box-shadow: ${p => p.theme.dropShadowLight};
border: 1px solid ${p => p.theme.borderDark};

position: absolute;
top: -${p => p.size / 2}px;
right: -${p => p.size / 2}px;
`;

const CloseButton = props => {
const iconSize = props.size * 0.4;
return (
<CircleButton size={props.size} onClick={props.onClick}>
<InlineSvg src="icon-close" size={`${iconSize}px`} />
</CircleButton>
);
};
CloseButton.propTypes = {
onClick: PropTypes.func,
size: PropTypes.number.isRequired,
};

export default withApi(EventDetails);