From 1865d62945fdb23f1df300209a1984fceb6242ec Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 1 Jun 2021 17:29:13 -0700 Subject: [PATCH] Clarify that outfit page links won't change I add copy to indicate this, and update the tool to respond with a happy-looking no-change UI when you put in an outfit page link! --- src/app/OutfitUrlsPage.js | 72 +++++++++++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/src/app/OutfitUrlsPage.js b/src/app/OutfitUrlsPage.js index ffe0285..4067a18 100644 --- a/src/app/OutfitUrlsPage.js +++ b/src/app/OutfitUrlsPage.js @@ -60,7 +60,12 @@ function OutfitUrlsPage() {

Hi, friends! Sorry for the trouble 😓 In short, by switching to the new outfit URLs below, we'll decrease our hosting costs by - $20/month! 🙏 + $30/month! 🙏 +

+

+ This change applies to image embeds, for{" "} + img tags in your lookups and petpages. Other kinds of + outfit links will stay the same!

@@ -83,13 +88,13 @@ function OutfitUrlsPage() {

So, we've moved our apps to a new, more cost-efficient way to share outfit images! But, until we delete the old images from Amazon S3 - altogether, we're still paying $20/month just to support + altogether, we're still paying $30/month just to support the old amazonaws.com URLs.

I looked hard for a way to redirect the old Amazon URLs to our new service, but it seems to not be possible, and it seems like - $20/month could be better spent another way 😖 + $30/month could be better spent another way 😖

We haven't removed these images from Amazon yet, so old image URLs @@ -145,8 +150,19 @@ function SingleImageConverter() { parseError = e; } - const previewBackground = useColorModeValue("gray.200", "whiteAlpha.300"); + const isAlreadyConverted = parseError instanceof UrlAlreadyConvertedError; + const isInvalid = parseError && !isAlreadyConverted; + if (isAlreadyConverted) { + outputUrl = inputUrl; + } + const previewImageUrl = isAlreadyConverted + ? buildNewOutfitUrl({ outfitId: parseError.outfitId, size: 300 }) + : outputUrl?.endsWith("png") + ? outputUrl + : null; + + const previewBackground = useColorModeValue("gray.200", "whiteAlpha.300"); const { onCopy, hasCopied } = useClipboard(outputUrl); return ( @@ -167,7 +183,7 @@ function SingleImageConverter() { rowGap="2" justifyItems="center" > - + Enter an outfit image URL {parseError?.message || null} - - Then, use this new URL in your layouts instead: - + + + Then, use this new URL in your layouts instead: + + + {isAlreadyConverted && ( + + + {parseError.message} + + )} + {outputUrl && ( @@ -213,10 +238,10 @@ function SingleImageConverter() { overflow="hidden" >

- {outputUrl && ( + {previewImageUrl && (