Skip to content

Commit

Permalink
add right arrow and info icon popup component
Browse files Browse the repository at this point in the history
  • Loading branch information
prachigarg19 committed Apr 3, 2024
1 parent 8650ba5 commit d2a1463
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/temp/components/InfoIconPopup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';
import NewInfoIcon from '../icons/NewInfoIcon';
import { bindHover, bindPopover } from 'material-ui-popup-state';
import HoverPopover from 'material-ui-popup-state/HoverPopover';
import { usePopupState } from 'material-ui-popup-state/hooks';

interface Props {
height: number;
width: number;
color: string;
children: React.ReactNode;
}

const InfoIconPopup = ({ height, width, color, children }: Props) => {
const abandonmentInfoPopupState = usePopupState({
variant: 'popover',
popupId: 'abandonmentInfoPopover',
});
return (
<div
{...bindHover(abandonmentInfoPopupState)}
style={{ cursor: 'pointer' }}
>
<NewInfoIcon height={height} width={width} color={color} />
<HoverPopover
{...bindPopover(abandonmentInfoPopupState)}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'center',
}}
transformOrigin={{
vertical: 'top',
horizontal: 'left',
}}
onClick={(e) => {
e.stopPropagation();
}}
>
{children}
</HoverPopover>
</div>
);
};

export default InfoIconPopup;
20 changes: 20 additions & 0 deletions src/temp/icons/RightArrowIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { IconProps } from '../../features/common/types/common';

const RightArrowIcon = ({ width, color }: IconProps) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={width}
viewBox="0 0 5 10"
fill="none"
>
<path
d="M2.68057 5.12199L0.240571 2.27199C-0.119429 1.85199 -0.0694288 1.22199 0.350571 0.861987C0.770571 0.501987 1.40057 0.551988 1.76057 0.971988L4.76057 4.47199C5.08057 4.84199 5.08057 5.40199 4.76057 5.77199L1.76057 9.27199C1.40057 9.69199 0.770572 9.74199 0.350572 9.38199C-0.0694285 9.02199 -0.119429 8.39199 0.240571 7.97199L2.68057 5.12199Z"
fill={color}
/>
</svg>
);
};

export default RightArrowIcon;

0 comments on commit d2a1463

Please sign in to comment.