mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-16 02:22:12 +03:00
parent
c56af887dd
commit
c272cdfff8
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user