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