Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implementDEPRECATED_ICONS#21346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jakehwll wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromjakehwll/21320-deprecated-icons-cleanup
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletionssite/src/components/IconField/EmojiPicker.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
import data from "@emoji-mart/data/sets/15/apple.json";
import EmojiMart from "@emoji-mart/react";
import { type ComponentProps, type FC, useEffect } from "react";
import { DEPRECATED_ICONS } from "theme/deprecatedIcons";
import icons from "theme/icons.json";

const custom = [
{
id: "icons",
name: "Icons",
emojis: icons.map((icon) => {
const id = icon.split(".")[0];
emojis: icons
.filter((icon) => !DEPRECATED_ICONS.includes(icon))
.map((icon) => {
const id = icon.split(".")[0];

return {
id,
name: id,
keywords: id.split("-"),
skins: [{ src: `/icon/${icon}` }],
};
}),
return {
id,
name: id,
keywords: id.split("-"),
skins: [{ src: `/icon/${icon}` }],
};
}),
},
];

Expand Down
11 changes: 8 additions & 3 deletionssite/src/pages/IconsPage/IconsPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,7 @@ import {
} from "components/Tooltip/Tooltip";
import { SearchIcon, XIcon } from "lucide-react";
import { type FC, type ReactNode, useMemo, useState } from "react";
import { DEPRECATED_ICONS } from "theme/deprecatedIcons";
import {
defaultParametersForBuiltinIcons,
parseImageParameters,
Expand All@@ -26,7 +27,8 @@ import icons from "theme/icons.json";
import uFuzzy from "ufuzzy";
import { pageTitle } from "utils/page";

const iconsWithoutSuffix = icons.map((icon) => icon.split(".")[0]);
const filteredIcons = icons.filter((icon) => !DEPRECATED_ICONS.includes(icon));
const iconsWithoutSuffix = filteredIcons.map((icon) => icon.split(".")[0]);
const fuzzyFinder = new uFuzzy({
intraMode: 1,
intraIns: 1,
Expand All@@ -42,7 +44,10 @@ const IconsPage: FC = () => {

const searchedIcons = useMemo(() => {
if (!searchText) {
return icons.map((icon) => ({ url: `/icon/${icon}`, description: icon }));
return filteredIcons.map((icon) => ({
url: `/icon/${icon}`,
description: icon,
}));
}

const [map, info, sorted] = fuzzyFinder.search(
Expand All@@ -56,7 +61,7 @@ const IconsPage: FC = () => {
}

return sorted.map((i) => {
const iconName =icons[info.idx[i]];
const iconName =filteredIcons[info.idx[i]];
const ranges = info.ranges[i];

const nodes: ReactNode[] = [];
Expand Down
23 changes: 23 additions & 0 deletionssite/src/theme/deprecatedIcons.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
/**
* Deprecated icons are icons that are no longer maintained.
* They are kept here for backward compatibility, however they
* are not displayed in the emoji picker and are not included in
* the icon list.
*/

export const DEPRECATED_ICONS = [
// we have alternatives in `apple-black.svg`.
"apple-grey.svg",
// we have alternatives in `aws.svg`.
"aws-monochrome.svg",
// we already serve this in `aws.svg`.
"aws.png",
// we already serve this in `azure.svg`.
"azure.png",
// we already serve this in `docker.svg`.
"docker.png",
// we have alternatives in `docker.svg`.
"docker-white.svg",
// we already serve this in `k8s.svg`.
"k8s.png",
] satisfies string[];
Loading

[8]ページ先頭

©2009-2025 Movatter.jp