Anuj-Panthri commited on
Commit
88b9eae
·
1 Parent(s): 94d0cc8

created basic components structure

Browse files
README.md CHANGED
@@ -1,70 +1,35 @@
1
- # Getting Started with Create React App
 
 
 
 
 
2
 
3
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
 
 
4
 
5
- ## Available Scripts
 
 
 
 
6
 
7
- In the project directory, you can run:
8
 
9
- ### `npm start`
10
 
11
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13
 
14
- The page will reload when you make changes.\
15
- You may also see any lint errors in the console.
16
 
17
- ### `npm test`
 
 
18
 
19
- Launches the test runner in the interactive watch mode.\
20
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
 
22
- ### `npm run build`
23
 
24
- Builds the app for production to the `build` folder.\
25
- It correctly bundles React in production mode and optimizes the build for the best performance.
26
-
27
- The build is minified and the filenames include the hashes.\
28
- Your app is ready to be deployed!
29
-
30
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
-
32
- ### `npm run eject`
33
-
34
- **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35
-
36
- If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
-
38
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39
-
40
- You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41
-
42
- ## Learn More
43
-
44
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
-
46
- To learn React, check out the [React documentation](https://reactjs.org/).
47
-
48
- ### Code Splitting
49
-
50
- This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51
-
52
- ### Analyzing the Bundle Size
53
-
54
- This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55
-
56
- ### Making a Progressive Web App
57
-
58
- This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59
-
60
- ### Advanced Configuration
61
-
62
- This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63
-
64
- ### Deployment
65
-
66
- This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67
-
68
- ### `npm run build` fails to minify
69
-
70
- This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
 
1
+ ## Structure of each Component
2
+ File/Folder structure of Message component
3
+ > Message
4
+ >> index.jsx
5
+ >> Message.jsx( contains the Message component )
6
+ ## Components
7
 
8
+ - Contacts(left section)
9
+ - Search
10
+ - Contact
11
 
12
+ - Chat (right section)
13
+ - ChatHeader
14
+ - ChatMain
15
+ - Message
16
+ - ChatFooter
17
 
 
18
 
19
+ ## To run at local
20
 
21
+ - `npm install`
22
+ - `npm start`
23
 
24
+ ## To run at deployment
 
25
 
26
+ - `npm install`
27
+ - `npm run build`
28
+ - run the build folder with any server
29
 
30
+ ## Design
 
31
 
32
+ ![](./design.jpg)
33
 
34
+ ### Design inspiration from:-
35
+ https://dribbble.com/shots/5569588-Chat
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
design.jpg ADDED
package-lock.json CHANGED
@@ -8,6 +8,7 @@
8
  "name": "learn-react",
9
  "version": "0.1.0",
10
  "dependencies": {
 
11
  "@testing-library/jest-dom": "^5.17.0",
12
  "@testing-library/react": "^13.4.0",
13
  "@testing-library/user-event": "^13.5.0",
@@ -2376,6 +2377,14 @@
2376
  "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
2377
  }
2378
  },
 
 
 
 
 
 
 
 
2379
  "node_modules/@humanwhocodes/config-array": {
2380
  "version": "0.11.14",
2381
  "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
 
8
  "name": "learn-react",
9
  "version": "0.1.0",
10
  "dependencies": {
11
+ "@heroicons/react": "^2.1.1",
12
  "@testing-library/jest-dom": "^5.17.0",
13
  "@testing-library/react": "^13.4.0",
14
  "@testing-library/user-event": "^13.5.0",
 
2377
  "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
2378
  }
2379
  },
2380
+ "node_modules/@heroicons/react": {
2381
+ "version": "2.1.1",
2382
+ "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.1.1.tgz",
2383
+ "integrity": "sha512-JyyN9Lo66kirbCMuMMRPtJxtKJoIsXKS569ebHGGRKbl8s4CtUfLnyKJxteA+vIKySocO4s1SkTkGS4xtG/yEA==",
2384
+ "peerDependencies": {
2385
+ "react": ">= 16"
2386
+ }
2387
+ },
2388
  "node_modules/@humanwhocodes/config-array": {
2389
  "version": "0.11.14",
2390
  "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
package.json CHANGED
@@ -3,6 +3,7 @@
3
  "version": "0.1.0",
4
  "private": true,
5
  "dependencies": {
 
6
  "@testing-library/jest-dom": "^5.17.0",
7
  "@testing-library/react": "^13.4.0",
8
  "@testing-library/user-event": "^13.5.0",
 
3
  "version": "0.1.0",
4
  "private": true,
5
  "dependencies": {
6
+ "@heroicons/react": "^2.1.1",
7
  "@testing-library/jest-dom": "^5.17.0",
8
  "@testing-library/react": "^13.4.0",
9
  "@testing-library/user-event": "^13.5.0",
src/App.css CHANGED
@@ -1,38 +1,19 @@
1
  .App {
2
- text-align: center;
 
 
3
  }
4
 
5
- .App-logo {
6
- height: 40vmin;
7
- pointer-events: none;
8
- }
9
-
10
- @media (prefers-reduced-motion: no-preference) {
11
- .App-logo {
12
- animation: App-logo-spin infinite 20s linear;
13
- }
14
- }
15
 
16
- .App-header {
17
- background-color: #282c34;
18
- min-height: 100vh;
19
- display: flex;
20
  flex-direction: column;
21
  align-items: center;
22
- justify-content: center;
23
- font-size: calc(10px + 2vmin);
24
- color: white;
25
  }
26
 
27
- .App-link {
28
- color: #61dafb;
29
- }
30
-
31
- @keyframes App-logo-spin {
32
- from {
33
- transform: rotate(0deg);
34
- }
35
- to {
36
- transform: rotate(360deg);
37
- }
38
- }
 
1
  .App {
2
+ height:100vh;
3
+ display:flex;
4
+ /* align-items: stretch; */
5
  }
6
 
7
+ .contacts{
8
+ background-color: rgb(115, 40, 214);
9
+ color:white;
10
+ min-width:300px;
 
 
 
 
 
 
11
 
12
+ display:flex;
 
 
 
13
  flex-direction: column;
14
  align-items: center;
 
 
 
15
  }
16
 
17
+ .chat{
18
+ background-color: rgb(255, 255, 255);
19
+ }
 
 
 
 
 
 
 
 
 
src/App.js CHANGED
@@ -1,23 +1,12 @@
1
- import logo from './logo.svg';
2
  import './App.css';
 
 
3
 
4
  function App() {
5
  return (
6
  <div className="App">
7
- <header className="App-header">
8
- <img src={logo} className="App-logo" alt="logo" />
9
- <p>
10
- Edit <code>src/App.js</code> and save to reload.
11
- </p>
12
- <a
13
- className="App-link"
14
- href="https://reactjs.org"
15
- target="_blank"
16
- rel="noopener noreferrer"
17
- >
18
- Learn React
19
- </a>
20
- </header>
21
  </div>
22
  );
23
  }
 
 
1
  import './App.css';
2
+ import Chat from './components/Chat/Chat';
3
+ import Contacts from './components/Contacts/Contacts';
4
 
5
  function App() {
6
  return (
7
  <div className="App">
8
+ <Contacts />
9
+ <Chat />
 
 
 
 
 
 
 
 
 
 
 
 
10
  </div>
11
  );
12
  }
src/components/Chat/Chat.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .chat{
2
+ height:100%;
3
+ width:100%;
4
+ display:flex;
5
+ flex-direction: column;
6
+ background-color: rgb(208, 208, 208);
7
+ }
8
+
9
+
10
+ .chat_main{
11
+ flex-grow:1;
12
+ background-color: white;
13
+ }
src/components/Chat/Chat.jsx ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react';
2
+ import "./Chat.css";
3
+ import ChatHeader from '../ChatHeader';
4
+ import ChatMain from '../ChatMain';
5
+ import ChatFooter from '../ChatFooter';
6
+
7
+ function Chat() {
8
+ return (
9
+ <div className='chat'>
10
+ <ChatHeader/>
11
+ <ChatMain/>
12
+ <ChatFooter/>
13
+ </div>
14
+ )
15
+ }
16
+
17
+ export default Chat
src/components/Chat/index.jsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import Chat from "./Chat";
2
+
3
+ export default Chat;
src/components/ChatFooter/ChatFooter.jsx ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ function ChatFooter() {
4
+ return (
5
+ <div className='chat_footer'>Chat Footer</div>
6
+ )
7
+ }
8
+
9
+ export default ChatFooter
src/components/ChatFooter/index.jsx ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import ChatFooter from "./ChatFooter";
2
+ export default ChatFooter;
src/components/ChatHeader/ChatHeader.jsx ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ function ChatHeader() {
4
+ return (
5
+ <div className='chat_header'>Chat Header</div>
6
+ )
7
+ }
8
+
9
+ export default ChatHeader
src/components/ChatHeader/index.jsx ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import ChatHeader from "./ChatHeader";
2
+ export default ChatHeader;
src/components/ChatMain/ChatMain.jsx ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import Message from '../Message';
3
+
4
+ function ChatMain() {
5
+ return (
6
+ <div className='chat_main'>
7
+ <Message/>
8
+ <Message/>
9
+ <Message/>
10
+ <Message/>
11
+ </div>
12
+ )
13
+ }
14
+
15
+ export default ChatMain
src/components/ChatMain/index.jsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import ChatMain from "./ChatMain";
2
+
3
+ export default ChatMain;
src/components/Contact/Contact.jsx ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ function Contact() {
4
+ return (
5
+ <div>Contact</div>
6
+ )
7
+ }
8
+
9
+ export default Contact
src/components/Contact/index.jsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import Contact from "./Contact";
2
+
3
+ export default Contact;
src/components/Contacts/Contacts.jsx ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+ import Contact from '../Contact';
3
+ import Search from '../Search';
4
+
5
+ function Contacts() {
6
+ return (
7
+ <div className='contacts'>
8
+
9
+ <Search />
10
+
11
+ <Contact />
12
+ <Contact />
13
+ </div>
14
+ )
15
+ }
16
+
17
+ export default Contacts
src/components/Contacts/index.jsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import Contacts from "./Contacts";
2
+
3
+ export default Contacts;
src/components/Message/Message.jsx ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react'
2
+
3
+ function Message() {
4
+ return (
5
+ <div>Message</div>
6
+ )
7
+ }
8
+
9
+ export default Message
src/components/Message/index.jsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import Message from "./Message";
2
+
3
+ export default Message;
src/components/Search/Search.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .search{
2
+ background-color: #fff;
3
+ border-radius: 50px;
4
+
5
+ display:flex;
6
+ align-items: center;
7
+ overflow:hidden;
8
+
9
+ margin:2em 0;
10
+ padding:0.5em;
11
+ }
12
+
13
+ .search>input{
14
+ border:none;
15
+ outline:none;
16
+ /* padding:0.5em; */
17
+ }
18
+
19
+ .search__icon{
20
+ aspect-ratio: 1;
21
+ width:18px;
22
+ }
src/components/Search/Search.jsx ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react';
2
+ import "./Search.css";
3
+ import { MagnifyingGlassIcon } from '@heroicons/react/24/solid'
4
+
5
+ function Search() {
6
+ return (
7
+ <div className='search'>
8
+ <input type="text" placeholder='Search' className='search__input'/>
9
+ <MagnifyingGlassIcon className='search__icon' color='black' />
10
+ </div>
11
+ )
12
+ }
13
+
14
+ export default Search
src/components/Search/index.jsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import Search from "./Search";
2
+
3
+ export default Search;
src/index.css CHANGED
@@ -1,13 +1,13 @@
 
 
 
 
 
 
1
  body {
2
- margin: 0;
3
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4
  'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5
  sans-serif;
6
  -webkit-font-smoothing: antialiased;
7
  -moz-osx-font-smoothing: grayscale;
8
- }
9
-
10
- code {
11
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12
- monospace;
13
- }
 
1
+ *{
2
+ margin:0;
3
+ padding:0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
  body {
 
8
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
9
  'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
10
  sans-serif;
11
  -webkit-font-smoothing: antialiased;
12
  -moz-osx-font-smoothing: grayscale;
13
+ }