landscape: sets ModalButton label to nowrap

Fixes urbit/landscape#435
This commit is contained in:
James Acklin 2021-02-15 16:00:22 -05:00
parent c56af887dd
commit c272cdfff8

View File

@ -1,38 +1,33 @@
import React from "react" import React from 'react';
import { Box, Button, Icon, Text } from "@tlon/indigo-react" import { Box, Button, Icon, Text } from '@tlon/indigo-react';
import {useModal} from "~/logic/lib/useModal"; import { useModal } from '~/logic/lib/useModal';
const ModalButton = (props) => { const ModalButton = (props) => {
const { const { children, icon, text, bg, color, ...rest } = props;
children,
icon,
text,
bg,
color,
...rest
} = props;
const { modal, showModal } = useModal({ modal: props.children }); const { modal, showModal } = useModal({ modal: props.children });
return ( return (
<> <>
{modal} {modal}
<Button <Button
onClick={showModal} onClick={showModal}
display="flex" display='flex'
alignItems="center" alignItems='center'
cursor="pointer" cursor='pointer'
bg={bg} bg={bg}
p={2} p={2}
borderRadius={2} borderRadius={2}
boxShadow="0 0 0px 1px inset" boxShadow='0 0 0px 1px inset'
color="scales.black20" color='scales.black20'
{...rest} {...rest}
> >
<Icon icon={props.icon} mr={2} color={color}></Icon><Text color={color}>{props.text}</Text> <Icon icon={props.icon} mr={2} color={color}></Icon>
<Text color={color} className='nowrap'>
{props.text}
</Text>
</Button> </Button>
</> </>
); );
} };
export default ModalButton; export default ModalButton;