Do not show copy button in non-secured contexts and add product number to the card header #122

Merged
sb10q merged 1 commits from esavkin/web2019:115-json-copy-and-codename-n into master 2024-02-21 12:12:13 +08:00
3 changed files with 13 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@ export function ProductItem({card_index}) {
<section className="productItem"> <section className="productItem">
<div className="content"> <div className="content">
<h3 style={{'marginBottom': card.name_codename ? '5px' : '20px'}}>{card.name}</h3> <h3 style={{'marginBottom': card.name_codename ? '5px' : '20px'}}>{card.name_number} {card.name}</h3>
{card.name_codename ? ( {card.name_codename ? (
<p>{card.name_codename}</p> <p>{card.name_codename}</p>
) : null} ) : null}

View File

@ -79,12 +79,17 @@ export function ShowJSON() {
placeholder="There should be description of the crate"/> placeholder="There should be description of the crate"/>
<div className="d-flex flex-column flex-sm-row justify-content-end"> <div className="d-flex flex-column flex-sm-row justify-content-end">
{window.isSecureContext && (
<a type="button" <a type="button"
onClick={() => {copyToClipboard(description)}} onClick={() => {
copyToClipboard(description)
}}
className={"btn btn-sm m-0 mb-1 mt-2 mb-sm-0 me-sm-2 " + copyButtonStates[copiedState].style} className={"btn btn-sm m-0 mb-1 mt-2 mb-sm-0 me-sm-2 " + copyButtonStates[copiedState].style}
> >
{copyButtonStates[copiedState].content} {copyButtonStates[copiedState].content}
</a> </a>
)}
<a type="button" onClick={closeDescription} <a type="button" onClick={closeDescription}
className="btn btn-sm btn-outline-primary m-0 mb-1 mt-2 mb-sm-0 me-sm-2">Close</a> className="btn btn-sm btn-outline-primary m-0 mb-1 mt-2 mb-sm-0 me-sm-2">Close</a>
</div> </div>