Browse Source

fix: page-reference bug

fix/enable-imgix
Thomas Osmonson 5 years ago
parent
commit
f7dec23fd2
  1. 39
      src/components/custom-blocks/page-reference.tsx
  2. 2
      src/pages/stacks-blockchain/testnet.md

39
src/components/custom-blocks/page-reference.tsx

@ -248,11 +248,11 @@ const getComponent = (type: 'default' | 'inline' | 'grid' | 'grid-small') => {
case 'grid-small': case 'grid-small':
return GridSmallItem; return GridSmallItem;
default: default:
return GridCard; return InlineCard;
} }
}; };
export const PageReference: React.FC<BoxProps> = React.memo(({ children }) => { export const PageReference: React.FC<BoxProps> = React.memo(({ children, ...rest }) => {
const content = onlyText(children).trim(); const content = onlyText(children).trim();
const [variant, _paths] = content.includes('\n') ? content.split('\n') : ['default', content]; const [variant, _paths] = content.includes('\n') ? content.split('\n') : ['default', content];
const paths = _paths.includes(', ') ? _paths.split(', ') : [_paths]; const paths = _paths.includes(', ') ? _paths.split(', ') : [_paths];
@ -264,21 +264,24 @@ export const PageReference: React.FC<BoxProps> = React.memo(({ children }) => {
const Comp = getComponent(variant as any); const Comp = getComponent(variant as any);
return ( return (
<Grid <Box {...rest}>
width="100%" <Grid
mt={space('extra-loose')} display="grid"
gridColumnGap={space('extra-loose')} width="100%"
gridRowGap={space('extra-loose')} gridColumnGap={space('extra-loose')}
gridTemplateColumns={[ gridRowGap={space('extra-loose')}
`repeat(1, 1fr)`, mt={space('extra-loose')}
`repeat(${pages.length === 1 ? 1 : 2}, 1fr)`, gridTemplateColumns={[
`repeat(${pages.length === 1 ? 1 : 2}, 1fr)`, `repeat(1, 1fr)`,
`repeat(${pages.length === 1 ? 1 : 3}, 1fr)`, `repeat(${pages.length === 1 ? 1 : 2}, 1fr)`,
]} `repeat(${pages.length === 1 ? 1 : 2}, 1fr)`,
> `repeat(${pages.length === 1 ? 1 : 3}, 1fr)`,
{pages.map((page, key) => ( ]}
<Comp key={key} page={page} /> >
))} {pages.map((page, key) => (
</Grid> <Comp key={key} page={page} />
))}
</Grid>
</Box>
); );
}); });

2
src/pages/stacks-blockchain/testnet.md

@ -80,6 +80,8 @@ Awesome! Your node is now connected to the testnet network. Your node will recei
and you can use your [node's RPC API](/core/smart/rpc-api) to send transactions, fetch information for contracts and and you can use your [node's RPC API](/core/smart/rpc-api) to send transactions, fetch information for contracts and
accounts, and more. accounts, and more.
### Mine Stacks token
Now that you have a running testnet node, you can easily set up a miner. Now that you have a running testnet node, you can easily set up a miner.
[@page-reference | inline] [@page-reference | inline]

Loading…
Cancel
Save