Unverified Commit 208551fc authored by Abdullah Mzaien's avatar Abdullah Mzaien Committed by GitHub

Upgraded to chakra V1 (#19181)

Upgraded charkra ui and peer dep and fixed the icon to follow the new api
parent c8a29235
{ {
"name": "with-chakra-ui", "name": "with-chakra-ui",
"version": "0.1.0", "version": "0.1.0",
"private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"@chakra-ui/core": "^1.0.0-rc.8", "@chakra-ui/icons": "^1.0.0",
"@chakra-ui/icons": "^1.0.0-rc.8", "@chakra-ui/react": "^1.0.0",
"@emotion/react": "^11.0.0",
"@emotion/styled": "^11.0.0",
"emotion-theming": "^11.0.0",
"framer-motion": "^2.9.4", "framer-motion": "^2.9.4",
"@emotion/styled": "^10.0.27", "next": "latest",
"emotion-theming": "^10.0.27", "react": "^17.0.1",
"next": "^9.1.7", "react-dom": "^17.0.1"
"react": "^16.12.0",
"react-dom": "^16.12.0"
}, },
"license": "MIT" "license": "MIT"
} }
import { Link as ChakraLink, Button } from '@chakra-ui/core' import { Link as ChakraLink, Button } from '@chakra-ui/react'
import { Container } from './Container' import { Container } from './Container'
......
import { Flex, useColorMode } from '@chakra-ui/core' import { Flex, useColorMode } from '@chakra-ui/react'
export const Container = (props) => { export const Container = (props) => {
const { colorMode } = useColorMode() const { colorMode } = useColorMode()
......
import { useColorMode, Switch } from '@chakra-ui/core' import { useColorMode, Switch } from '@chakra-ui/react'
export const DarkModeSwitch = () => { export const DarkModeSwitch = () => {
const { colorMode, toggleColorMode } = useColorMode() const { colorMode, toggleColorMode } = useColorMode()
......
import { Flex } from '@chakra-ui/core' import { Flex } from '@chakra-ui/react'
export const Footer = (props) => <Flex as="footer" py="8rem" {...props} /> export const Footer = (props) => <Flex as="footer" py="8rem" {...props} />
import { Flex, Heading } from '@chakra-ui/core' import { Flex, Heading } from '@chakra-ui/react'
export const Hero = ({ title }) => ( export const Hero = ({ title }) => (
<Flex justifyContent="center" alignItems="center" height="100vh"> <Flex justifyContent="center" alignItems="center" height="100vh">
......
import { Stack } from '@chakra-ui/core' import { Stack } from '@chakra-ui/react'
export const Main = (props) => ( export const Main = (props) => (
<Stack <Stack
......
import { ThemeProvider, CSSReset, ColorModeProvider } from '@chakra-ui/core' import { ThemeProvider, CSSReset, ColorModeProvider } from '@chakra-ui/react'
import theme from '../theme' import theme from '../theme'
......
...@@ -6,8 +6,8 @@ import { ...@@ -6,8 +6,8 @@ import {
List, List,
ListIcon, ListIcon,
ListItem, ListItem,
} from '@chakra-ui/core' } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@chakra-ui/icons'
import { Hero } from '../components/Hero' import { Hero } from '../components/Hero'
import { Container } from '../components/Container' import { Container } from '../components/Container'
import { Main } from '../components/Main' import { Main } from '../components/Main'
...@@ -32,13 +32,13 @@ const Index = () => ( ...@@ -32,13 +32,13 @@ const Index = () => (
flexGrow={1} flexGrow={1}
mr={2} mr={2}
> >
Chakra UI <Icon name="external-link" mx="2px" /> Chakra UI <Icon as={ExternalLinkIcon} mx="2px" />
</ChakraLink> </ChakraLink>
</ListItem> </ListItem>
<ListItem> <ListItem>
<ListIcon icon="check-circle" color="green.500" /> <ListIcon icon="check-circle" color="green.500" />
<ChakraLink isExternal href="https://nextjs.org" flexGrow={1} mr={2}> <ChakraLink isExternal href="https://nextjs.org" flexGrow={1} mr={2}>
Next.js <Icon name="external-link" mx="2px" /> Next.js <Icon as={ExternalLinkIcon} mx="2px" />
</ChakraLink> </ChakraLink>
</ListItem> </ListItem>
</List> </List>
......
import { theme as chakraTheme } from '@chakra-ui/core' import { theme as chakraTheme } from '@chakra-ui/react'
const fonts = { ...chakraTheme.fonts, mono: `'Menlo', monospace` } const fonts = { ...chakraTheme.fonts, mono: `'Menlo', monospace` }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment