MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / renderEditorThemes

Function renderEditorThemes

src/pages/themeSetting/themeSetting.js:143–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142
143 function renderEditorThemes() {
144 const currentTheme = (
145 appSettings.value.editorTheme || "one_dark"
146 ).toLowerCase();
147 if (innerHeight * 0.3 >= 120) {
148 $page.body.append($themePreview);
149 createPreview(currentTheme);
150 } else {
151 $themePreview.remove();
152 }
153
154 const themeList = getThemes();
155 let $currentItem;
156 list.el.content = themeList.map((t) => {
157 const isCurrent = t.id === currentTheme;
158 const $item = (
159 <Item
160 name={t.caption}
161 isCurrent={isCurrent}
162 swatches={getEditorThemeSwatches(t.id)}
163 onclick={() => setEditorTheme({ caption: t.caption, theme: t.id })}
164 />
165 );
166 if (isCurrent) $currentItem = $item;
167 return $item;
168 });
169 $currentItem?.scrollIntoView();
170 }
171
172 function renderTerminalThemes() {
173 destroyPreview("switch-tab");

Callers

nothing calls this directly

Calls 4

getThemesFunction · 0.90
createPreviewFunction · 0.85
appendMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected