forked from pdsls.dev/pdsls
atproto explorer

collection filter button

juli.ee 26e44b41 a96fd57b

verified
Changed files
+20 -7
src
views
+20 -7
src/views/repo.tsx
··· 22 const [didDoc, setDidDoc] = createSignal<DidDocument>(); 23 const [nsids, setNsids] = createSignal<Record<string, { hidden: boolean; nsids: string[] }>>(); 24 const [filter, setFilter] = createSignal<string>(); 25 const [validHandles, setValidHandles] = createStore<Record<string, boolean>>({}); 26 let rpc: Client; 27 let pds: string; ··· 136 <div 137 class={`dark:shadow-dark-700 dark:bg-dark-300 flex justify-between rounded-lg border-[0.5px] border-neutral-300 bg-neutral-50 px-2 py-1.5 text-sm shadow-xs dark:border-neutral-700`} 138 > 139 - <div class="flex gap-2 sm:gap-4"> 140 <Show when={!error()}> 141 <RepoTab tab="collections" label="Collections" /> 142 </Show> ··· 155 <span class="iconify lucide--alert-triangle"></span> 156 <span>{error()}</span> 157 </div> 158 </Show> 159 <MenuProvider> 160 <DropdownMenu ··· 213 </ErrorBoundary> 214 </Show> 215 <Show when={nsids() && (!location.hash || location.hash === "#collections")}> 216 - <TextInput 217 - name="filter" 218 - placeholder="Filter collections" 219 - onInput={(e) => setFilter(e.currentTarget.value.toLowerCase())} 220 - class="grow" 221 - /> 222 <div class="flex flex-col overflow-hidden text-sm"> 223 <For 224 each={Object.keys(nsids() ?? {}).filter((authority) =>
··· 22 const [didDoc, setDidDoc] = createSignal<DidDocument>(); 23 const [nsids, setNsids] = createSignal<Record<string, { hidden: boolean; nsids: string[] }>>(); 24 const [filter, setFilter] = createSignal<string>(); 25 + const [showFilter, setShowFilter] = createSignal(false); 26 const [validHandles, setValidHandles] = createStore<Record<string, boolean>>({}); 27 let rpc: Client; 28 let pds: string; ··· 137 <div 138 class={`dark:shadow-dark-700 dark:bg-dark-300 flex justify-between rounded-lg border-[0.5px] border-neutral-300 bg-neutral-50 px-2 py-1.5 text-sm shadow-xs dark:border-neutral-700`} 139 > 140 + <div class="flex gap-2 text-xs sm:gap-4 sm:text-sm"> 141 <Show when={!error()}> 142 <RepoTab tab="collections" label="Collections" /> 143 </Show> ··· 156 <span class="iconify lucide--alert-triangle"></span> 157 <span>{error()}</span> 158 </div> 159 + </Show> 160 + <Show when={!error() && (!location.hash || location.hash === "#collections")}> 161 + <Tooltip text="Filter collections"> 162 + <button 163 + class="flex items-center rounded-sm p-1 hover:bg-neutral-200 active:bg-neutral-300 dark:hover:bg-neutral-700 dark:active:bg-neutral-600" 164 + onClick={() => setShowFilter(!showFilter())} 165 + > 166 + <span class="iconify lucide--filter"></span> 167 + </button> 168 + </Tooltip> 169 </Show> 170 <MenuProvider> 171 <DropdownMenu ··· 224 </ErrorBoundary> 225 </Show> 226 <Show when={nsids() && (!location.hash || location.hash === "#collections")}> 227 + <Show when={showFilter()}> 228 + <TextInput 229 + name="filter" 230 + placeholder="Filter collections" 231 + onInput={(e) => setFilter(e.currentTarget.value.toLowerCase())} 232 + class="grow" 233 + /> 234 + </Show> 235 <div class="flex flex-col overflow-hidden text-sm"> 236 <For 237 each={Object.keys(nsids() ?? {}).filter((authority) =>