1
0
Fork 0
forked from OpenNeo/impress

Add outfit name to Shopping List page title

Just some extra flair! I had considered something like this before, but
felt it didn't flow well with the old title.
This commit is contained in:
Emi Matchu 2024-07-09 13:19:23 -07:00
parent d7eb490ac0
commit 81c6a4a023
2 changed files with 14 additions and 6 deletions

View file

@ -295,14 +295,20 @@ function GetTheseItemsButton({ outfitState }) {
}
}, [searchParams, setIsVisible]);
const itemIds = [...outfitState.wornItemIds].sort();
const targetUrl = `/items/sources/${itemIds.join(",")}`;
const isDisabled = itemIds.length === 0;
if (!isVisible) {
return null;
}
const itemIds = [...outfitState.wornItemIds].sort();
const isDisabled = itemIds.length === 0;
let targetUrl = `/items/sources/${itemIds.join(",")}`;
if (outfitState.name != null && outfitState.name.trim().length > 0) {
const params = new URLSearchParams();
params.append("for", outfitState.name);
targetUrl += "?" + params.toString();
}
return (
<Tooltip
label="Shopping list"

View file

@ -1,5 +1,7 @@
- title "Shopping List"
%h1#title Shopping List
- page_title = params[:for] ? "Shopping List for \"#{params[:for]}\"" : "Shopping List"
- title page_title
%h1#title= page_title
:markdown
Here's a custom shopping list for exactly the items in your outfit!