Skip to content

Commit 2e07990

Browse files
committed
👌 refactor <Footer />
1 parent dd15f80 commit 2e07990

File tree

2 files changed

+10
-31
lines changed

2 files changed

+10
-31
lines changed

client/components/mobile/Footer.jsx

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,15 @@
11
import React from 'react';
22
import styled from 'styled-components';
3-
import PropTypes from 'prop-types';
4-
import { prop, remSize } from '../../theme';
3+
import { prop } from '../../theme';
54

65

76
const background = prop('MobilePanel.default.background');
87
const textColor = prop('primaryTextColor');
98

10-
const FooterWrapper = styled.div`
9+
export default styled.div`
1110
position: fixed;
1211
width: 100%;
1312
bottom: 0;
14-
`;
15-
16-
const FooterContent = styled.div`
1713
background: ${background};
1814
color: ${textColor};
19-
padding: ${remSize(12)};
20-
padding-left: ${remSize(32)};
2115
`;
22-
23-
const Footer = ({ before, children }) => (
24-
<FooterWrapper>
25-
{before}
26-
<FooterContent>
27-
{children}
28-
</FooterContent>
29-
</FooterWrapper>
30-
);
31-
32-
Footer.propTypes = {
33-
before: PropTypes.element,
34-
children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
35-
};
36-
37-
Footer.defaultProps = {
38-
before: <></>,
39-
children: <></>
40-
};
41-
42-
export default Footer;

client/modules/IDE/pages/MobileIDEView.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ import { remSize } from '../../../theme';
3131

3232
const isUserOwner = ({ project, user }) => (project.owner && project.owner.id === user.id);
3333

34+
const BottomBarContent = styled.h2`
35+
padding: ${remSize(12)};
36+
padding-left: ${remSize(32)};
37+
`;
38+
3439
const MobileIDEView = (props) => {
3540
const {
3641
preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage,
@@ -97,8 +102,9 @@ const MobileIDEView = (props) => {
97102
provideController={setTmController}
98103
/>
99104
</IDEWrapper>
100-
<Footer before={<Console />} >
101-
<h2>Bottom Bar</h2>
105+
<Footer>
106+
<Console />
107+
<BottomBarContent>Bottom Bar</BottomBarContent>
102108
</Footer>
103109
</Screen>
104110
);

0 commit comments

Comments
 (0)