From 96de85bb879393566e54028efe513a20856c266f Mon Sep 17 00:00:00 2001 From: Fredthedoggy <45927799+fredthedoggy@users.noreply.github.com> Date: Tue, 12 Apr 2022 23:06:21 -0400 Subject: [PATCH 1/2] Start of UUID converter --- components/nav.ts | 186 ++++++++++++++++++++------------------ pages/converters/uuid.tsx | 26 ++++++ 2 files changed, 123 insertions(+), 89 deletions(-) create mode 100644 pages/converters/uuid.tsx diff --git a/components/nav.ts b/components/nav.ts index 60ebc2c..20b254c 100644 --- a/components/nav.ts +++ b/components/nav.ts @@ -1,97 +1,105 @@ -import { IconProp } from "@fortawesome/fontawesome-svg-core"; +import {IconProp} from "@fortawesome/fontawesome-svg-core"; import { - faCommentDots, - faFileCode, - faFileCircleCheck, - faFilePen, - faPaste, - faFileCircleQuestion, - faHouseCircleCheck, - faComment, - faTurnUp, + faCommentDots, + faFileCode, + faFileCircleCheck, + faFilePen, + faPaste, + faFileCircleQuestion, + faHouseCircleCheck, + faComment, + faTurnUp, + faIdCard, } from "@fortawesome/free-solid-svg-icons"; -export const Tools: Record< - string, - ToolboxTool[] | Record -> = { - Converters: { - ChatChat: [ - { - name: "DeluxeChat Convert", - short: "DeluxeChat", - icon: faCommentDots, - description: "Convert DeluxeChat Configs to ChatChat Configs", - link: "/converters/chatchat/deluxechat", - }, - { - name: "Essentials Convert", - short: "Essentials", - icon: faHouseCircleCheck, - description: "Convert EssentialsChat Configs to ChatChat Configs", - link: "/converters/chatchat/essentialschat", - }, - { - name: "VentureChat Convert", - short: "VentureChat", - icon: faComment, - description: "Convert VentureChat Configs to ChatChat Configs", - link: "/converters/chatchat/venturechat", - }, - ], - Legacy: [ - { - name: "Legacy Text Convert", - short: "MiniMessage", - icon: faTurnUp, - description: "Convert Legacy Strings to MiniMessage Strings", - link: "/converters/legacy/minimessage", - }, - ], - }, - Validators: [ - { - name: "Yaml Validator", - short: "Yaml", - icon: faFileCode, - description: "Check your config before you wreck your config", - link: "/validators/yaml", - }, - { - name: "Properties Validator", - short: "Properties", - icon: faFileCircleCheck, - description: "Validate Properties Files", - link: "/validators/properties", - }, - { - name: "Toml Validator", - short: "Toml", - icon: faFilePen, - description: "Validate Toml Files", - link: "/validators/toml", +export const Tools: Record> = { + Converters: { + ChatChat: [ + { + name: "DeluxeChat Convert", + short: "DeluxeChat", + icon: faCommentDots, + description: "Convert DeluxeChat Configs to ChatChat Configs", + link: "/converters/chatchat/deluxechat", + }, + { + name: "Essentials Convert", + short: "Essentials", + icon: faHouseCircleCheck, + description: "Convert EssentialsChat Configs to ChatChat Configs", + link: "/converters/chatchat/essentialschat", + }, + { + name: "VentureChat Convert", + short: "VentureChat", + icon: faComment, + description: "Convert VentureChat Configs to ChatChat Configs", + link: "/converters/chatchat/venturechat", + }, + ], + Legacy: [ + { + name: "Legacy Text Convert", + short: "MiniMessage", + icon: faTurnUp, + description: "Convert Legacy Strings to MiniMessage Strings", + link: "/converters/legacy/minimessage", + }, + ], + UUID: [ + { + name: "UUID Converter", + short: "UUID", + icon: faIdCard, + description: "Convert UUIDs to Names", + link: "/converters/uuid", + } + ] }, - { - name: "Hocon Validator", - short: "Hocon", - icon: faPaste, - description: "Validate Hocon Files", - link: "/validators/hocon", - }, - { - name: "XML Validator", - short: "XML", - icon: faFileCircleQuestion, - description: "Validate XML Files", - link: "/validators/xml", - }, - ], + Validators: [ + { + name: "Yaml Validator", + short: "Yaml", + icon: faFileCode, + description: "Check your config before you wreck your config", + link: "/validators/yaml", + }, + { + name: "Properties Validator", + short: "Properties", + icon: faFileCircleCheck, + description: "Validate Properties Files", + link: "/validators/properties", + }, + { + name: "Toml Validator", + short: "Toml", + icon: faFilePen, + description: "Validate Toml Files", + link: "/validators/toml", + }, + { + name: "Hocon Validator", + short: "Hocon", + icon: faPaste, + description: "Validate Hocon Files", + link: "/validators/hocon", + }, + { + name: "XML Validator", + short: "XML", + icon: faFileCircleQuestion, + description: "Validate XML Files", + link: "/validators/xml", + }, + ], }; export type ToolboxTool = { - name: string; - short: string; - icon: IconProp; - description: string; - link: string; + name: string; + short: string; + icon: IconProp; + description: string; + link: string; }; diff --git a/pages/converters/uuid.tsx b/pages/converters/uuid.tsx new file mode 100644 index 0000000..4f41eef --- /dev/null +++ b/pages/converters/uuid.tsx @@ -0,0 +1,26 @@ +import {NextPage} from "next"; + +const UUIDConverter: NextPage = () => ( + <> +); + +async function getUserData(id: string): Promise<({ error: string } | { + id: string; + name: string; + properties?: ({ + name: string; + value: string; + signature: string; + })[]; +})> { + const data = await fetch(`https://crafthead.net/profile/${id}`) + if (data.ok || data.status === 404) { + return data.json() + } else { + return { + error: "Failed to fetch user data" + } + } +} + +export default UUIDConverter; From 3dfa9831d7cfe3fc4b1195a9af109a6c3b73ef67 Mon Sep 17 00:00:00 2001 From: Fredthedoggy <45927799+fredthedoggy@users.noreply.github.com> Date: Mon, 30 May 2022 12:56:33 -0400 Subject: [PATCH 2/2] PT. 2 --- pages/converters/uuid.tsx | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/pages/converters/uuid.tsx b/pages/converters/uuid.tsx index 4f41eef..97b861e 100644 --- a/pages/converters/uuid.tsx +++ b/pages/converters/uuid.tsx @@ -1,8 +1,37 @@ import {NextPage} from "next"; +import Head from "next/head"; +import tw, {css} from "twin.macro"; +import {useState} from "react"; -const UUIDConverter: NextPage = () => ( - <> -); +const UUIDConverter: NextPage = () => { + const [input, setInput] = useState(""); + return ( +
+ + UUID Converter + + + +
+
+

HelpChat

+

UUID Converter

+
+
+