From 11b1922f498b930a6104b01409247bcf1ba7aeff Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Tue, 4 Jun 2024 11:04:43 -0600 Subject: [PATCH] fix(app): update vue snippet syntax --- src/utils/index.ts | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 23b7389..892f801 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -30,38 +30,29 @@ export function getCodeSnippets({ const { r, g, b } = TinyColor(color).toRgb(); return { - [SnippetType.HTML]: ``, - [SnippetType.REACT]: `<${displayName} size={${size}} ${ - !isDefaultColor ? `color="${color}" ` : "" - }${isDefaultWeight ? "" : `weight="${weight}" `}/>`, - [SnippetType.VUE]: ``, + [SnippetType.HTML]: ``, + [SnippetType.REACT]: `<${displayName} size={${size}} ${!isDefaultColor ? `color="${color}" ` : "" + }${isDefaultWeight ? "" : `weight="${weight}" `}/>`, + [SnippetType.VUE]: ``, [SnippetType.FLUTTER]: `Icon(\n PhosphorIcons.${displayName.replace( /^\w/, (c) => c.toLowerCase() - )}${ - isDefaultWeight ? "" : weight.replace(/^\w/, (c) => c.toUpperCase()) - },\n size: ${size.toFixed(1)},\n${ - !isDefaultColor ? ` color: Color(0xff${color.replace("#", "")}),\n` : "" - })`, - [SnippetType.ELM]: `Phosphor.${camelName}${ - isDefaultWeight ? "" : " " + pascalWeight - } + )}${isDefaultWeight ? "" : weight.replace(/^\w/, (c) => c.toUpperCase()) + },\n size: ${size.toFixed(1)},\n${!isDefaultColor ? ` color: Color(0xff${color.replace("#", "")}),\n` : "" + })`, + [SnippetType.ELM]: `Phosphor.${camelName}${isDefaultWeight ? "" : " " + pascalWeight + } |> withSize ${size} |> withSizeUnit "px" |> toHtml []`, - [SnippetType.SWIFT]: `Ph.${camelName}.${weight}${ - !isDefaultColor + [SnippetType.SWIFT]: `Ph.${camelName}.${weight}${!isDefaultColor ? `\n .color(red: ${u8ToCGFloatStr(r)}, green: ${u8ToCGFloatStr( - g - )}, blue: ${u8ToCGFloatStr(b)})` + g + )}, blue: ${u8ToCGFloatStr(b)})` : "" - } + } .frame(width: ${size}, height: ${size}) `, };