Rename CommandPalette -> GlobalSearch

This commit is contained in:
Kalle 2026-03-04 21:12:30 +02:00
parent 7d9d00b22b
commit 7f2b496e3c
4 changed files with 8 additions and 8 deletions

View File

@ -26,7 +26,7 @@ import {
userPage,
weaponCategoryUrl,
} from "~/utils/urls";
import styles from "./CommandPalette.module.css";
import styles from "./GlobalSearch.module.css";
import {
filterWeaponResults,
getRecentWeapons,
@ -47,7 +47,7 @@ const SEARCH_TYPES = [
] as const;
type SearchType = (typeof SEARCH_TYPES)[number];
const STORAGE_KEY = "command-palette-search-type";
const STORAGE_KEY = "global-search-search-type";
function searchTypeIconPath(type: SearchType): string {
if (type === "weapons") {
@ -75,7 +75,7 @@ function getInitialSearchType(): SearchType {
return "weapons";
}
export function CommandPalette() {
export function GlobalSearch() {
const { t } = useTranslation(["common"]);
// TODO: use zod validated search params
const [searchParams, setSearchParams] = useSearchParams();
@ -137,7 +137,7 @@ export function CommandPalette() {
<ModalOverlay className={styles.overlay}>
<Modal className={styles.modal}>
<Dialog className={styles.dialog} aria-label={t("common:search")}>
<CommandPaletteContent
<GlobalSearchContent
onClose={() => handleOpenChange(false)}
initialSearchType={initialSearchType}
/>
@ -148,7 +148,7 @@ export function CommandPalette() {
);
}
function CommandPaletteContent({
function GlobalSearchContent({
onClose,
initialSearchType,
}: {

View File

@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import { SUPPORT_PAGE } from "~/utils/urls";
import { LinkButton, SendouButton } from "../elements/Button";
import { AnythingAdder } from "./AnythingAdder";
import { CommandPalette } from "./CommandPalette";
import { GlobalSearch } from "./GlobalSearch";
import { LogInButtonContainer } from "./LogInButtonContainer";
import styles from "./TopRightButtons.module.css";
@ -36,7 +36,7 @@ export function TopRightButtons({
<div className={styles.searchAndAddContainer}>
{showSearch ? (
<div className={styles.searchWrapper}>
<CommandPalette />
<GlobalSearch />
</div>
) : null}
<div className={styles.addNewWrapper}>

View File

@ -30,7 +30,7 @@ import {
weaponBuildPopularPage,
weaponBuildStatsPage,
} from "~/utils/urls";
import styles from "./CommandPalette.module.css";
import styles from "./GlobalSearch.module.css";
const WEAPON_DESTINATIONS = [
"builds",