mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 22:02:42 +00:00
27 lines
627 B
React
27 lines
627 B
React
import React from "react";
|
|
import styles from "./MDNBadge.module.css";
|
|
|
|
export default function MDNBadge({ title, url, i }) {
|
|
// i stands for "is inline?" - default false
|
|
const wrapperClass = i ? wrapperInline : styles.wrapperBlock;
|
|
const imgClass = i ? imgInline : styles.imgBlock;
|
|
|
|
return (
|
|
<a
|
|
href={url}
|
|
className={wrapperClass}
|
|
target="_blank"
|
|
rel="noopener noreferer"
|
|
>
|
|
<img
|
|
className={imgClass}
|
|
src={`https://img.shields.io/badge/MDN-${title}-c2e8f9?logo=MDN%20Web%20Docs&style=flat-square`}
|
|
/>
|
|
</a>
|
|
);
|
|
}
|
|
|
|
MDNBadge.defaultProps = {
|
|
i: false,
|
|
};
|