I am following this doc to add custom icon and logo.
It references some components like
MyCustomIcon and MyCustomLogo
but these files and their content is nowhere in github.
What datatype are these mysterious objects?
Those are react Components. sth like this does the job
import logo from './logo.svg'
export const Icon = () => (
<img src={logo}></img>
)
Adding this component to config throws the following error
Type '{ Logo: () => JSX.Element; Icon: () => JSX.Element; }' is not assignable to type 'Element | (() => Element)'.
Object literal may only specify known properties, and 'Logo' does not exist in type 'Element | (() => Element)'.
Config
import {Logo} from './components/logos/Logo';
import {Icon} from './components/logos/Icon';
...
components: {
graphics: {
Logo,
Icon
},
},
Here is my Logo
import React from 'react';
import '../../assets/styles/styles.scss';
const icon = require("../../assets/graphics/ss_icon.svg") as string;
export const Logo = () => (
<img src={icon}></img>
)
export default Logo; ?
I guess you have to add types if you're using TS, the component above is just JS
Hey @KasparTr this needs to be nested under 'admin' in your payload config:
admin: {
components: {
graphics: {
Logo,
Icon,
},
},
},
This blog post may be useful for you
https://payloadcms.com/blog/white-label-admin-uiStar
Discord
online
Get dedicated engineering support directly from the Payload team..