MCPcopy
hub / github.com/spicetify/cli / checkBoxItem

Function checkBoxItem

Extensions/shuffle+.js:108–135  ·  view source on GitHub ↗
({ name, field, onclickFun = () => {} })

Source from the content-addressed store, hash-verified

106 }
107
108 function checkBoxItem({ name, field, onclickFun = () => {} }) {
109 const [value, setValue] = useState(CONFIG[field]);
110 return React.createElement(
111 "div",
112 { className: "popup-row" },
113 React.createElement("label", { className: "col description" }, name),
114 React.createElement(
115 "div",
116 { className: "col action" },
117 React.createElement(
118 "button",
119 {
120 className: `checkbox${value ? "" : " disabled"}`,
121 onClick: () => {
122 CONFIG[field] = !value;
123 setValue(!value);
124 saveConfig();
125 onclickFun();
126 },
127 },
128 React.createElement(DisplayIcon, {
129 icon: Spicetify.SVGIcons.check,
130 size: 16,
131 })
132 )
133 )
134 );
135 }
136
137 function dropDownItem({ name, field, options, onclickFun = () => {} }) {
138 const [value, setValue] = useState(CONFIG[field]);

Callers

nothing calls this directly

Calls 1

saveConfigFunction · 0.70

Tested by

no test coverage detected