Use fallback icon on plugin page (#1268)

This commit is contained in:
Lukas 2022-10-14 16:20:54 +02:00 committed by GitHub
parent 47315eaac0
commit 7686d4c8c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -44,8 +44,8 @@ export const IconWebsite = (size = 32) => (
</svg>
);
export const IconPlugin = () => (
<svg style={{ width: '100%', maxWidth: '50px' }} viewBox="0 0 24 24">
export const IconPlugin = (maxWidth = 50) => (
<svg style={{ width: '100%', maxWidth: `${maxWidth}px` }} viewBox="0 0 24 24">
<g fill="none">
<path d="M0 0h24v24H0z" />
<path

View file

@ -1,7 +1,7 @@
import React from 'react';
import Layout from '@theme/Layout';
import { WoodpeckerPlugin as WoodpeckerPluginType } from '../types';
import { IconContainer, IconVerified, IconWebsite } from './Icons';
import { IconContainer, IconPlugin, IconVerified, IconWebsite } from './Icons';
export function WoodpeckerPlugin({ plugin }: { plugin: WoodpeckerPluginType }) {
return (
@ -61,7 +61,7 @@ export function WoodpeckerPlugin({ plugin }: { plugin: WoodpeckerPluginType }) {
<p style={{ marginTop: '2rem', marginBottom: '1rem' }}>{plugin.description}</p>
</div>
<div className="col col--2">
<img src={plugin.icon} width="150" height="150" />
{plugin.icon ? <img src={plugin.icon} width="150" /> : IconPlugin(150)}
</div>
</div>
<hr style={{ margin: '1rem 0' }} />