Skip to content

Commit

Permalink
TW-826: [revert] NFT update. Collectibles (#933)
Browse files Browse the repository at this point in the history
* Revert "TW-830: Collectibles Manage dropdown (#925)"

This reverts commit 998660c.

* Revert "TW-828: Collectibles grid layout (#922)"

This reverts commit 13ac5d7.
  • Loading branch information
alex-tsx authored Jul 12, 2023
1 parent 8baf012 commit aa8ec4c
Show file tree
Hide file tree
Showing 63 changed files with 619 additions and 993 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
"ts-node": "^10.4.0",
"ts-prune": "^0.10.3",
"typescript": "4.5.5",
"use-custom-compare": "^1.4.0",
"use-debounce": "7.0.1",
"use-force-update": "1.0.7",
"use-onclickoutside": "0.4.1",
Expand Down
2 changes: 1 addition & 1 deletion public/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@
"message": "Es wurden keine passenden dApps gefunden"
},
"thousandFormat": {
"message": "$thousand$K",
"message": "$thousand$k",
"placeholders": {
"thousand": {
"content": "$1"
Expand Down
5 changes: 1 addition & 4 deletions public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@
"message": "No matching dApps were found"
},
"thousandFormat": {
"message": "$thousand$K",
"message": "$thousand$k",
"placeholders": {
"thousand": {
"content": "$1"
Expand Down Expand Up @@ -2370,9 +2370,6 @@
"message": "less",
"description": "Show less"
},
"showInfo": {
"message": "Show info"
},
"recentDestinations": {
"message": "Recent destinations"
},
Expand Down
2 changes: 1 addition & 1 deletion public/_locales/pt/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@
"message": "Não foram encontrados dApps correspondentes"
},
"thousandFormat": {
"message": "$thousand$K",
"message": "$thousand$k",
"placeholders": {
"thousand": {
"content": "$1"
Expand Down
2 changes: 1 addition & 1 deletion public/_locales/tr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@
"message": "Eşleşen dApps bulunamadı"
},
"thousandFormat": {
"message": "$thousand$K",
"message": "$thousand$k",
"placeholders": {
"thousand": {
"content": "$1"
Expand Down
3 changes: 0 additions & 3 deletions public/_locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1855,8 +1855,5 @@
"content": "$1"
}
}
},
"showInfo": {
"message": "Деталі"
}
}
2 changes: 0 additions & 2 deletions src/app/WithDataLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, { FC, useEffect } from 'react';
import { useDispatch } from 'react-redux';

import { useAdvertisingLoading } from 'app/hooks/use-advertising.hook';
import { useCollectiblesDetailsLoading } from 'app/hooks/use-collectibles-details-loading';
import { useLongRefreshLoading } from 'app/hooks/use-long-refresh-loading.hook';
import { useMetadataLoading } from 'app/hooks/use-metadata-loading';
import { useTokensLoading } from 'app/hooks/use-tokens-loading';
Expand All @@ -16,7 +15,6 @@ export const WithDataLoading: FC<PropsWithChildren> = ({ children }) => {
useMetadataLoading();
useTokensLoading();
useBalancesLoading();
useCollectiblesDetailsLoading();

useLongRefreshLoading();
useAdvertisingLoading();
Expand Down
13 changes: 13 additions & 0 deletions src/app/atoms/ActivitySpinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';

import Spinner from './Spinner/Spinner';

interface ActivitySpinnerProps {
height?: string;
}

export const ActivitySpinner: React.FC<ActivitySpinnerProps> = ({ height = '21px' }) => (
<div className="w-full flex items-center justify-center overflow-hidden" style={{ height }}>
<Spinner theme="gray" className="w-16" />
</div>
);
27 changes: 13 additions & 14 deletions src/app/atoms/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ import { ReactComponent as OkIcon } from 'app/icons/ok.svg';
import { TestIDProps, setTestID, useAnalytics, AnalyticsEventCategory } from 'lib/analytics';
import { blurHandler, checkedHandler, focusHandler } from 'lib/ui/inputHandlers';

export interface CheckboxProps
extends TestIDProps,
Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'checked' | 'className' | 'onFocus' | 'onBlur' | 'onClick'> {
overrideClassNames?: string;
errored?: boolean;
onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
}
export type CheckboxProps = TestIDProps &
Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'checked' | 'className' | 'onFocus' | 'onBlur' | 'onClick'> & {
containerClassName?: string;
errored?: boolean;
onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
};

const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
(
{
overrideClassNames,
containerClassName,
errored = false,
className,
checked,
Expand Down Expand Up @@ -65,8 +64,8 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
const classNameMemo = useMemo(
() =>
classNames(
'flex justify-center items-center flex-shrink-0',
'text-white border overflow-hidden',
'flex justify-center items-center h-6 w-6 flex-shrink-0',
'text-white border rounded-md overflow-hidden',
'transition ease-in-out duration-200 disable-outline-for-click',
localChecked ? 'bg-primary-orange' : 'bg-black-40',
localFocused && 'shadow-outline',
Expand All @@ -82,9 +81,9 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
return 'border-gray-400';
}
})(),
overrideClassNames || 'h-6 w-6 rounded-md'
containerClassName
),
[localChecked, localFocused, errored]
[localChecked, localFocused, errored, containerClassName]
);

return (
Expand All @@ -102,8 +101,8 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
/>

<OkIcon
className={classNames(localChecked ? 'block' : 'hidden', 'pointer-events-none stroke-current')}
style={{ strokeWidth: 2, height: '67%', width: '67%' }}
className={classNames(localChecked ? 'block' : 'hidden', 'h-4 w-4 pointer-events-none stroke-current')}
style={{ strokeWidth: 2 }}
/>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/app/atoms/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React, { FC } from 'react';

import clsx from 'clsx';

interface DividerProps {
style?: React.CSSProperties;
className?: string;
Expand All @@ -10,10 +8,12 @@ interface DividerProps {
const Divider: FC<DividerProps> = ({ style, className }) => (
<div
style={{
width: '100%',
height: '1px',
backgroundColor: '#E2E8F0',
...style
}}
className={clsx('w-full bg-gray-300', className)}
className={className}
/>
);

Expand Down
2 changes: 1 addition & 1 deletion src/app/atoms/DonationBanner/DonationBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DONATE_MAD_FISH_URL = 'https://donate.mad.fish';

export const DonationBanner: FC = () => (
<Anchor
className="flex flex-col items-center justify-center rounded h-7 bg-blue-150 max-w-25"
className="flex flex-col items-center justify-center rounded h-7 bg-blue-150 max-w-100"
href={DONATE_MAD_FISH_URL}
testID={DonationBannerSelectors.ukraineDonationBanner}
>
Expand Down
16 changes: 5 additions & 11 deletions src/app/atoms/DropdownWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@ import CSSTransition from 'react-transition-group/CSSTransition';

type DropdownWrapperProps = HTMLAttributes<HTMLDivElement> & {
opened: boolean;
design?: Design;
hiddenOverflow?: boolean;
scaleAnimation?: boolean;
};

const DESIGN_CLASS_NAMES = {
light: 'bg-white border-gray-300',
dark: 'bg-gray-910 border-gray-850'
};

type Design = keyof typeof DESIGN_CLASS_NAMES;

const DropdownWrapper: FC<DropdownWrapperProps> = ({
opened,
design = 'light',
hiddenOverflow = true,
scaleAnimation = true,
className,
Expand All @@ -45,10 +36,13 @@ const DropdownWrapper: FC<DropdownWrapperProps> = ({
'mt-2 border rounded-md shadow-xl',
hiddenOverflow && 'overflow-hidden',
process.env.TARGET_BROWSER === 'firefox' && 'grayscale-firefox-fix',
DESIGN_CLASS_NAMES[design],
className
)}
style={style}
style={{
backgroundColor: '#1b262c',
borderColor: '#212e36',
...style
}}
{...rest}
/>
</CSSTransition>
Expand Down
4 changes: 2 additions & 2 deletions src/app/atoms/FormCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import classNames from 'clsx';
import Checkbox, { CheckboxProps } from 'app/atoms/Checkbox';
import { AnalyticsEventCategory, setTestID, useAnalytics } from 'lib/analytics';

export interface FormCheckboxProps extends CheckboxProps {
export type FormCheckboxProps = CheckboxProps & {
label?: ReactNode;
labelDescription?: ReactNode;
errorCaption?: ReactNode;
containerClassName?: string;
labelClassName?: string;
}
};

export const FormCheckbox = forwardRef<HTMLInputElement, FormCheckboxProps>(
(
Expand Down
9 changes: 6 additions & 3 deletions src/app/atoms/ImportTabSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ const ImportTabSwitcher: React.FC<ImportTabSwitcherProps> = ({ className, tabs,
<Link key={slug} to={`${urlPrefix}/${slug}`} replace>
<div
className={classNames(
'text-center cursor-pointer pb-1 pt-2 px-4 border-b-2',
'text-gray-500 truncate',
'text-center cursor-pointer pb-1 pt-2 px-4',
'text-gray-500',
'border-b-2',
active ? 'border-primary-orange' : 'border-transparent',
active ? 'text-primary-orange' : 'hover:text-primary-orange',
'transition ease-in-out duration-300',
active ? 'border-primary-orange text-primary-orange' : 'border-transparent hover:text-primary-orange'
'truncate'
)}
>
<T id={i18nKey} />
Expand Down
2 changes: 1 addition & 1 deletion src/app/atoms/Money.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const Money = memo<MoneyProps>(
);
}

if (!fiat && !shortened && decimalsLength > cryptoDecimals) {
if (!fiat && decimalsLength > cryptoDecimals && !shortened) {
return (
<MoneyWithoutFormat
tooltip={tooltip}
Expand Down
5 changes: 1 addition & 4 deletions src/app/atoms/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classNames from 'clsx';
import styles from './Spinner.module.css';

type SpinnerProps = HTMLAttributes<HTMLDivElement> & {
theme?: 'primary' | 'white' | 'gray' | 'dark-gray';
theme?: 'primary' | 'white' | 'gray';
};

const Spinner = memo<SpinnerProps>(({ theme = 'primary', className, ...rest }) => (
Expand All @@ -24,9 +24,6 @@ const Spinner = memo<SpinnerProps>(({ theme = 'primary', className, ...rest }) =
case 'white':
return 'bg-white shadow-sm';

case 'dark-gray':
return 'bg-gray-600';

case 'gray':
default:
return 'bg-gray-400';
Expand Down
15 changes: 0 additions & 15 deletions src/app/atoms/SyncSpinner.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/atoms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export { FormSecondaryButton } from './FormSecondaryButton';
export type { FormCheckboxProps } from './FormCheckbox';
export { FormCheckbox } from './FormCheckbox';

export { SyncSpinner } from './SyncSpinner';
export { ActivitySpinner } from './ActivitySpinner';

export { NoSpaceField } from './NoSpaceField';

Expand Down
2 changes: 0 additions & 2 deletions src/app/atoms/useTabSlug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { useLocation } from 'lib/woozie';

export const useTabSlug = () => {
const { search } = useLocation();

const tabSlug = useMemo(() => {
const usp = new URLSearchParams(search);
return usp.get('tab');
}, [search]);

return useMemo(() => tabSlug, [tabSlug]);
};
31 changes: 0 additions & 31 deletions src/app/hooks/use-collectibles-details-loading.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/icons/broken-image.svg

This file was deleted.

6 changes: 0 additions & 6 deletions src/app/icons/editing.svg

This file was deleted.

6 changes: 0 additions & 6 deletions src/app/icons/manage.svg

This file was deleted.

Loading

0 comments on commit aa8ec4c

Please sign in to comment.