diff --git a/src/lib/components/Searchbar.svelte b/src/lib/components/Searchbar.svelte index b812d505..598a62ff 100644 --- a/src/lib/components/Searchbar.svelte +++ b/src/lib/components/Searchbar.svelte @@ -1,184 +1,170 @@ - - - - + + - - - {#if $screenWidth >= 640} - + - + + - - - - - - - - + - Search - Search + - (searchBarTicker(searchQuery, assetType))} class="absolute inset-0 right-auto group" type="submit" aria-label="Search"> - - - - - - - - - {#if $searchBarData?.length !== 0} - - - - {#if notFoundTicker} - Oh snapp, ticker does not exist in our database - {/if} - {#if !showSuggestions} - - Popular - - {/if} - - {#if !showSuggestions } - {#each popularList as item} - - popularTicker(item?.symbol, item?.assetType) } class="mb-2 {item?.symbol === focusedSuggestion ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#404040] bg-opacity-[0.25] rounded group' : 'shake-ticker cursor-pointer bg-[#09090B] sm:hover:bg-[#17171A] rounded-lg flex justify-start items-center p-2 text-white group'} w-full"> - - - - - - {item?.symbol} - {item?.name.length > 150 ? item?.name?.slice(0,150) + "..." : item?.name} - - - - - - {item?.type} - - - - - - - - - {/each} - - - {:else if showSuggestions && searchResults?.length > 0} - - Suggestions - - {#each searchResults as item} - - - - (searchBarTicker(item?.symbol, item?.type))} class="mb-2 {item?.symbol === focusedSuggestion ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#404040] bg-opacity-[0.25] rounded group' : 'cursor-pointer mb-2 bg-[#09090B] sm:hover:bg-[#17171A] rounded-lg flex justify-start items-center p-2 text-white group'}"> - - - - {item?.symbol} - {item?.name?.length > 150 ? item?.name?.slice(0,150) + "..." : item?.name} - - - - - {item?.type} - - - - - - - - - {/each} - {:else if showSuggestions && searchResults?.length === 0} - - - - - - No results found - - - {/if} - - - - {:else} - - - - - - - - {/if} - - - - - - Return - - - - - -{:else} - - - - - - - - - - - - - - - - - - - - - Search - - (searchBarTicker(searchQuery, assetType))} class="absolute inset-0 right-auto group" type="submit" aria-label="Search"> - - + searchBarTicker(searchQuery, assetType)} + class="absolute inset-0 right-auto group" + type="submit" + aria-label="Search" + > + + + - - - {#if $searchBarData?.length !== 0} - - - - {#if notFoundTicker} - Oh snapp, ticker does not exist in our database - {/if} - {#if !showSuggestions} - - Popular - - {/if} - - {#if !showSuggestions } - {#each popularList as item} - - popularTicker(item?.symbol, item?.type) } class="mb-2 {item?.symbol === focusedSuggestion ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#404040] bg-opacity-[0.25] rounded group' : 'cursor-pointer bg-[#09090B] bg-opacity-[0.4] rounded-lg flex justify-start items-center p-2 text-white group'} w-full"> - - - - - - {item?.symbol} - {item?.name.length > charNumber ? item?.name.slice(0,charNumber) + "..." : item?.name} - + {#if $searchBarData?.length !== 0} + + + + {#if notFoundTicker} + + Oh snapp, ticker does not exist in our database + + {/if} + {#if !showSuggestions} + + Popular + + {/if} + + {#if !showSuggestions} + {#each popularList as item} + + + popularTicker(item?.symbol, item?.assetType)} + class="mb-2 {item?.symbol === focusedSuggestion + ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#27272A] rounded group' + : 'shake-ticker cursor-pointer bg-[#09090B] sm:hover:bg-[#27272A] rounded-lg flex justify-start items-center p-2 text-white group'} w-full" + > + + + + + + {item?.symbol} + {item?.name.length > 150 + ? item?.name?.slice(0, 150) + "..." + : item?.name} + + + {item?.type} + + + + + {/each} + {:else if showSuggestions && searchResults?.length > 0} + + Suggestions + + {#each searchResults as item} + + + + searchBarTicker(item?.symbol, item?.type)} + class="mb-2 {item?.symbol === focusedSuggestion + ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#27272A] rounded group' + : 'cursor-pointer mb-2 bg-[#09090B] sm:hover:bg-[#27272A] rounded-lg flex justify-start items-center p-2 text-white group'}" + > + + + {item?.symbol} + {item?.name?.length > 150 + ? item?.name?.slice(0, 150) + "..." + : item?.name} + - - {item?.type} - - - - - - - - {/each} - - - {:else if showSuggestions && searchResults?.length > 0} - - Suggestions + + {item?.type} + + + + + {/each} + {:else if showSuggestions && searchResults?.length === 0} + + + + + + No results found + + + {/if} + - {#each searchResults as item} - - - - (searchBarTicker(item?.symbol, item?.type))} class="mb-2 {item?.symbol === focusedSuggestion ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#404040] bg-opacity-[0.25] rounded group' : 'cursor-pointer mb-2 bg-[#09090B] bg-opacity-[0.4] rounded-lg flex justify-start items-center p-2 text-white group'}"> - + + {:else} + + + + + + + + {/if} - - {item?.symbol} - {item?.name.length > charNumber ? item?.name.slice(0,charNumber) + "..." : item?.name} - - + + + Return + + + +{:else} + - - {item?.type} - - - - - - {/each} - {:else if showSuggestions && searchResults?.length === 0} - - - - + + + + + + + + + + + Search + + searchBarTicker(searchQuery, assetType)} + class="absolute inset-0 right-auto group" + type="submit" + aria-label="Search" + > + + + - No results found - - - {/if} - + + + + + {#if $searchBarData?.length !== 0} + + + + {#if notFoundTicker} + + Oh snapp, ticker does not exist in our database + + {/if} + {#if !showSuggestions} + + Popular + + {/if} + + {#if !showSuggestions} + {#each popularList as item} + + popularTicker(item?.symbol, item?.type)} + class="mb-2 {item?.symbol === focusedSuggestion + ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#27272A] rounded group' + : 'cursor-pointer bg-[#09090B] bg-opacity-[0.4] rounded-lg flex justify-start items-center p-2 text-white group'} w-full" + > + + + + + + {item?.symbol} + {item?.name.length > charNumber + ? item?.name.slice(0, charNumber) + "..." + : item?.name} + + + + {item?.type} + + + + + {/each} + {:else if showSuggestions && searchResults?.length > 0} + + Suggestions + + {#each searchResults as item} + + + + + searchBarTicker(item?.symbol, item?.type)} + class="mb-2 {item?.symbol === focusedSuggestion + ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 text-white bg-[#27272A] rounded group' + : 'cursor-pointer mb-2 bg-[#09090B] bg-opacity-[0.4] rounded-lg flex justify-start items-center p-2 text-white group'}" + > + + + {item?.symbol} + {item?.name.length > charNumber + ? item?.name.slice(0, charNumber) + "..." + : item?.name} + + + + {item?.type} + + + + + {/each} + {:else if showSuggestions && searchResults?.length === 0} + + + + + + No results found + + + {/if} + + + + {:else} + + + + {/if} + + + + + - {:else} - - - - {/if} - - - - - - - - - - {/if} - diff --git a/src/routes/insider-tracker/+page.svelte b/src/routes/insider-tracker/+page.svelte index e7ad2c3c..16e22b5a 100644 --- a/src/routes/insider-tracker/+page.svelte +++ b/src/routes/insider-tracker/+page.svelte @@ -126,7 +126,7 @@ // Sort using the generic comparison function stockList = [...originalData].sort(compareValues); }; - $: charNumber = $screenWidth < 640 ? 15 : 15; + $: charNumber = $screenWidth < 640 ? 20 : 25; diff --git a/src/routes/watchlist/+layout.svelte b/src/routes/watchlist/+layout.svelte index 1ed69bf6..3ab71b41 100644 --- a/src/routes/watchlist/+layout.svelte +++ b/src/routes/watchlist/+layout.svelte @@ -150,7 +150,7 @@ > - Pro Subscription 🔥 + Pro Subscription @@ -170,7 +170,7 @@ > - Price Alert ⏰ + Price Alert @@ -189,7 +189,7 @@ > - Stock Screener 🔎 + Stock Screener
Oh snapp, ticker does not exist in our database
+ Oh snapp, ticker does not exist in our database +