Skip to content

Commit

Permalink
Header padding component for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijaprzeski committed Feb 22, 2021
1 parent 6d28480 commit 2b792a8
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/components/HeaderGap/index.desktop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React, {PureComponent} from 'react';
import {View} from 'react-native';

export default class HeaderGap extends PureComponent {
render() {
return (<View style={{height: 12}} />);
}
}
7 changes: 7 additions & 0 deletions src/components/HeaderGap/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {PureComponent} from 'react';

export default class HeaderGap extends PureComponent {
render() {
return null;
}
}
2 changes: 2 additions & 0 deletions src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {hide as hideSidebar} from '../libs/actions/Sidebar';
import CONST from '../CONST';
import HeaderWithCloseButton from '../components/HeaderWithCloseButton';
import {redirectToLastReport} from '../libs/actions/App';
import HeaderGap from '../components/HeaderGap';

const personalDetailsPropTypes = PropTypes.shape({
// The login of the person (either email or phone number)
Expand Down Expand Up @@ -134,6 +135,7 @@ class NewChatPage extends Component {

return (
<>
<HeaderGap />
<HeaderWithCloseButton
title="New Chat"
onCloseButtonPress={redirectToLastReport}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/NewGroupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {hide as hideSidebar} from '../libs/actions/Sidebar';
import withWindowDimensions, {windowDimensionsPropTypes} from '../components/withWindowDimensions';
import HeaderWithCloseButton from '../components/HeaderWithCloseButton';
import {redirectToLastReport} from '../libs/actions/App';
import HeaderGap from '../components/HeaderGap';

const personalDetailsPropTypes = PropTypes.shape({
// The login of the person (either email or phone number)
Expand Down Expand Up @@ -207,6 +208,7 @@ class NewGroupPage extends Component {
const {headerTitle, headerMessage} = this.getHeaderTitleAndMessage(maxParticipantsReached);
return (
<>
<HeaderGap />
<HeaderWithCloseButton
title="New Group"
onCloseButtonPress={redirectToLastReport}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {hide as hideSidebar} from '../libs/actions/Sidebar';
import withWindowDimensions, {windowDimensionsPropTypes} from '../components/withWindowDimensions';
import {fetchOrCreateChatReport} from '../libs/actions/Report';
import HeaderWithCloseButton from '../components/HeaderWithCloseButton';
import HeaderGap from '../components/HeaderGap';

const personalDetailsPropTypes = PropTypes.shape({
// The login of the person (either email or phone number)
Expand Down Expand Up @@ -119,6 +120,7 @@ class SearchPage extends Component {

return (
<>
<HeaderGap />
<HeaderWithCloseButton
title="Search"
onCloseButtonPress={redirectToLastReport}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {version} from '../../package.json';
import AvatarWithIndicator from '../components/AvatarWithIndicator';
import HeaderWithCloseButton from '../components/HeaderWithCloseButton';
import {redirectToLastReport} from '../libs/actions/App';
import HeaderGap from '../components/HeaderGap';

const propTypes = {
/* Onyx Props */
Expand Down Expand Up @@ -56,6 +57,7 @@ const SettingsPage = ({
}
return (
<>
<HeaderGap />
<HeaderWithCloseButton
title="Settings"
onCloseButtonPress={redirectToLastReport}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import compose from '../../libs/compose';
import ReportView from './report/ReportView';
import ScreenWrapper from '../../components/ScreenWrapper';
import HeaderView from './HeaderView';
import HeaderGap from '../../components/HeaderGap';

const propTypes = {
/* Onyx Props */
Expand Down Expand Up @@ -97,6 +98,7 @@ class ReportScreen extends Component {
>
{() => (
<>
<HeaderGap />
<HeaderView
shouldShowNavigationMenuButton={this.props.isSmallScreenWidth}
onNavigationMenuButtonClicked={this.props.toggleNavigationMenu}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import AvatarWithIndicator from '../../../components/AvatarWithIndicator';
import {getSidebarOptions} from '../../../libs/OptionsListUtils';
import {getDefaultAvatar} from '../../../libs/actions/PersonalDetails';
import KeyboardSpacer from '../../../components/KeyboardSpacer';
import HeaderGap from '../../../components/HeaderGap';

const propTypes = {
// Toggles the navigation menu open and closed
Expand Down Expand Up @@ -100,6 +101,7 @@ class SidebarLinks extends React.Component {

return (
<View style={[styles.flex1, styles.h100]}>
<HeaderGap />
<View
style={[
styles.flexRow,
Expand Down
1 change: 0 additions & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#root > div > div {
height: 100% !important;
}

#drag-area {
-webkit-app-region: drag;
}
Expand Down

0 comments on commit 2b792a8

Please sign in to comment.