Skip to content

Commit 0baf64c

Browse files
committed
♻️ make Tab and TabSwitcher mobile components
1 parent 88c48c3 commit 0baf64c

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

client/components/mobile/Tab.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
import { Link } from 'react-router';
4+
import { prop, remSize } from '../../theme';
5+
6+
export default styled(Link)`
7+
box-sizing: border-box;
8+
9+
10+
background: transparent;
11+
/* border-top: ${remSize(4)} solid ${props => prop(props.selected ? 'colors.p5jsPink' : 'MobilePanel.default.background')}; */
12+
border-top: ${remSize(4)} solid ${props => (props.selected ? prop('colors.p5jsPink') : 'transparent')};
13+
14+
color: ${prop('primaryTextColor')};
15+
16+
padding: ${remSize(8)} ${remSize(16)};
17+
width: 30%;
18+
`;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
4+
import { prop, remSize } from '../../theme';
5+
6+
export default styled.div`
7+
display: flex;
8+
justify-content: space-between;
9+
10+
h3 { text-align: center; width: 100%; }
11+
border-top: 1px solid ${prop('Separator')};
12+
13+
background: ${props => prop('backgroundColor')};
14+
`;
15+

client/modules/Mobile/MobileDashboardView.jsx

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import styled from 'styled-components';
44
import { useSelector } from 'react-redux';
5-
import { withRouter, Link } from 'react-router';
5+
import { withRouter } from 'react-router';
66

77
import Screen from '../../components/mobile/MobileScreen';
88
import Header from '../../components/mobile/Header';
99
import IconButton from '../../components/mobile/IconButton';
1010
import { ExitIcon, MoreIcon } from '../../common/icons';
1111
import Footer from '../../components/mobile/Footer';
12-
import { prop, remSize } from '../../theme';
12+
import { remSize } from '../../theme';
1313
import SketchList from '../IDE/components/SketchList';
1414
import CollectionList from '../IDE/components/CollectionList';
1515
import AssetList from '../IDE/components/AssetList';
@@ -18,6 +18,8 @@ import { SketchSearchbar, CollectionSearchbar } from '../IDE/components/Searchba
1818
import Button from '../../common/Button';
1919
import useAsModal from '../../components/useAsModal';
2020
import Dropdown from '../../components/Dropdown';
21+
import FooterTabSwitcher from '../../components/mobile/TabSwitcher';
22+
import FooterTab from '../../components/mobile/Tab';
2123

2224
const EXAMPLE_USERNAME = 'p5';
2325

@@ -59,30 +61,6 @@ const ContentWrapper = styled(Content)`
5961
.sketches-table-container { padding-bottom: ${remSize(160)} }
6062
`;
6163

62-
const FooterTabSwitcher = styled.div`
63-
display: flex;
64-
justify-content: space-between;
65-
66-
h3 { text-align: center; width: 100%; }
67-
border-top: 1px solid ${prop('Separator')};
68-
69-
background: ${props => prop('backgroundColor')};
70-
`;
71-
72-
const FooterTab = styled(Link)`
73-
box-sizing: border-box;
74-
75-
76-
background: transparent;
77-
/* border-top: ${remSize(4)} solid ${props => prop(props.selected ? 'colors.p5jsPink' : 'MobilePanel.default.background')}; */
78-
border-top: ${remSize(4)} solid ${props => (props.selected ? prop('colors.p5jsPink') : 'transparent')};
79-
80-
color: ${prop('primaryTextColor')};
81-
82-
padding: ${remSize(8)} ${remSize(16)};
83-
width: 30%;
84-
`;
85-
8664
const Subheader = styled.div`
8765
display: flex;
8866
flex-direction: row;

0 commit comments

Comments
 (0)