Browse Source

fixed bug with h1 child of h1

pull/3/head landing-blocks_1.0.18
remorses 1 year ago
parent
commit
1d89360a4b
4 changed files with 9 additions and 7 deletions
  1. +2
    -1
      landing-blocks/src/Heading.tsx
  2. +4
    -3
      landing-blocks/src/Hero.tsx
  3. +2
    -1
      landing-blocks/src/Subheading.tsx
  4. +1
    -2
      website/package.json

+ 2
- 1
landing-blocks/src/Heading.tsx View File

@ -6,5 +6,6 @@ export function Heading(props: HeadingProps) {
if (!props.children) {
return <Fragment />
}
return <H minW='100px' as='h1' m={0} fontSize='heading' fontWeight='medium' {...props} />
const as = typeof props.children === 'string' ? 'h2' : 'span'
return <H minW='100px' as={as} m={0} fontSize='heading' fontWeight='medium' {...props} />
}

+ 4
- 3
landing-blocks/src/Hero.tsx View File

@ -1,4 +1,6 @@
// @jsx jsx
import { Box, Stack } from '@chakra-ui/core'
import { jsx } from '@emotion/core'
import React, { ReactNode } from 'react'
import { Bullet } from './Bullet'
import { Heading } from './Heading'
@ -27,6 +29,7 @@ export function Hero({
animate = undefined,
...rest
}: HeroProps) {
console.log({ heading })
const { Faded } = useFaded({ animate })
return (
<PageContainer {...rest}>
@ -51,9 +54,7 @@ export function Hero({
{bullet && <Bullet my='10px'>{bullet}</Bullet>}
<Heading fontSize='46px'>{heading}</Heading>
</Col>
<Subheading maxW='700px'>
{subheading}
</Subheading>
<Subheading maxW='700px'>{subheading}</Subheading>
<Stack align={['center', 'center', 'flex-start']}>
<Box>{clone(cta)}</Box>
{/* <Button

+ 2
- 1
landing-blocks/src/Subheading.tsx View File

@ -5,9 +5,10 @@ export function Subheading(props: HeadingProps) {
if (!props.children) {
return <Fragment />
}
const as = typeof props.children === 'string' ? 'h2' : 'span'
return (
<H
as='div'
as={as}
m={0}
opacity={0.7}
fontWeight='normal'

+ 1
- 2
website/package.json View File

@ -21,7 +21,7 @@
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"baby-i-am-faded": "^0.0.13",
"dokz": "^0.2.7",
"dokz": "^0.2.9",
"landing-blocks": "*",
"next": "latest",
"react": "16.13.1",
@ -33,7 +33,6 @@
"async-sema": "^3.1.0",
"capture-website": "^0.8.1",
"compose-function": "^3.0.3",
"dokz": "^0.2.9",
"next-transpile-modules": "^3.2.0",
"react-docgen-typescript": "^1.16.3",
"typescript": "^3.8.3"

Loading…
Cancel
Save