Skip to content

Commit

Permalink
Fix: Nft preview unavailable box (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuliomir authored Dec 17, 2024
1 parent f3de5a1 commit 818dfaf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/token/TokenConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import NewHathorAlert from '../NewHathorAlert';
import { useNewUiEnabled } from '../../hooks';
import { ReactComponent as CopyIcon } from '../../assets/images/copy-icon.svg';
import { ReactComponent as DownloadIcon } from '../../assets/images/download-icon.svg';
import HathorAlert from '../HathorAlert';

const TokenConfig = props => {
const newUiEnabled = useNewUiEnabled();
Expand Down Expand Up @@ -101,7 +102,7 @@ const TokenConfig = props => {
</a>
</p>
</div>
<NewHathorAlert ref={alertSuccess} text={successMessage} type="success" />
<HathorAlert ref={alertSuccess} text={successMessage} type="success" />
</>
);
};
Expand Down
15 changes: 15 additions & 0 deletions src/components/token/TokenNFTPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import {
VIDEO_MEDIA_TYPES_BY_EXTENSION,
AUDIO_MEDIA_TYPES_BY_EXTENSION,
} from '../../constants';
import { useNewUiEnabled } from '../../hooks';

const TokenNFTPreview = props => {
const [token, setToken] = useState(props.token);
const isNewUiEnabled = useNewUiEnabled();

useEffect(() => {
// ensure data binding with props.token re rendering when changed
Expand Down Expand Up @@ -105,6 +107,19 @@ const TokenNFTPreview = props => {
media = <p> Preview Unavailable </p>;
}

if (isNewUiEnabled) {
return (
<div className="token-nft-preview">
<p>
<strong>NFT PREVIEW</strong>
</p>
<figure className="figure flex-fill p-4 d-flex align-items-center justify-content-center">
{media}
</figure>
</div>
);
}

return (
<div className="d-flex flex-column token-nft-preview">
<p>
Expand Down
31 changes: 31 additions & 0 deletions src/newUi.scss
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,37 @@ nav {
height: 28px;
}
}

.token-nft-preview {
padding: 32px;
background-color: var(--secondary-color);
border: 1px solid var(--border-color);
border-radius: 15px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 40px;
min-width: 100%;

p {
border: none;
}

strong {
color: $purpleHathorButton;
font-size: 16px;
}

figure p {
color: var(--bold-text-color);
font-size: 16px;
font-weight: 700;
line-height: 20px;
letter-spacing: 0.03em;
text-align: center;
}
}
}

.container-title-page {
Expand Down

0 comments on commit 818dfaf

Please sign in to comment.