Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import * as React from 'react';
|
|
import { loadCSS } from 'fg-loadcss';
|
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
import Stack from '@mui/material/Stack';
|
|
import Icon from '@mui/material/Icon';
|
|
import MdPhone from '@mui/icons-material/Phone';
|
|
import Chip from '@mui/material/Chip';
|
|
|
|
const theme = createTheme({
|
|
components: {
|
|
MuiIcon: {
|
|
styleOverrides: {
|
|
root: {
|
|
// Match 24px = 3 * 2 + 1.125 * 16
|
|
boxSizing: 'content-box',
|
|
padding: 3,
|
|
fontSize: '1.125rem',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
export default function FontAwesomeIconSize() {
|
|
React.useEffect(() => {
|
|
const node = loadCSS(
|
|
'https://use.fontawesome.com/releases/v5.14.0/css/all.css',
|
|
// Inject before JSS
|
|
(document.querySelector('#font-awesome-css') ||
|
|
document.head.firstChild) as HTMLElement,
|
|
);
|
|
|
|
return () => {
|
|
node.parentNode!.removeChild(node);
|
|
};
|
|
}, []);
|
|
|
|
return (
|
|
<Stack direction="row" spacing={2}>
|
|
<ThemeProvider theme={theme}>
|
|
<Chip icon={<MdPhone />} label="Call me" />
|
|
<Chip icon={<Icon className="fas fa-phone-alt" />} label="Call me" />
|
|
</ThemeProvider>
|
|
</Stack>
|
|
);
|
|
}
|