Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-832: NFT page re-design. Main info #931

Merged
merged 43 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
af8ba2b
TW-826: Collectibles re-design
alex-tsx Jun 23, 2023
8bc0474
TW-828: Collectibles grid layout
alex-tsx Jun 24, 2023
3430d15
TW-828: Collectibles grid layout. + Scroll tabsbar into view
alex-tsx Jun 26, 2023
65183c2
TW-828: Collectibles grid layout. ++ Images
alex-tsx Jun 26, 2023
079102d
TW-864: Collectibles hover effect
alex-tsx Jun 26, 2023
8898d8d
TW-828: Collectibles grid layout. Refactor
alex-tsx Jun 26, 2023
a7e1dca
Merge branch 'development' into TW-828-collectibles-grid
alex-tsx Jun 26, 2023
91b219a
TW-828: Collectibles grid layout. Refactor
alex-tsx Jun 29, 2023
fd976af
TW-830: Collectibles Manage dropdown. + Detailed grid
alex-tsx Jun 29, 2023
b47a127
TW-830: Collectibles Manage dropdown. + Detailes toggle
alex-tsx Jul 3, 2023
6672f10
TW-830: Collectibles Manage dropdown. + Floor prices
alex-tsx Jul 3, 2023
531ab18
Merge branch 'development' into TW-830-collectibles-manage-dropdown
alex-tsx Jul 4, 2023
c19133b
Merge branch 'development' into TW-828-collectibles-grid
alex-tsx Jul 4, 2023
1583a18
TW-828: Collectibles grid layout. Fix after QA
alex-tsx Jul 4, 2023
3c5b1e4
Merge branch 'TW-828-collectibles-grid' into TW-830-collectibles-mana…
alex-tsx Jul 4, 2023
0757ded
TW-830: Collectibles Manage dropdown. Fix floor price currency
alex-tsx Jul 4, 2023
76f3d2f
TW-830: Collectibles Manage dropdown. Refactor
alex-tsx Jul 5, 2023
e14d147
TW-830: Collectibles Manage dropdown. Refactor
alex-tsx Jul 5, 2023
ea9ab54
TW-830: Collectibles Manage dropdown. Refactor
alex-tsx Jul 5, 2023
b4b43fb
Merge branch 'development' into TW-830-collectibles-manage-dropdown
alex-tsx Jul 5, 2023
76a3a5a
add main info for nft details screen
Boltman92 Jul 6, 2023
b891a6a
fix creators and galleries name
Boltman92 Jul 6, 2023
b9bb096
fix merge conflicts
Boltman92 Jul 6, 2023
ef7d2ec
fix comments after review
Boltman92 Jul 6, 2023
dd12f29
delete useless code
Boltman92 Jul 6, 2023
5d6a994
TW-830: Collectibles Manage dropdown. Fix QA. Loading details by slugs
alex-tsx Jul 6, 2023
be31160
TW-830: Collectibles Manage dropdown. Fix QA. By design
alex-tsx Jul 6, 2023
de83dd4
TW-830: Collectibles Manage dropdown. Fix QA. Scroll to the tabs bar
alex-tsx Jul 6, 2023
119bff1
TW-830: Collectibles Manage dropdown. Fix QA. Refactor
alex-tsx Jul 6, 2023
00a02a3
fix after review: add dependencies for hook, update tailwind config
Boltman92 Jul 7, 2023
4808f81
fix margin
Boltman92 Jul 7, 2023
4b72ec6
Merge branch 'development' into TW-830-collectibles-manage-dropdown
alex-tsx Jul 10, 2023
9c7b2f7
TW-830: Collectibles Manage dropdown. Fix QA. 2 decimals for unletter…
alex-tsx Jul 10, 2023
5c0f445
TW-830: Collectibles Manage dropdown. Refactor
alex-tsx Jul 10, 2023
e15b61c
Merge branch 'development' into tw-832/nft-main-info
alex-tsx Jul 11, 2023
5a8e0ea
TW-832: NFT page. Main Info. Fix QA
alex-tsx Jul 11, 2023
a48227f
Merge branch 'TW-830-collectibles-manage-dropdown' into tw-832/nft-ma…
alex-tsx Jul 11, 2023
66a2dd3
TW-832: NFT page. Main Info. + 'Send' button
alex-tsx Jul 12, 2023
64aacd4
Merge branch 'development' into tw-832/nft-main-info
alex-tsx Jul 12, 2023
f9890fe
TW-832: NFT page. Main info. Refactor
alex-tsx Jul 12, 2023
70d32fc
TW-832: NFT page. Main info. Refactor
alex-tsx Jul 12, 2023
f58e52b
Merge branch 'TW-760-epic-nft-update' into TW-832-nft-page-update-mai…
alex-tsx Jul 12, 2023
2851121
TW-832: NFT page. Main info. Refactor
alex-tsx Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3065,6 +3065,12 @@
"creditCard": {
"message": "credit card"
},
"creator": {
"message": "Creator:"
},
"creators": {
"message": "Creators:"
},
"subscribeToNewsletter": {
"message": "Subscribe to our Newsletter"
},
Expand Down
6 changes: 3 additions & 3 deletions public/_locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@
}
}
},
"showInfo": {
"message": "Деталі"
}
"showInfo": { "message": "Деталі" },
"creator": { "message": "Автор:" },
"creators": { "message": "Автори:" }
}
39 changes: 12 additions & 27 deletions src/app/atoms/FormSubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ import React, { FC } from 'react';
import classNames from 'clsx';

import Spinner from 'app/atoms/Spinner/Spinner';
import { T } from 'lib/i18n';
import { setAnotherSelector } from 'lib/analytics';

import { setAnotherSelector } from '../../lib/analytics';
import { ButtonProps, Button } from './Button';

interface FormSubmitButtonProps extends ButtonProps {
searchingRoute?: boolean;
keepChildrenWhenLoading?: boolean;
loading?: boolean;
small?: boolean;
textClassNames?: string;
}

export const FormSubmitButton: FC<FormSubmitButtonProps> = ({
loading,
searchingRoute,
keepChildrenWhenLoading,
small,
disabled,
className,
Expand All @@ -31,30 +30,20 @@ export const FormSubmitButton: FC<FormSubmitButtonProps> = ({
paddingBottom: small ? '0.5rem' : '0.625rem',
...style
};

const compoundedClassName = classNames(
'relative flex items-center',
'rounded border-2 font-semibold h-12',
'relative flex items-center justify-center h-12 gap-x-2',
'text-primary-orange-lighter font-semibold rounded border-2',
'transition duration-200 ease-in-out',
small ? 'px-6' : 'px-8',
small ? 'text-sm' : 'text-base',
loading ? 'text-transparent' : 'text-primary-orange-lighter',
small ? 'px-6 text-sm' : 'px-8 text-base',
disabled ? 'bg-gray-400 border-gray-400' : 'bg-primary-orange border-primary-orange',
loading || disabled || searchingRoute ? 'opacity-75' : 'opacity-90 hover:opacity-100 focus:opacity-100',
loading || disabled || searchingRoute ? 'pointer-events-none' : 'shadow-sm hover:shadow focus:shadow',
loading || disabled
? 'opacity-75 pointer-events-none'
: 'opacity-90 hover:opacity-100 focus:opacity-100 shadow-sm hover:shadow focus:shadow',
className
);

if (loading) {
return (
<Button className={compoundedClassName} style={compoundedStyle} disabled={disabled} {...rest}>
<div className="flex items-center justify-center">
<Spinner theme="white" style={{ width: small ? '2rem' : '3rem' }} />
</div>
</Button>
);
}

if (searchingRoute) {
return (
<Button
className={compoundedClassName}
Expand All @@ -63,12 +52,8 @@ export const FormSubmitButton: FC<FormSubmitButtonProps> = ({
{...rest}
{...setAnotherSelector('loading', '')}
>
<div className="flex items-center justify-center gap-x-2">
<Spinner theme="white" style={{ width: small ? '2rem' : '3rem' }} />
<span>
<T id="searchingTheBestRoute" />
</span>
</div>
<Spinner theme="white" style={{ width: small ? '2rem' : '3rem' }} />
{keepChildrenWhenLoading && children}
</Button>
);
}
Expand Down
26 changes: 14 additions & 12 deletions src/app/icons/broken-image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/app/icons/globe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/app/icons/language.svg

This file was deleted.

41 changes: 41 additions & 0 deletions src/app/pages/Collectibles/CollectibleImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { FC } from 'react';

import Spinner from 'app/atoms/Spinner/Spinner';
import { ReactComponent as BrokenImageSvg } from 'app/icons/broken-image.svg';
import { AssetImage } from 'app/templates/AssetImage';
import { AssetMetadataBase } from 'lib/metadata';

interface Props {
assetSlug: string;
metadata?: AssetMetadataBase;
large?: boolean;
className?: string;
style?: React.CSSProperties;
}

export const CollectibleImage: FC<Props> = ({ metadata, assetSlug, large, className, style }) => (
<AssetImage
metadata={metadata}
assetSlug={assetSlug}
loader={<ImageLoader large={large} />}
fallback={<ImageFallback large={large} />}
className={className}
style={style}
/>
);

interface ImageFallbackProps {
large?: boolean;
}

const ImageLoader: FC<ImageFallbackProps> = ({ large }) => (
<div className="w-full h-full flex items-center justify-center">
<Spinner theme="dark-gray" className={large ? 'w-10' : 'w-8'} />
</div>
);

const ImageFallback: FC<ImageFallbackProps> = ({ large }) => (
<div className="w-full h-full flex items-center justify-center">
<BrokenImageSvg height={large ? '23%' : '32%'} />
</div>
);
6 changes: 3 additions & 3 deletions src/app/pages/Collectibles/CollectibleItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { atomsToTokens } from 'lib/temple/helpers';
import { useIntersectionDetection } from 'lib/ui/use-intersection-detection';
import { Link } from 'lib/woozie';

import { CollectibleItemImage } from './CollectibleItemImage';
import { CollectibleImage } from './CollectibleImage';

interface Props {
assetSlug: string;
Expand All @@ -30,7 +30,7 @@ export const CollectibleItem: FC<Props> = ({ assetSlug, accountPkh, areDetailsSh
const details = useCollectibleDetailsSelector(assetSlug);

const listing = useMemo(() => {
if (!isDefined(details)) return null;
if (!details?.listing) return null;

const { floorPrice, currencyId } = details.listing;
const currency = objktCurrencies[currencyId];
Expand Down Expand Up @@ -59,7 +59,7 @@ export const CollectibleItem: FC<Props> = ({ assetSlug, accountPkh, areDetailsSh
)}
title={assetName}
>
{displayed && <CollectibleItemImage metadata={metadata} assetSlug={assetSlug} />}
{displayed && <CollectibleImage metadata={metadata} assetSlug={assetSlug} />}

{areDetailsShown && balance ? (
<div className="absolute bottom-1.5 left-1.5 text-2xs text-white leading-none p-1 bg-black bg-opacity-60 rounded">
Expand Down
27 changes: 0 additions & 27 deletions src/app/pages/Collectibles/CollectibleItemImage.tsx

This file was deleted.

Loading
Loading