Skip to content

Commit

Permalink
fix: remove excessive whitespace between md sections on small screens
Browse files Browse the repository at this point in the history
fixes #874
  • Loading branch information
RomanHotsiy committed Sep 30, 2019
1 parent faa74d6 commit e318fb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/common-elements/panels.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { SECTION_ATTR } from '../services/MenuStore';
import styled, { media } from '../styled-components';

export const MiddlePanel = styled.div`
export const MiddlePanel = styled.div<{ compact?: boolean }>`
width: calc(100% - ${props => props.theme.rightPanel.width});
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
${media.lessThan('medium', true)`
${({ compact, theme }) =>
media.lessThan('medium', true)`
width: 100%;
padding: ${props =>
`${props.theme.spacing.sectionVertical}px ${props.theme.spacing.sectionHorizontal}px`};
padding: ${`${compact ? 0 : theme.spacing.sectionVertical}px ${
theme.spacing.sectionHorizontal
}px`};
`};
`;

Expand Down
4 changes: 2 additions & 2 deletions src/components/ContentItems/ContentItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ContentItem extends React.Component<ContentItemProps> {
}
}

const middlePanelWrap = component => <MiddlePanel>{component}</MiddlePanel>;
const middlePanelWrap = component => <MiddlePanel compact={true}>{component}</MiddlePanel>;

@observer
export class SectionItem extends React.Component<ContentItemProps> {
Expand All @@ -71,7 +71,7 @@ export class SectionItem extends React.Component<ContentItemProps> {
return (
<>
<Row>
<MiddlePanel>
<MiddlePanel compact={level !== 1}>
<Header>
<ShareLink to={this.props.item.id} />
{name}
Expand Down

0 comments on commit e318fb3

Please sign in to comment.