mirror of
https://github.com/meshtastic/meshtastic.git
synced 2024-12-28 06:59:45 -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,
|
||||
buttonText,
|
||||
}: 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 (
|
||||
<div className="card">
|
||||
<div
|
||||
|
@ -41,7 +27,17 @@ export const DownloadCard = ({
|
|||
className="card__body"
|
||||
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 className="card__footer">
|
||||
{notes ? notes : null}
|
||||
|
|
Loading…
Reference in a new issue