From 9ac41bc907e6cd776e1c9000164ddb746cfa044a Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 20 Aug 2024 03:49:36 +0000 Subject: [PATCH] =?UTF-8?q?initIcon=E2=86=92tsx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/{initIcon.js => initIcon.tsx} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename lib/{initIcon.js => initIcon.tsx} (73%) diff --git a/lib/initIcon.js b/lib/initIcon.tsx similarity index 73% rename from lib/initIcon.js rename to lib/initIcon.tsx index fd74a08..ad49ea2 100644 --- a/lib/initIcon.js +++ b/lib/initIcon.tsx @@ -1,7 +1,8 @@ import React from "react"; import { Ionicons, AntDesign } from "@expo/vector-icons"; - -export const initIcon = (name, type) => { +type name = keyof typeof Ionicons.glyphMap & keyof typeof AntDesign.glyphMap; +type type = "Ionicons" | "AntDesign"; +export const initIcon = (name: name, type:type) => { switch (type) { case "Ionicons": return ({ focused, color, size }) => (