Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/5 chakra v1 #10

Open
wants to merge 5 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/about/aboutUsSection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Text } from '@chakra-ui/core'
import { Box, Text } from '@chakra-ui/react'

import Section from '../common/section'
import UnderlinedHeading from '../common/underlinedHeading'
Expand Down
2 changes: 1 addition & 1 deletion components/about/contactForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Textarea,
Alert,
AlertIcon
} from '@chakra-ui/core'
} from '@chakra-ui/react'

import { useState } from 'react'
import PropTypes from 'prop-types'
Expand Down
4 changes: 2 additions & 2 deletions components/about/contactSection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Text } from '@chakra-ui/core'
import { Box, Text } from '@chakra-ui/react'
import { useState } from 'react'

import Section from '../common/section'
Expand All @@ -25,7 +25,7 @@ const ContactSection = ({ contactPage, hideHeading, ...props }) => {
{...props}
>
<UnderlinedHeading as={contactPage ? 'h1' : 'h2'} className={hideHeading ? 'sr-only' : ''} text='Contact Us' align='center' />
<Card shadowSz='lg' w='100%' maxW='45rem'>
<Card shadowSz='lg' boxSize='100%' maxW='45rem'>
{!formSubmit && (
<Text
textTransform='uppercase'
Expand Down
13 changes: 13 additions & 0 deletions components/common/CustomIconWrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { createIcon } from '@chakra-ui/icons'
import React from 'react'

import icons from '../../public/icons'

const CustomIconWrapper = ({ icon, ...props }) => {
if (!icon || !icons[icon]) {
return null
}
return React.createElement(createIcon(icons[icon]), props)
}

export default CustomIconWrapper
6 changes: 3 additions & 3 deletions components/common/authProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import {
Box,
Flex,
Text,
Icon,
Input,
Heading,
FormControl,
FormLabel
} from '@chakra-ui/core'
} from '@chakra-ui/react'

import { useForm } from 'react-hook-form'

Expand All @@ -23,6 +22,7 @@ import ErrorMessage from './errorMessage'
import GitHubLoginButton from './githubButton'

import styles from './authProcess.module.scss'
import CustomIconWrapper from './CustomIconWrapper'

const AuthProcess = ({
process,
Expand Down Expand Up @@ -196,7 +196,7 @@ const AuthProcess = ({
justify='space-between'
aria-live='polite'
>
<Icon name={icon} size='6rem' marginBottom='1.5rem' />
<CustomIconWrapper icon={icon} boxSize='6rem' marginBottom='1.5rem' />
<Heading
as='h1'
fontSize='2rem'
Expand Down
4 changes: 2 additions & 2 deletions components/common/backButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
Flex,
Text,
Link
} from '@chakra-ui/core'
} from '@chakra-ui/react'
import { ArrowBackIcon } from '@chakra-ui/icons'
import { useRouter } from 'next/router'

Expand All @@ -12,7 +12,7 @@ const BackButton = () => {
return (
<Link onClick={() => router.back()}>
<Flex flexDirection='row' position='absolute' zIndex={1000} top='10rem' left='5rem' padding='1rem' cursor='pointer'>
<ArrowBackIcon w='1.5rem' h='1.5rem' />
<ArrowBackIcon boxSize='1.5rem' />
<Text paddingLeft='1rem'>Back</Text>
</Flex>
</Link>
Expand Down
10 changes: 5 additions & 5 deletions components/common/banner.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
Flex,
Icon,
CloseButton
} from '@chakra-ui/core'
} from '@chakra-ui/react'
import CustomIconWrapper from './CustomIconWrapper'

const Banner = ({ icon, children, onCloseClick }) => {
return (
Expand All @@ -20,9 +20,9 @@ const Banner = ({ icon, children, onCloseClick }) => {
borderColor='ocean'
borderBottom='1px'
>
<Icon
name={icon}
size={{ base: '2rem', md: '3rem' }}
<CustomIconWrapper
icon={icon}
boxSize={{ base: '2rem', md: '3rem' }}
marginRight={{ base: 0, md: '1.5rem' }}
marginBottom={{ base: '1.5rem', md: 0 }}
/>
Expand Down
2 changes: 1 addition & 1 deletion components/common/button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Button
} from '@chakra-ui/core'
} from '@chakra-ui/react'

const FBButton = (props) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/common/card.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// White card with a box shadow used for forms, select plans, install instuctions, etc.
import { Box } from '@chakra-ui/core'
import { Box } from '@chakra-ui/react'
import PropTypes from 'prop-types'

const shadowSizes = {
Expand Down
2 changes: 1 addition & 1 deletion components/common/divider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box } from '@chakra-ui/core'
import { Box } from '@chakra-ui/react'

const Divider = (props) => (
<Box
Expand Down
4 changes: 2 additions & 2 deletions components/common/errorMessage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, AlertIcon } from '@chakra-ui/core'
import { Alert, AlertIcon } from '@chakra-ui/react'

const ErrorMessage = ({ msg, iconSize, children, ...props }) => (
<Alert
Expand All @@ -15,7 +15,7 @@ const ErrorMessage = ({ msg, iconSize, children, ...props }) => (
>
<AlertIcon
color='#b9423a'
size={iconSize || '1.5rem'}
boxSize={iconSize || '1.5rem'}
marginBottom={{ base: '1rem', md: 0 }}
/>
<span>
Expand Down
2 changes: 1 addition & 1 deletion components/common/faqHeading.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Heading } from '@chakra-ui/core'
import { Heading } from '@chakra-ui/react'

// used for FAQ and How it Works page
const FAQHeading = ({ children, ...props }) => (
Expand Down
2 changes: 1 addition & 1 deletion components/common/fbButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from '@chakra-ui/core'
import { Button } from '@chakra-ui/react'
import { defaultProps } from '../../utils/defaultBtnProps'
import PropTypes from 'prop-types'

Expand Down
2 changes: 1 addition & 1 deletion components/common/fbTextInput.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input } from '@chakra-ui/core'
import { Input } from '@chakra-ui/react'

const FBTextInput = ({ id, type, register, ...props }) => (
<Input
Expand Down
2 changes: 1 addition & 1 deletion components/common/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { useAuth } from '../../utils/useAuth'

import { Flex, List, ListItem, Text, Box } from '@chakra-ui/core'
import { Flex, List, ListItem, Text, Box } from '@chakra-ui/react'

import TextLink from './textLink'
import styles from './footer.module.scss'
Expand Down
2 changes: 1 addition & 1 deletion components/common/formControl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
FormControl,
FormLabel
} from '@chakra-ui/core'
} from '@chakra-ui/react'

const FBFormControl = ({ labelText, id, required, children, ...props }) => (
<FormControl marginBottom='1.5rem' isRequired={required} {...props}>
Expand Down
2 changes: 1 addition & 1 deletion components/common/githubButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Image, Link } from '@chakra-ui/core'
import { Button, Image, Link } from '@chakra-ui/react'
import { defaultProps } from '../../utils/defaultBtnProps'
import { useLocalStorage } from '../../utils/useLocalStorage'
import { localStorageGHStateKey } from '../../utils/constants'
Expand Down
32 changes: 19 additions & 13 deletions components/common/header/authNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ import {
useTheme,
Box,
Button,
Icon,
Menu,
MenuButton,
MenuList,
MenuItem
} from '@chakra-ui/core'
import { AddIcon } from '@chakra-ui/icons'
} from '@chakra-ui/react'
import {
AddIcon,
ChevronDownIcon,
ChevronUpIcon,
SearchIcon,
QuestionIcon,
SettingsIcon,
UnlockIcon
} from '@chakra-ui/icons'
import CustomIconWrapper from '../CustomIconWrapper'

const AuthNav = ({ user, onLogout }) => {
const router = useRouter()
Expand Down Expand Up @@ -77,11 +85,9 @@ const AuthNav = ({ user, onLogout }) => {
>
{user.email.charAt(0)}
</Box>
<Icon
name={isExpanded ? 'chevron-up' : 'chevron-down'}
marginLeft='.5rem'
size='1.5rem'
/>
{isExpanded
? <ChevronUpIcon marginLeft='0.5rem' boxSize='1.5rem' />
: <ChevronDownIcon marginLeft='0.5rem' boxSize='1.5rem' />}
</MenuButton>
<MenuList backgroundColor='lightRock'>
<MenuItem
Expand All @@ -92,7 +98,7 @@ const AuthNav = ({ user, onLogout }) => {
<Link href='/dashboard'>
<a>
<Box as='span' display='flex' alignItems='center'>
<Icon name='home' marginRight='.5rem' />
<CustomIconWrapper icon='home' marginRight='.5rem' />
<span>Dashboard</span>
</Box>
</a>
Expand All @@ -106,7 +112,7 @@ const AuthNav = ({ user, onLogout }) => {
<Link href='/find-packages'>
<a>
<Box as='span' display='flex' alignItems='center'>
<Icon name='search' marginRight='.5rem' />
<SearchIcon marginRight='.5rem' />
<span>Search packages</span>
</Box>
</a>
Expand All @@ -120,7 +126,7 @@ const AuthNav = ({ user, onLogout }) => {
<Link href='/faq'>
<a>
<Box as='span' display='flex' alignItems='center'>
<Icon name='question' marginRight='.5rem' />
<QuestionIcon marginRight='.5rem' />
<span>FAQ</span>
</Box>
</a>
Expand Down Expand Up @@ -148,7 +154,7 @@ const AuthNav = ({ user, onLogout }) => {
<Link href='/maintainer/settings'>
<a>
<Box as='span' display='flex' alignItems='center'>
<Icon name='settings' marginRight='.5rem' />
<SettingsIcon marginRight='.5rem' />
<span>Settings</span>
</Box>
</a>
Expand All @@ -162,7 +168,7 @@ const AuthNav = ({ user, onLogout }) => {
<Link href='/'>
<a>
<Box as='span' display='flex' alignItems='center'>
<Icon name='unlock' marginRight='.5rem' />
<UnlockIcon marginRight='.5rem' />
<span>Log out</span>
</Box>
</a>
Expand Down
2 changes: 1 addition & 1 deletion components/common/header/header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from 'next/router'
import { useAuth } from '../../../utils/useAuth'

import { Box, Flex } from '@chakra-ui/core'
import { Box, Flex } from '@chakra-ui/react'

import LinkBtn from '../linkBtn'
import TextLink from '../textLink'
Expand Down
2 changes: 1 addition & 1 deletion components/common/header/logo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link as ChakraLink, Box } from '@chakra-ui/core'
import { Link as ChakraLink, Box } from '@chakra-ui/react'
import Link from 'next/link'
import FullLogo from './fullLogo'
import FBLogoLetters from './logoLetters'
Expand Down
2 changes: 1 addition & 1 deletion components/common/header/logoLetters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex } from '@chakra-ui/core'
import { Flex } from '@chakra-ui/react'
import PropTypes from 'prop-types'

const FBLogoLetters = ({ id, ...props }) => {
Expand Down
9 changes: 9 additions & 0 deletions components/common/icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createIcon } from '@chakra-ui/react'

import icons from '../../public/icons'

export const DuotoneStarIcon = createIcon(icons.duotoneStar)
export const SmileIcon = createIcon(icons.smile)
export const StackIcon = createIcon(icons.stack)
export const EquitableIcon = createIcon(icons.equitable)
export const GivingHandIcon = createIcon(icons.givingHand)
6 changes: 3 additions & 3 deletions components/common/linkBtn.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { PseudoBox } from '@chakra-ui/core'
import { Box } from '@chakra-ui/react'
import { defaultProps } from '../../utils/defaultBtnProps'
import PropTypes from 'prop-types'

const LinkBtn = ({ children, ...props }) => (
<PseudoBox as='a' display='inline-block' {...props}>
<Box as='a' display='inline-block' {...props}>
{children}
</PseudoBox>
</Box>
)

LinkBtn.defaultProps = { ...defaultProps }
Expand Down
6 changes: 3 additions & 3 deletions components/common/pageWrapper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PseudoBox, Flex } from '@chakra-ui/core'
import { Box, Flex } from '@chakra-ui/react'

import PropTypes from 'prop-types'
import FBHead from './head'
Expand All @@ -21,7 +21,7 @@ const PageWrapper = (props) => (
<SkipLink />
<Flex direction='column' minH='100vh'>
<Header />
<PseudoBox
<Box
as='main'
id='main-content'
tabIndex='-1'
Expand All @@ -34,7 +34,7 @@ const PageWrapper = (props) => (
}}
>
{props.children}
</PseudoBox>
</Box>
<Footer />
</Flex>
</>
Expand Down
2 changes: 1 addition & 1 deletion components/common/percentInput.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react'
import { Flex, Input } from '@chakra-ui/core'
import { Flex, Input } from '@chakra-ui/react'
import PropTypes from 'prop-types'

const PercentInput = ({ onChange, initialValue, id, ...props }) => {
Expand Down
2 changes: 1 addition & 1 deletion components/common/section.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box } from '@chakra-ui/core'
import { Box } from '@chakra-ui/react'

const Section = ({ backgroundColor, children, ...props }) => (
<Box
Expand Down
Loading