this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix search bugs

+18 -7
+2 -1
src/components/link.jsx
··· 19 19 let hash = (location.hash || '').replace(/^#/, '').trim(); 20 20 if (hash === '') hash = '/'; 21 21 const { to, ...restProps } = props; 22 - const isActive = decodeURIComponent(hash) === to; 22 + // TODO: maybe better pass hash into URL to deconstruct the pathname and search, then decodeURIComponent them 23 + const isActive = hash === to || decodeURIComponent(hash) === to; 23 24 return ( 24 25 <a 25 26 ref={ref}
+8 -2
src/components/search-form.jsx
··· 163 163 if (focusItem) { 164 164 e.preventDefault(); 165 165 focusItem.click(); 166 - props?.onSubmit?.(e); 167 166 } 168 167 setSearchMenuOpen(false); 169 168 } ··· 221 220 return 0; 222 221 }) 223 222 .map(({ label, to, hidden, type }) => ( 224 - <Link to={to} class="search-popover-item" hidden={hidden}> 223 + <Link 224 + to={to} 225 + class="search-popover-item" 226 + hidden={hidden} 227 + onClick={(e) => { 228 + props?.onSubmit?.(e); 229 + }} 230 + > 225 231 <Icon 226 232 icon={type === 'link' ? 'arrow-right' : 'search'} 227 233 class="more-insignificant"
+8 -4
src/pages/search.jsx
··· 153 153 <main> 154 154 {!!q && ( 155 155 <div class="filter-bar"> 156 - {!!type && <Link to={`/search${q ? `?q=${q}` : ''}`}>‹ All</Link>} 156 + {!!type && ( 157 + <Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}> 158 + ‹ All 159 + </Link> 160 + )} 157 161 {[ 158 162 { 159 163 label: 'Accounts', 160 164 type: 'accounts', 161 - to: `/search?q=${q}&type=accounts`, 165 + to: `/search?q=${encodeURIComponent(q)}&type=accounts`, 162 166 }, 163 167 { 164 168 label: 'Hashtags', 165 169 type: 'hashtags', 166 - to: `/search?q=${q}&type=hashtags`, 170 + to: `/search?q=${encodeURIComponent(q)}&type=hashtags`, 167 171 }, 168 172 { 169 173 label: 'Posts', 170 174 type: 'statuses', 171 - to: `/search?q=${q}&type=statuses`, 175 + to: `/search?q=${encodeURIComponent(q)}&type=statuses`, 172 176 }, 173 177 ] 174 178 .sort((a, b) => {