Browse Source

small fix

pull/3/head
remorses 1 year ago
parent
commit
e66cd8c2c6
4 changed files with 15 additions and 19 deletions
  1. +0
    -1
      demos/tests/testPrintJsx.tsx
  2. +2
    -3
      react-landing/package.json
  3. +3
    -2
      react-landing/src/NavBar.tsx
  4. +10
    -13
      react-landing/src/layout.tsx

+ 0
- 1
demos/tests/testPrintJsx.tsx View File

@ -16,7 +16,6 @@ describe('reactElementToJSXString react-element-to-jsx-string', () => {
var res = reactElementToJSXString(
<LandingProvider primary='#FF593D'>
<NavBar
xxx={CONST}
logo={<img width='120px' src='/datocms/logo.svg' />}
navs={[
<a>Why DatoCMS</a>,

+ 2
- 3
react-landing/package.json View File

@ -37,13 +37,13 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"sucrase": "^3.12.1",
"typescript": "^3.8.3"
"typescript": "^3.8.3",
"@types/react-mailchimp-subscribe": "^2.0.2"
},
"dependencies": {
"@chakra-ui/core": "^0.6.1",
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"@types/react-mailchimp-subscribe": "^2.0.2",
"baby-i-am-faded": "0.0.7",
"color-js": "^1.0.5",
"emotion-theming": "^10.0.27",
@ -51,7 +51,6 @@
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2",
"react-icons": "^3.9.0",
"react-intersection-observer": "^8.26.1",
"react-mailchimp-subscribe": "^2.1.0",
"react-script-hook": "^1.0.17",
"react-twitter-embed": "^3.0.3"

+ 3
- 2
react-landing/src/NavBar.tsx View File

@ -13,13 +13,14 @@ import React, { cloneElement, ReactNode } from 'react'
import { FiMenu as Menu } from 'react-icons/fi'
import { useMyColorMode } from './hooks'
import { darkStyles, PageContainer, Row, PageContainerProps } from './layout'
import { clone } from './support'
export type NavBarProps = {
logo: ReactNode
navs?: ReactNode[]
} & PageContainerProps
export const NavBar = ({ logo, navs = [], ...rest }) => {
export const NavBar = ({ logo, navs = [], ...rest }: NavBarProps) => {
const { isOpen, onOpen, onClose } = useDisclosure()
const { colorMode } = useMyColorMode(rest)
return (
@ -37,7 +38,7 @@ export const NavBar = ({ logo, navs = [], ...rest }) => {
>
{navs.map((x, i) => (
<Box key={i} fontSize='16px' fontWeight='medium'>
{cloneElement(x)}
{clone(x)}
</Box>
))}
</Stack>

+ 10
- 13
react-landing/src/layout.tsx View File

@ -1,8 +1,16 @@
import { Box, DarkMode, Flex, FlexProps, Stack, StackProps, ThemeProvider, useTheme } from '@chakra-ui/core'
import {
Box,
DarkMode,
Flex,
FlexProps,
Stack,
StackProps,
ThemeProvider,
useTheme,
} from '@chakra-ui/core'
import merge from 'lodash.merge'
import React, { FC, forwardRef, Fragment, useMemo } from 'react'
export const Col: FC<FlexProps> = forwardRef((props, ref) => {
return <Flex ref={ref} flexDir='column' {...props} />
})
@ -15,14 +23,6 @@ export const Spacer = ({ x = '0px', y = '0px' }) => {
return <Box mt={y} ml={x} />
}
const Dark = ({ children }) => {
return (
<DarkMode>
<Box>{children}</Box>
</DarkMode>
)
}
export const darkStyles = {
// bg: 'gray.800',
color: 'whiteAlpha.900',
@ -138,6 +138,3 @@ export const FloatingElement: FC<{ floatingElement } & FlexProps> = forwardRef(
)
},
)
export { Divider } from '@chakra-ui/core'

Loading…
Cancel
Save