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

Convert to ChakraUI #16

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
35 changes: 0 additions & 35 deletions .eslintrc.json

This file was deleted.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
"homepage": "https://aha.pineapple.lol/",
"dependencies": {
"@ant-design/icons": "^4.3.0",
"@chakra-ui/react": "^1.8.8",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"antd": "^4.6.2",
"axios": "^0.20.0",
"framer-motion": "^6",
"prop-types": "^15.7.2",
"qs": "^6.9.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3"
"react-scripts": "5.0.1"
},
"devDependencies": {
"@babel/cli": "^7.6.2",
Expand All @@ -36,9 +40,6 @@
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
Expand Down
14 changes: 8 additions & 6 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// @flow
import React from 'react';
import type { Node } from 'react';
import '../css/Header.css';
import { Box, Center, Heading, Text, VStack } from '@chakra-ui/react';

function Header(): Node {
return (
<div className="header">
<h1>aha</h1>
<p>
<VStack maxWidth="400px" mt={3} margin="0 auto" textAlign="center">
<Heading fontSize="2xl" as="h1">
aha
</Heading>
<Text marginTop={2}>
Find the perfect name for your next project. Take inspiration from
synonyms and translations.
</p>
</div>
</Text>
</VStack>
);
}

Expand Down
17 changes: 11 additions & 6 deletions src/components/Nav.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
// @flow
import React from 'react';
import type { Node } from 'react';
import '../css/Nav.css';
import { chakra, Image, Link } from '@chakra-ui/react';

function Nav(): Node {
return (
<div className="nav">
<a href="https://pineapple.lol">
<img src="/pineapplelol.png" alt="pineapplelol logo" />
</a>
</div>
<chakra.nav margin="0 auto" width="90%">
<Link href="https://pineapple.lol">
<Image
width="200px"
paddingTop="20px"
src="/pineapplelol.png"
alt="pineapplelol logo"
/>
</Link>
</chakra.nav>
);
}

Expand Down
46 changes: 30 additions & 16 deletions src/components/Searchbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Node } from 'react';
import { Button, Dropdown, Input, Menu, Row } from 'antd';
import { DownOutlined } from '@ant-design/icons';
import '../css/Searchbar.css';
import { Center, InputGroup, InputLeftAddon, Select } from '@chakra-ui/react';

const { Search } = Input;

Expand All @@ -20,28 +21,41 @@ function Searchbar(props: Props): Node {
setFind(key);
};

const menu = (
<Menu onClick={onClick}>
<Menu.Item key="Synonyms">Synonyms</Menu.Item>
<Menu.Item key="Translations">Translations</Menu.Item>
</Menu>
);

return (
<Row type="flex" align="center" className="search">
<Search
<Center marginTop={5}>
<InputGroup w="60%" h="35px">
<InputLeftAddon
border="none"
h="35px"
background="white"
children={
<Select placeholder="Select Option" h="35px" size="sm">
<option value="Synonyms">Synonyms</option>
<option value="Translations">Translations</option>
</Select>
}
/>
<Input
type="text"
placeholder="Enter a word that describes your idea"
onSubmit={() => console.log('hi')}
/>
</InputGroup>
{/* <Search
addonBefore={
<Dropdown overlay={menu}>
<Button>
{find} <DownOutlined />
</Button>
</Dropdown>

// <Dropdown overlay={menu}>
// <Button>
// {find} <DownOutlined />
// </Button>
// </Dropdown>

}
placeholder="A word that describes your idea"
onSearch={value => setWord(value)}
style={{ width: 400 }}
/>
</Row>
/> */}
</Center>
);
}

Expand Down
21 changes: 15 additions & 6 deletions src/components/WordCard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import React from 'react';
import type { Node } from 'react';
import { Card } from 'antd';
import { Box, Center, Heading } from '@chakra-ui/react';

type Props = {
heading: string,
Expand All @@ -13,12 +13,21 @@ function WordCard(props: Props): Node {
const { heading, identifier, description } = props;

return (
<Card hoverable style={{ width: '90%', textAlign: 'left' }}>
<h2>{heading}</h2>
<p>
<Box
border="1px solid"
borderColor="gray.100"
borderRadius="sm"
overflow="hidden"
padding={8}
_hover={{ boxShadow: 'lg', transition: 'box-shadow 150ms ease-in-out' }}
>
<Heading as="h5" size="md">
{heading}
</Heading>
{/* <Text>
<em>{identifier}</em> {description}
</p>
</Card>
</Text> */}
</Box>
);
}

Expand Down
8 changes: 0 additions & 8 deletions src/css/Header.css

This file was deleted.

10 changes: 0 additions & 10 deletions src/css/Nav.css

This file was deleted.

6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';

import { ChakraProvider } from '@chakra-ui/react'
import Home from './pages/Home';

ReactDOM.render(
<React.StrictMode>
<Home />
<ChakraProvider>
<Home />
</ChakraProvider>
</React.StrictMode>,
document.getElementById('root'),
);
Loading