feat(ui): add callouts for new and updated icons

This commit is contained in:
rektdeckard
2021-11-26 22:03:01 -05:00
parent f256109ba4
commit cdcf38466e
6 changed files with 37 additions and 6 deletions

View File

@@ -114,3 +114,16 @@ a.main-link:after {
a.main-link:hover:after {
width: 0%;
}
.badge.new {
color: #ff6e60;
}
.badge.updated {
color: #397fff;
}
.badge {
font-size: 24px;
line-height: 0.5em;
}

View File

@@ -14,7 +14,15 @@ import TagCloud from "./TagCloud";
import Notice from "../Notice/Notice";
import "./IconGrid.css";
const defaultSearchTags = ["*new*", "communication", "editor", "emoji", "maps", "weather"];
const defaultSearchTags = [
"*new*",
"*updated*",
"communication",
"editor",
"emoji",
"maps",
"weather",
];
type IconGridProps = {};

View File

@@ -36,6 +36,8 @@ const IconGridItem: React.FC<IconGridItemProps> = (props) => {
const { name, Icon } = entry;
const [open, setOpen] = useRecoilState(iconPreviewOpenAtom);
const isOpen = open === name;
const isNew = entry.tags.includes("*new*");
const isUpdated = entry.tags.includes("*updated*");
const delayRef = useRef<number>(0);
const offset = useRef({ top: 0, left: 0 });
const ref = useRef<any>();
@@ -84,7 +86,11 @@ const IconGridItem: React.FC<IconGridItemProps> = (props) => {
onClick={handleOpen}
>
<Icon />
<p>{name}</p>
<p>
{name}
{isNew && <span className="badge new"></span>}
{isUpdated && <span className="badge updated"></span>}
</p>
</motion.div>
<AnimatePresence initial={false}>
{isOpen && <DetailsPanel {...props} />}

View File

@@ -29,6 +29,8 @@ const TagCloud: React.FC<TagCloudProps> = ({ name, tags, isDark }) => {
onClick={() => void handleTagClick(tag)}
>
<code className={`${isDark ? "dark" : ""}`}>{tag}</code>
{tag === "*new*" && <span className="badge new"></span>}
{tag === "*updated*" && <span className="badge updated"></span>}
</button>
))}
</div>

View File

@@ -1682,6 +1682,7 @@ export const icons: ReadonlyArray<IconEntry> = [
IconCategory.OBJECTS,
],
tags: [
"*updated*",
"addition",
"sum",
"subtraction",
@@ -9189,6 +9190,7 @@ export const icons: ReadonlyArray<IconEntry> = [
"machinery",
"mechanical",
"repairs",
"*updated*",
],
Icon: Icons.Wrench,
},