INNER CODE UNIT · JavaScript
Feature
facebookresearch/mmf · website/src/pages/index.js:69
function Feature({imageUrl, title, description}) {
const {colorMode} = useColorMode();
const withoutExtension = imageUrl.split('.')[0];
const whiteImageUrl = useBaseUrl(`${withoutExtension}_white.svg`);
const normalImageUrl = useBaseUrl(imageUrl);
const finalImageUrl = colorMode === 'dark' ? whiteImageUrl : normalImageUrl;
return (
<div className={classnames('col col--4', styles.feature, 'text--center')}>
{finalImageUrl && (
<div className="text--center">
<img
className={styles.featureImage}
src={finalImageUrl}
alt={title}
/>
</div>
)}
<h3>{title}</h3>