Compare commits

..

No commits in common. "bb0d21950891c43ac4fbbcb0989a9ccebc981503" and "d3d3297a28c72442fd568a2d34d8484c5c2a5ca4" have entirely different histories.

4 changed files with 2 additions and 65 deletions

View file

@ -39,11 +39,6 @@
padding-left: 1em padding-left: 1em
font-size: 85% font-size: 85%
a, button
/* When item names get long, don't let the buttons wrap to give the
* item names more space. The names should wrap more instead! */
text-wrap: nowrap
tbody tbody
tr tr
&:hover, &:focus-within &:hover, &:focus-within

View file

@ -171,13 +171,7 @@ class ItemsController < ApplicationController
appearance_params[:color_id], appearance_params[:species_id]) appearance_params[:color_id], appearance_params[:species_id])
end end
target.appearances_for(@items.map(&:id), swf_asset_includes: [:zone]). target.appearances_for(@items.map(&:id), swf_asset_includes: [:zone])
tap do |appearances|
# Preload the manifests for these SWF assets concurrently, rather than
# loading them in sequence when we generate the JSON.
swf_assets = appearances.values.map(&:swf_assets).flatten
SwfAsset.preload_manifests(swf_assets)
end
end end
def search_error(e) def search_error(e)

View file

@ -31,20 +31,12 @@ import {
CheckIcon, CheckIcon,
DeleteIcon, DeleteIcon,
EditIcon, EditIcon,
ExternalLinkIcon,
QuestionIcon, QuestionIcon,
WarningTwoIcon, WarningTwoIcon,
} from "@chakra-ui/icons"; } from "@chakra-ui/icons";
import { CSSTransition, TransitionGroup } from "react-transition-group"; import { CSSTransition, TransitionGroup } from "react-transition-group";
import { useSearchParams } from "react-router-dom";
import { import { Delay, ErrorMessage, Heading1, Heading2 } from "../util";
Delay,
ErrorMessage,
Heading1,
Heading2,
useLocalStorage,
} from "../util";
import Item, { ItemListContainer, ItemListSkeleton } from "./Item"; import Item, { ItemListContainer, ItemListSkeleton } from "./Item";
import { BiRename } from "react-icons/bi"; import { BiRename } from "react-icons/bi";
import { IoCloudUploadOutline } from "react-icons/io5"; import { IoCloudUploadOutline } from "react-icons/io5";
@ -278,45 +270,6 @@ function ItemZoneGroupSkeleton({ itemCount }) {
); );
} }
/**
* GetTheseItemsButton shows the "Get these items!" button, to link to the
* Item Getting Guide page for the items in this outfit. If there are no items
* being worn, this is disabled.
*/
function GetTheseItemsButton({ outfitState }) {
const [searchParams] = useSearchParams();
const [isVisible, setIsVisible] = useLocalStorage("DTIShowGetTheseItems");
// Enable this feature by visiting `/outfits/new?features=get-these-items`.
React.useEffect(() => {
const features = searchParams.get("features") ?? "";
if (features.split(",").includes("get-these-items")) {
setIsVisible(true);
}
}, [searchParams, setIsVisible]);
const itemIds = [...outfitState.wornItemIds].sort();
const targetUrl = `/items/sources/${itemIds.join(",")}`;
const isDisabled = itemIds.length === 0;
if (!isVisible) {
return null;
}
return (
<Button
as={isDisabled ? "button" : "a"}
href={isDisabled ? undefined : targetUrl}
target={isDisabled ? undefined : "_blank"}
colorScheme="purple"
rightIcon={<ExternalLinkIcon />}
isDisabled={isDisabled}
>
Get these items!
</Button>
);
}
/** /**
* OutfitSavingIndicator shows a Save button, or the "Saved" or "Saving" state, * OutfitSavingIndicator shows a Save button, or the "Saved" or "Saving" state,
* if the user can save this outfit. If not, this is empty! * if the user can save this outfit. If not, this is empty!
@ -450,9 +403,6 @@ function OutfitHeading({ outfitState, outfitSaving, dispatchToOutfit }) {
</Box> </Box>
</Box> </Box>
<Box width="4" flex="1 0 auto" /> <Box width="4" flex="1 0 auto" />
<Box flex="0 0 auto">
<GetTheseItemsButton outfitState={outfitState} />
</Box>
<Box flex="0 0 auto"> <Box flex="0 0 auto">
<OutfitSavingIndicator outfitSaving={outfitSaving} /> <OutfitSavingIndicator outfitSaving={outfitSaving} />
</Box> </Box>

View file

@ -1,5 +1,3 @@
- subtitle = nil unless defined? subtitle
%tr %tr
%td.thumbnail-cell %td.thumbnail-cell
= link_to item_thumbnail_for(item), item, target: "_blank", = link_to item_thumbnail_for(item), item, target: "_blank",