✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Change the icon for my singleton SiteSettings

3 replies
Last updated: May 17, 2020
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-icons
installed and I verified that the
FaCogs
is 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
Hi again 🙂 Can you see the icon if you go to
Create new document
in 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.js
file:
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
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!
May 17, 2020, 9:13 AM
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.

Was this answer helpful?