diff --git a/src/ui/styles.scss b/src/ui/styles.scss index f24cdde..89ccca8 100644 --- a/src/ui/styles.scss +++ b/src/ui/styles.scss @@ -14,6 +14,7 @@ --primary-text-color: #3c3c3c; --secondary-text-color: #888; --sidebar-hover-color: var(--bluish-white); + --spinner-color: black; // @media-dependent variables --padding-standard: 30px; @@ -52,6 +53,7 @@ --primary-text-color: var(--bluish-white); --secondary-text-color: #7f91aa; --sidebar-hover-color: var(--border-color); + --spinner-color: white; } @font-face { @@ -235,6 +237,32 @@ mark { } } + .is-hidden { + filter: grayscale(100%); + cursor: pointer; + } + + .spinner-color { + fill: var(--spinner-color) + } + + .spinner { + width: 20px; + height: 20px; + animation: spin 1s linear infinite; + background: none; + padding: 0; + } + + @keyframes spin { + from { + transform:rotate(0deg); + } + to { + transform:rotate(360deg); + } + } + span { background: var(--no-results-color); border-radius: 15px; diff --git a/src/ui/ui.tsx b/src/ui/ui.tsx index d7fadbb..042d3bc 100644 --- a/src/ui/ui.tsx +++ b/src/ui/ui.tsx @@ -96,60 +96,93 @@ const Settings = ({ ); const Sidebar = ({ + visible, hiddenEngines, + onToggle, resultGroups, }: { + visible: boolean; hiddenEngines: string[]; + onToggle: (engineId: string) => void; resultGroups: ResultGroup[]; }) => (
); @@ -400,7 +433,17 @@ const App = () => { sortMode={sortMode} /> 0} hiddenEngines={localData.hiddenEngines || []} + onToggle={engineId => { + const hiddenEngines = localData.hiddenEngines || []; + setLocalData({ + ...localData, + hiddenEngines: hiddenEngines.includes(engineId) + ? hiddenEngines.filter(id => id !== engineId) + : [...hiddenEngines, engineId].sort(), + }); + }} resultGroups={resultGroups} />