global.ts (3568B)
1 import type { Collection } from "tinacms"; 2 import { iconSchema } from "../../components/util/icon"; 3 import { ColorPickerInput } from "../fields/color"; 4 5 const Global: Collection = { 6 label: "Global", 7 name: "global", 8 path: "content/global", 9 format: "json", 10 ui: { 11 global: true, 12 }, 13 fields: [ 14 { 15 type: "object", 16 label: "Header", 17 name: "header", 18 fields: [ 19 iconSchema as any, 20 { 21 type: "string", 22 label: "Name", 23 name: "name", 24 }, 25 { 26 type: "string", 27 label: "Color", 28 name: "color", 29 options: [ 30 { label: "Default", value: "default" }, 31 { label: "Primary", value: "primary" }, 32 ], 33 }, 34 { 35 type: "object", 36 label: "Nav Links", 37 name: "nav", 38 list: true, 39 ui: { 40 itemProps: (item) => { 41 return { label: item?.label }; 42 }, 43 defaultItem: { 44 href: "home", 45 label: "Home", 46 }, 47 }, 48 fields: [ 49 { 50 type: "string", 51 label: "Link", 52 name: "href", 53 }, 54 { 55 type: "string", 56 label: "Label", 57 name: "label", 58 }, 59 ], 60 }, 61 ], 62 }, 63 { 64 type: "object", 65 label: "Footer", 66 name: "footer", 67 fields: [ 68 { 69 type: "string", 70 label: "Color", 71 name: "color", 72 options: [ 73 { label: "Default", value: "default" }, 74 { label: "Primary", value: "primary" }, 75 ], 76 }, 77 { 78 type: "object", 79 label: "Social Links", 80 name: "social", 81 fields: [ 82 { 83 type: "string", 84 label: "Facebook", 85 name: "facebook", 86 }, 87 { 88 type: "string", 89 label: "Twitter", 90 name: "twitter", 91 }, 92 { 93 type: "string", 94 label: "Instagram", 95 name: "instagram", 96 }, 97 { 98 type: "string", 99 label: "Github", 100 name: "github", 101 }, 102 ], 103 }, 104 ], 105 }, 106 { 107 type: "object", 108 label: "Theme", 109 name: "theme", 110 // eslint-disable-next-line @typescript-eslint/ban-ts-comment 111 // @ts-ignore 112 fields: [ 113 { 114 type: "string", 115 label: "Primary Color", 116 name: "color", 117 ui: { 118 component: ColorPickerInput, 119 }, 120 }, 121 { 122 type: "string", 123 name: "font", 124 label: "Font Family", 125 options: [ 126 { 127 label: "System Sans", 128 value: "sans", 129 }, 130 { 131 label: "Nunito", 132 value: "nunito", 133 }, 134 { 135 label: "Lato", 136 value: "lato", 137 }, 138 ], 139 }, 140 { 141 type: "string", 142 name: "darkMode", 143 label: "Dark Mode", 144 options: [ 145 { 146 label: "System", 147 value: "system", 148 }, 149 { 150 label: "Light", 151 value: "light", 152 }, 153 { 154 label: "Dark", 155 value: "dark", 156 }, 157 ], 158 }, 159 ], 160 }, 161 ], 162 }; 163 164 export default Global;