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:
parent
d7eb490ac0
commit
81c6a4a023
2 changed files with 14 additions and 6 deletions
|
@ -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"
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue