mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-05 20:56:13 -05:00
Rename CommandPalette -> GlobalSearch
This commit is contained in:
parent
7d9d00b22b
commit
7f2b496e3c
|
|
@ -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,
|
||||
}: {
|
||||
|
|
@ -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}>
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user