mirror of
https://github.com/meshtastic/meshtastic.git
synced 2024-12-31 16:37:32 -08:00
removed components and used JSX instead
This commit is contained in:
parent
4e0ad460b0
commit
e534c0eeeb
|
@ -15,20 +15,6 @@ export const DownloadCard = ({
|
||||||
notes,
|
notes,
|
||||||
buttonText,
|
buttonText,
|
||||||
}: downloadCardProps): JSX.Element => {
|
}: downloadCardProps): JSX.Element => {
|
||||||
|
|
||||||
const button = React.createElement(
|
|
||||||
'a',
|
|
||||||
{href: url, className: "button button--secondary button--block"},
|
|
||||||
buttonText
|
|
||||||
)
|
|
||||||
const img = React.createElement(
|
|
||||||
'img',
|
|
||||||
{style: {height: '4rem'}, src: imgUrl, href: url},
|
|
||||||
null
|
|
||||||
)
|
|
||||||
|
|
||||||
const anchorImg = <a href={url}>{buttonText ? null : img}</a>
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<div
|
<div
|
||||||
|
@ -41,7 +27,17 @@ export const DownloadCard = ({
|
||||||
className="card__body"
|
className="card__body"
|
||||||
style={{ display: "flex", justifyContent: "center"}}
|
style={{ display: "flex", justifyContent: "center"}}
|
||||||
>
|
>
|
||||||
{buttonText ? button : anchorImg}
|
{
|
||||||
|
buttonText
|
||||||
|
?
|
||||||
|
<a href={url} className="button button--secondary button--block">
|
||||||
|
{buttonText}
|
||||||
|
</a>
|
||||||
|
:
|
||||||
|
<a href={url} className="button button--secondary button--block">
|
||||||
|
<img style={{height: '4rem'}} src={imgUrl}></img>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="card__footer">
|
<div className="card__footer">
|
||||||
{notes ? notes : null}
|
{notes ? notes : null}
|
||||||
|
|
Loading…
Reference in a new issue