mobile responsiveness
This commit is contained in:
@@ -76,7 +76,7 @@ export default function EditorControls({ code, setCode, language, setLanguage, t
|
|||||||
<Button onClick={() => zoom(1)}>[+ </Button>
|
<Button onClick={() => zoom(1)}>[+ </Button>
|
||||||
<Button onClick={() => zoom(-1)}> -]</Button>
|
<Button onClick={() => zoom(-1)}> -]</Button>
|
||||||
<MenuButton label="theme" value={theme} setValue={setTheme} ids={Object.keys(themes)} />
|
<MenuButton label="theme" value={theme} setValue={setTheme} ids={Object.keys(themes)} />
|
||||||
<Button as="a" href="https://github.com/lucko/paste" target="_blank" rel="noreferrer">[about]</Button>
|
<Button className="optional" as="a" href="https://github.com/lucko/paste" target="_blank" rel="noreferrer">[about]</Button>
|
||||||
</Section>
|
</Section>
|
||||||
</Header>
|
</Header>
|
||||||
)
|
)
|
||||||
@@ -97,6 +97,12 @@ const Header = styled.header`
|
|||||||
const Section = styled.div`
|
const Section = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
@media (max-width: 470px) {
|
||||||
|
.optional {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function langaugeToContentType(language) {
|
function langaugeToContentType(language) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default function EditorTextArea({ code, setCode, language, fontSize }) {
|
|||||||
value={code}
|
value={code}
|
||||||
onValueChange={setCode}
|
onValueChange={setCode}
|
||||||
highlight={highlightWithLineNumbers}
|
highlight={highlightWithLineNumbers}
|
||||||
placeholder={'Type some code...'}
|
placeholder={'Paste (or type) some code...'}
|
||||||
padding={10}
|
padding={10}
|
||||||
size={fontSize}
|
size={fontSize}
|
||||||
textareaId='code-area'
|
textareaId='code-area'
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ export const Button = styled.div`
|
|||||||
:hover {
|
:hover {
|
||||||
background: ${props => props.theme.highlight};
|
background: ${props => props.theme.highlight};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Menu = styled.ul`
|
const Menu = styled.ul`
|
||||||
@@ -57,7 +63,7 @@ export const MenuButton = ({ label, ids, value, setValue }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Button onClick={toggleOpen}>
|
<Button onClick={toggleOpen}>
|
||||||
[{label}: {value}]
|
[<span>{label}: </span>{value}]
|
||||||
{open && (
|
{open && (
|
||||||
<Menu>
|
<Menu>
|
||||||
{ids.map(id => <li key={id} onClick={e => select(e, id)}>{id}</li>)}
|
{ids.map(id => <li key={id} onClick={e => select(e, id)}>{id}</li>)}
|
||||||
|
|||||||
Reference in New Issue
Block a user