Browse Source

react-landing/src: better imports

pull/3/head
remorses 1 year ago
parent
commit
011040e5e0
16 changed files with 48 additions and 113 deletions
  1. +5
    -6
      react-landing/src/Banner.tsx
  2. +2
    -5
      react-landing/src/Button.tsx
  3. +3
    -3
      react-landing/src/EmailForm.tsx
  4. +5
    -13
      react-landing/src/FeaturesGrid.tsx
  5. +2
    -4
      react-landing/src/Footer.tsx
  6. +2
    -14
      react-landing/src/GumroadButton.tsx
  7. +2
    -3
      react-landing/src/Heading.tsx
  8. +6
    -9
      react-landing/src/Hero.tsx
  9. +1
    -1
      react-landing/src/HowItWorks.tsx
  10. +2
    -11
      react-landing/src/LandingProvider.tsx
  11. +2
    -13
      react-landing/src/NavBar.tsx
  12. +1
    -1
      react-landing/src/Subheading.tsx
  13. +6
    -8
      react-landing/src/TestimonialsTweets.tsx
  14. +2
    -3
      react-landing/src/TopBanner.tsx
  15. +3
    -7
      react-landing/src/hooks.tsx
  16. +4
    -12
      react-landing/src/layout.tsx

+ 5
- 6
react-landing/src/Banner.tsx View File

@ -1,11 +1,10 @@
import { Heading as H, HeadingProps, Stack, Box } from '@chakra-ui/core'
import React, { FC, ReactNode } from 'react'
import { Text } from '@chakra-ui/core'
import { removeUndefined } from './support'
import { PageContainer, Col } from './layout'
import { Box, Stack } from '@chakra-ui/core'
import React, { ReactNode } from 'react'
import { Heading } from './Heading'
import { Col, PageContainer } from './layout'
import { Subheading } from './Subheading'
import { removeUndefined } from './support'
export function Banner({
heading = '',

+ 2
- 5
react-landing/src/Button.tsx View File

@ -1,9 +1,6 @@
import React, { FC, Fragment, forwardRef } from 'react'
import { Button as B, HeadingProps, ButtonProps } from '@chakra-ui/core'
import { Children } from 'react'
import get from 'lodash.get'
import { Button as B, ButtonProps } from '@chakra-ui/core'
import Color from 'color-js'
import { useTheme } from 'emotion-theming'
import React, { forwardRef, Fragment } from 'react'
import { useColor } from './support'
export const Button = forwardRef(

+ 3
- 3
react-landing/src/EmailForm.tsx View File

@ -1,8 +1,8 @@
import React, { useState, ReactNode } from 'react'
import { Box, Input, Stack, StackProps, useColorMode } from '@chakra-ui/core'
import React, { ReactNode, useState } from 'react'
import MailchimpSubscribe from 'react-mailchimp-subscribe'
import { PageContainer, Row, Col } from './layout'
import { Stack, Input, Box, useColorMode, StackProps } from '@chakra-ui/core'
import { Button } from './Button'
import { Col } from './layout'
export type EmailFormProps = {
cta?: ReactNode

+ 5
- 13
react-landing/src/FeaturesGrid.tsx View File

@ -1,18 +1,10 @@
import {
Heading as H,
HeadingProps,
Stack,
Box,
SimpleGrid,
} from '@chakra-ui/core'
import React, { FC } from 'react'
import { Text } from '@chakra-ui/core'
import { removeUndefined } from './support'
import { PageContainer, Col } from './layout'
import { SimpleGrid, Stack, Text } from '@chakra-ui/core'
import React from 'react'
import { Heading } from './Heading'
import { useFaded } from './hooks'
import { Col, PageContainer } from './layout'
import { Subheading } from './Subheading'
import { useFaded } from './hooks'
export function FeaturesGrid({

+ 2
- 4
react-landing/src/Footer.tsx View File

@ -1,7 +1,5 @@
import React, { ReactNode, useContext } from 'react'
import Color from 'color-js'
import { Box, Text, Stack } from '@chakra-ui/core'
import { Row } from './layout'
import { Box, Stack, Text } from '@chakra-ui/core'
import React, { ReactNode } from 'react'
import { PageContainer } from './layout'
export function Footer({

+ 2
- 14
react-landing/src/GumroadButton.tsx View File

@ -1,17 +1,5 @@
import React, { FC, Fragment, forwardRef } from 'react'
import {
Button as B,
HeadingProps,
ButtonProps,
Box,
useColorMode,
Link,
} from '@chakra-ui/core'
import { Children } from 'react'
import get from 'lodash.get'
import Color from 'color-js'
import { useTheme } from 'emotion-theming'
import { useColor } from './support'
import { Link, useColorMode } from '@chakra-ui/core'
import React, { forwardRef } from 'react'
import useScript from 'react-script-hook'
export type GumroadButtonProps = {

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

@ -1,6 +1,5 @@
import React, { FC, Fragment } from 'react'
import { Heading as H, HeadingProps, } from '@chakra-ui/core'
import { Children } from 'react'
import { Heading as H } from '@chakra-ui/core'
import React, { Fragment } from 'react'
export function Heading(props) {
if (!props.children) {

+ 6
- 9
react-landing/src/Hero.tsx View File

@ -1,15 +1,12 @@
import React, { Fragment } from 'react'
import { Image, Flex, Box, Stack, Text, useColorMode } from '@chakra-ui/core'
import { Subheading } from './Subheading'
import { Box, Stack } from '@chakra-ui/core'
import React from 'react'
import { Bullet } from './Bullet'
import { Heading } from './Heading'
import { Button } from './Button'
import { Col, Row, Spacer, PageContainer, FloatingElement } from './layout'
import { useFaded } from './hooks'
import { Col, PageContainer, Row } from './layout'
import { Subheading } from './Subheading'
import { clone } from './support'
import { GradientRect } from './decorations'
import { useColor, clone } from './support'
import Color from 'color-js'
import { Bullet } from './Bullet'
export function Hero({
heading,

+ 1
- 1
react-landing/src/HowItWorks.tsx View File

@ -2,7 +2,7 @@ import { Box, Stack, Text } from '@chakra-ui/core'
import React from 'react'
import { Heading } from './Heading'
import { useFaded } from './hooks'
import { PageContainer, Col } from './layout'
import { Col, PageContainer } from './layout'
export function HowItWorks({

+ 2
- 11
react-landing/src/LandingProvider.tsx View File

@ -1,14 +1,5 @@
import React, { FC, Fragment, useMemo } from 'react'
import {
ColorModeProvider,
CSSReset,
DefaultTheme,
Stack,
theme as defaultTheme,
ThemeProvider,
FlexProps,
} from '@chakra-ui/core'
import { useTheme } from 'emotion-theming'
import { ColorModeProvider, CSSReset, DefaultTheme, FlexProps, Stack } from '@chakra-ui/core'
import React from 'react'
import { PropagatedThemeProvider } from './layout'
export interface ThemeExtension extends DefaultTheme {

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

@ -1,19 +1,8 @@
import { Box, Stack, useDisclosure, useColorMode } from '@chakra-ui/core'
import {
Drawer,
DrawerBody,
DrawerFooter,
DrawerHeader,
DrawerOverlay,
DrawerContent,
DrawerCloseButton,
Button,
} from '@chakra-ui/core'
import { Box, Button, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerOverlay, Stack, useDisclosure } from '@chakra-ui/core'
import React, { cloneElement } from 'react'
import { Row } from './layout'
import { PageContainer, darkStyles } from './layout'
import { FiMenu as Menu } from 'react-icons/fi'
import { useMyColorMode } from './hooks'
import { darkStyles, PageContainer, Row } from './layout'
export const NavBar = ({ logo, navs, ...rest }) => {
const { isOpen, onOpen, onClose } = useDisclosure()

+ 1
- 1
react-landing/src/Subheading.tsx View File

@ -1,5 +1,5 @@
import React, { FC, Props, Fragment } from 'react'
import { Heading as H, HeadingProps } from '@chakra-ui/core'
import React, { Fragment } from 'react'
export function Subheading(props: HeadingProps) {
if (!props.children) {

+ 6
- 8
react-landing/src/TestimonialsTweets.tsx View File

@ -1,14 +1,12 @@
import React, { ReactNode, useContext } from 'react'
import Color from 'color-js'
import { Box, Text, Stack, Flex } from '@chakra-ui/core'
import { removeUndefined } from './support'
import { Box, Stack } from '@chakra-ui/core'
import styled from '@emotion/styled'
import React from 'react'
import { TwitterTweetEmbed } from 'react-twitter-embed'
import { Heading } from './Heading'
import { useFaded } from './hooks'
import { Col, PageContainer } from './layout'
import { Subheading } from './Subheading'
import { PageContainer, Col } from './layout'
import { TwitterTweetEmbed } from 'react-twitter-embed'
import { useFaded } from './hooks'
import styled from '@emotion/styled'
const Unclickable = styled.div`
pointer-events: none;

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

@ -1,8 +1,7 @@
import { Box, Stack, Text, Button } from '@chakra-ui/core'
import { Box, Stack, Text } from '@chakra-ui/core'
import React from 'react'
import { Row } from './layout'
import { PageContainer } from './layout'
import { Bullet } from './Bullet'
import { PageContainer } from './layout'
export function TopBanner({ heading, cta, bullet, ...rest }) {
return (

+ 3
- 7
react-landing/src/hooks.tsx View File

@ -1,12 +1,8 @@
import React from 'react'
require('intersection-observer')
import { useInView } from 'react-intersection-observer'
import { useRef, ElementType } from 'react'
import { useColorMode } from '@chakra-ui/core'
import { Faded, FadedProps } from 'baby-i-am-faded'
import { useMemo } from 'react'
import { Fragment } from 'react'
import React, { ElementType, useMemo } from 'react'
require('intersection-observer')
export function useFaded({
animate = undefined,

+ 4
- 12
react-landing/src/layout.tsx View File

@ -1,16 +1,7 @@
import {
Flex,
FlexProps,
Box,
DarkMode,
Stack,
StackProps,
useTheme,
ThemeProvider,
} from '@chakra-ui/core'
import React, { FC, forwardRef, Fragment, useMemo } from 'react'
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} />
@ -149,3 +140,4 @@ export const FloatingElement: FC<{ floatingElement } & FlexProps> = forwardRef(
)
export { Divider } from '@chakra-ui/core'

Loading…
Cancel
Save