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> </svg>
); );
export const IconPlugin = () => ( export const IconPlugin = (maxWidth = 50) => (
<svg style={{ width: '100%', maxWidth: '50px' }} viewBox="0 0 24 24"> <svg style={{ width: '100%', maxWidth: `${maxWidth}px` }} viewBox="0 0 24 24">
<g fill="none"> <g fill="none">
<path d="M0 0h24v24H0z" /> <path d="M0 0h24v24H0z" />
<path <path

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import Layout from '@theme/Layout'; import Layout from '@theme/Layout';
import { WoodpeckerPlugin as WoodpeckerPluginType } from '../types'; 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 }) { export function WoodpeckerPlugin({ plugin }: { plugin: WoodpeckerPluginType }) {
return ( return (
@ -61,7 +61,7 @@ export function WoodpeckerPlugin({ plugin }: { plugin: WoodpeckerPluginType }) {
<p style={{ marginTop: '2rem', marginBottom: '1rem' }}>{plugin.description}</p> <p style={{ marginTop: '2rem', marginBottom: '1rem' }}>{plugin.description}</p>
</div> </div>
<div className="col col--2"> <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>
</div> </div>
<hr style={{ margin: '1rem 0' }} /> <hr style={{ margin: '1rem 0' }} />