Skip to content
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

On mobile devices, only show tab icons in the settings panel #188

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions frontend/App/SettingsPanel/SettingsPanel.style.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled, { css } from 'styled-components';

import { stateColor, stateDarkColor, textColor } from '/frontend/style/colors';
import { fromSize } from '/frontend/style/size';

export const Overlay = styled.div`
position: fixed;
Expand Down Expand Up @@ -59,11 +60,15 @@ export const Tabs = styled.div`
background: ${stateColor.success};
`;

type TabProps = {
active: boolean;
};
export const TabText = styled.span`
display: none;

export const Tab = styled.button<TabProps>`
${fromSize.medium(css`
display: inline;
`)}
`;

export const Tab = styled.button<{ active: boolean }>`
padding: 0.8rem 1rem;

${(props) =>
Expand Down
4 changes: 2 additions & 2 deletions frontend/App/SettingsPanel/SettingsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactElement, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { Close, Frame, Overlay, Tab, Tabs, Title, TitleBar } from './SettingsPanel.style';
import { Close, Frame, Overlay, Tab, Tabs, TabText, Title, TitleBar } from './SettingsPanel.style';

import Icon from '/frontend/components/Icon';
import { closeSettingsPanel } from '/frontend/store/settings/actions';
Expand Down Expand Up @@ -70,7 +70,7 @@ const SettingsPanel = (): ReactElement => {
<Tabs>
{tabs.map((tab) => (
<Tab active={tab.icon === activeTab} key={tab.icon} onClick={() => setActiveTab(tab.icon)}>
<Icon icon={tab.icon} /> {tab.name}
<Icon icon={tab.icon} /> <TabText>{tab.name}</TabText>
</Tab>
))}
</Tabs>
Expand Down