Change the icon for my singleton SiteSettings
3 replies
Last updated: May 17, 2020
C
Hi, 's me again 🙂I'm trying to change the icon for my singleton
siteSettings, the same way, I've done that for my events and author document lists.Here's my siteSettings.js schema. I have
react-iconsinstalled and I verified that the
FaCogsis getting imported. However the icon does not change. What am I missing?
import { FaCogs } from 'react-icons/fa'; console.dir(FaCogs); export default { name: `siteSettings`, type: `document`, title: `Site Settings`, icon: FaCogs, __experimental_actions: [`update`, /* `create`, `delete`, */ `publish`], fields: [ { title: `Site's main heading`, name: `title`, type: `string`, }, { title: `Introduction text`, name: `description`, type: `richText`, description: `Describe the website, the reason behind creating it, who it is for and what the visitors will find here`, }, { title: `Footer content`, name: `footer`, type: `richText`, description: `Content of the footer`, }, ], }
May 17, 2020, 9:01 AM
P
Hi again 🙂 Can you see the icon if you go to
Create new documentin the Studio (the + icon in the top left corner)? If so, what you might need to do is also add the icon to your
deskStructure.jsfile:
import S from '@sanity/desk-tool/structure-builder' import { FaCogs } from 'react-icons/fa' ... S.listItem() .title(`Site settings`) .icon(FaCogs) .child( S.editor() .schemaType(`siteSettings`) .documentId(`siteSettings`) ...
May 17, 2020, 9:10 AM
C
Yes, that was it. I'm still struggling a little bit to differentiate between what is defined in a schema and what in the structure builder. There's so much to take in, but I'm slowly getting my head around it.
Btw. thanks for helping me out on Sunday!
Btw. thanks for helping me out on Sunday!
May 17, 2020, 9:13 AM
P
Agreed, there’s plenty of stuff to get your head around and it can seem daunting at first as almost anything can be changed and customised. But hang in there - we’ll be here to help out along the way (even on Sunday sometimes) 😉
May 17, 2020, 9:16 AM
Sanity– build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.