Skip to content

Commit

Permalink
Add a tooltip to the IbcDepositToggle
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed Aug 13, 2024
1 parent 1126642 commit 848012e
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions packages/ui/src/AccountSelector/IbcDepositToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
import styled from 'styled-components';
import { Toggle } from '../Toggle';
import { Text } from '../Text';
import { Tooltip } from '../Tooltip';
import { Icon } from '../Icon';
import { Info } from 'lucide-react';

const Root = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
`;

const Row = styled.div`
display: flex;
align-items: center;
gap: ${props => props.theme.spacing(2)};
`;

export interface IbcDepositToggleProps {
value: boolean;
onChange: (value: boolean) => void;
}

export const IbcDepositToggle = ({ value, onChange }: IbcDepositToggleProps) => {
return (
<Root>
<Text detail>IBC Deposit</Text>
<Toggle value={value} onChange={onChange} label='IBC Deposit' />
</Root>
);
};
export const IbcDepositToggle = ({ value, onChange }: IbcDepositToggleProps) => (
<Root>
<Tooltip message='IBC transfers into Penumbra post the destination address in public on the source chain. Use this randomized IBC deposit address to preserve privacy when transferring funds into Penumbra.'>
<Row>
<Text detail>IBC Deposit</Text>
<Icon IconComponent={Info} size='sm' />
</Row>
</Tooltip>

<Toggle value={value} onChange={onChange} label='IBC Deposit' />
</Root>
);

0 comments on commit 848012e

Please sign in to comment.