style: fix styles PR review
This commit is contained in:
parent
540eabf4ff
commit
48755af8c1
|
|
@ -7,6 +7,12 @@ import { AppLog } from '@/utils';
|
||||||
import { IndexedNFA } from '../../indexed-nfa.context';
|
import { IndexedNFA } from '../../indexed-nfa.context';
|
||||||
import { IndexedNFAStyles as S } from '../../indexed-nfa.styles';
|
import { IndexedNFAStyles as S } from '../../indexed-nfa.styles';
|
||||||
|
|
||||||
|
const openseaLink = `https://${
|
||||||
|
env.environment === 'development' ? 'testnets' : ''
|
||||||
|
}.opensea.io/assets/${
|
||||||
|
env.environment === 'development' ? 'goerli' : 'ethereum'
|
||||||
|
}/${FleekERC721.address}`;
|
||||||
|
|
||||||
type CustomButtonProps = {
|
type CustomButtonProps = {
|
||||||
icon: IconName;
|
icon: IconName;
|
||||||
};
|
};
|
||||||
|
|
@ -26,19 +32,21 @@ const CustomButon = forwardStyledRef<HTMLButtonElement, CustomButtonProps>(
|
||||||
type MenuItemProps = {
|
type MenuItemProps = {
|
||||||
label: string;
|
label: string;
|
||||||
iconName: IconName;
|
iconName: IconName;
|
||||||
onClick: () => void;
|
href: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const MenuItem: React.FC<MenuItemProps> = ({
|
const MenuItem: React.FC<MenuItemProps> = ({
|
||||||
label,
|
label,
|
||||||
iconName,
|
iconName,
|
||||||
onClick,
|
href,
|
||||||
}: MenuItemProps) => {
|
}: MenuItemProps) => {
|
||||||
return (
|
return (
|
||||||
<Flex onClick={onClick} css={{ gap: '$2' }}>
|
<a href={href} rel="noopener noreferrer" target="_blank">
|
||||||
<Icon name={iconName} />
|
<Flex css={{ gap: '$2' }}>
|
||||||
{label}
|
<Icon name={iconName} />
|
||||||
</Flex>
|
{label}
|
||||||
|
</Flex>
|
||||||
|
</a>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -51,39 +59,24 @@ export const ButtonsFragment: React.FC = () => {
|
||||||
AppLog.successToast('Link copied to clipboard');
|
AppLog.successToast('Link copied to clipboard');
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleShareOpenSeaOnClick = (): void => {
|
|
||||||
window.open(
|
|
||||||
`https://${
|
|
||||||
env.environment === 'development' ? 'testnets' : ''
|
|
||||||
}.opensea.io/assets/${
|
|
||||||
env.environment === 'development' ? 'goerli' : 'ethereum'
|
|
||||||
}/${FleekERC721.address}/${nfa.tokenId}`,
|
|
||||||
'_blank'
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleShareOnTwitterOnClick = (): void => {
|
|
||||||
window.open(env.twitter.url, '_blank'); //TODO replace with twitter share
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<S.Aside.Button.Container>
|
<S.Aside.Button.Container>
|
||||||
<Menu.Root>
|
<Menu.Root>
|
||||||
<Menu.Button as={CustomButon} icon={'three-dots'} />
|
<Menu.Button as={CustomButon} icon="three-dots" />
|
||||||
<Menu.Items css={{ minWidth: '12rem' }}>
|
<Menu.Items css={{ minWidth: '12rem' }}>
|
||||||
{/* TODO remove span and render as fragment */}
|
{/* TODO remove span and render as fragment */}
|
||||||
<span>
|
<span>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
label="Open on OpenSea"
|
label="Open on OpenSea"
|
||||||
iconName="opensea"
|
iconName="opensea"
|
||||||
onClick={handleShareOpenSeaOnClick}
|
href={`${openseaLink}/${nfa.tokenId}`}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
label="Share to Twitter"
|
label="Share to Twitter"
|
||||||
iconName="twitter"
|
iconName="twitter"
|
||||||
onClick={handleShareOnTwitterOnClick}
|
href={env.twitter.url}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</Menu.Items>
|
</Menu.Items>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const OverviewFragment: React.FC = () => {
|
||||||
<S.Aside.Overview.Row.Container>
|
<S.Aside.Overview.Row.Container>
|
||||||
<S.Aside.Overview.Row.Label>Description</S.Aside.Overview.Row.Label>
|
<S.Aside.Overview.Row.Label>Description</S.Aside.Overview.Row.Label>
|
||||||
</S.Aside.Overview.Row.Container>
|
</S.Aside.Overview.Row.Container>
|
||||||
<S.Aside.Overview.Description css={{ overflowY: 'scroll' }}>
|
<S.Aside.Overview.Description>
|
||||||
{nfa.description}
|
{nfa.description}
|
||||||
</S.Aside.Overview.Description>
|
</S.Aside.Overview.Description>
|
||||||
</S.Aside.Overview.Container>
|
</S.Aside.Overview.Container>
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,8 @@ export const IndexedNFAStyles = {
|
||||||
},
|
},
|
||||||
Description: styled('p', {
|
Description: styled('p', {
|
||||||
color: '$slate11',
|
color: '$slate11',
|
||||||
|
overflowY: 'scroll',
|
||||||
|
pr: '1rem',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
Properties: {
|
Properties: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue