feat(web): font awesome icon animations

This commit is contained in:
Luke committed 2023-11-15 15:28:21 +01:00
1 parent a50f7a2052
commit 882e372895
24 files changed
+124 -47

No files matched your search

@@ -1,11 +1,11 @@
import { Button, Box, Group, Stack, Text, Progress, HoverCard, Image, createStyles } from '@mantine/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import ReactMarkdown from 'react-markdown';
import { Option, ContextMenuProps } from '../../../../typings';
import { fetchNui } from '../../../../utils/fetchNui';
import { isIconUrl } from '../../../../utils/isIconUrl';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import MarkdownComponents from '../../../../config/MarkdownComponents';
import LibIcon from '../../../../components/LibIcon';
const openMenu = (id: string | undefined) => {
fetchNui<ContextMenuProps>('openContext', { id: id, back: false });
@@ -112,11 +112,12 @@ const ContextButton: React.FC<{
{typeof button.icon === 'string' && isIconUrl(button.icon) ? (
<img src={button.icon} className={classes.iconImage} alt="Missing img" />
) : (
<FontAwesomeIcon
<LibIcon
icon={button.icon as IconProp}
fixedWidth
size="lg"
style={{ color: button.iconColor }}
animation={button.iconAnimation}
/>
)}
</Stack>
@@ -137,7 +138,7 @@ const ContextButton: React.FC<{
</Stack>
{(button.menu || button.arrow) && button.arrow !== false && (
<Stack className={classes.buttonArrowContainer}>
<FontAwesomeIcon icon="chevron-right" fixedWidth />
<LibIcon icon="chevron-right" fixedWidth />
</Stack>
)}
</Group>
@@ -1,6 +1,7 @@
import { Button, createStyles } from '@mantine/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import LibIcon from '../../../../components/LibIcon';
interface Props {
icon: IconProp;
@@ -38,7 +39,7 @@ const HeaderButton: React.FC<Props> = ({ icon, canClose, iconSize, handleClick }
disabled={canClose === false}
onClick={handleClick}
>
<FontAwesomeIcon icon={icon} fontSize={iconSize} fixedWidth />
<LibIcon icon={icon} fontSize={iconSize} fixedWidth />
</Button>
);
};