36 | );
37 | };
38 | const editorConfiguration = {
39 | toolbar: [ 'bold', 'italic' ]
40 | };
41 | export default Editor;
42 |
--------------------------------------------------------------------------------
/src/data/accordionOptions.js:
--------------------------------------------------------------------------------
1 | export const accordionOptions = [
2 | {
3 | title: 'What is React?',
4 | content: 'React is a JavaScript library for building user interfaces'
5 | },
6 | {
7 | title: 'Component Based',
8 | content: 'Build encapsulated components that manage their own state, then compose them to make complex UIs.'
9 | },
10 | {
11 | title: 'Declarative ?',
12 | content: 'React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.'
13 | },{
14 | title: 'what is bundling ?',
15 | content:'Most React apps will have their files “bundled” using tools like Webpack, Rollup or Browserify. Bundling is the process of following imported files and merging them into a single file: a “bundle”. This bundle can then be included on a webpage to load an entire app at once.'
16 | },{
17 | title:'client side rendering',
18 | content:'Client-side rendering allows developers to make their websites entirely rendered in the browser with JavaScript. Instead of having a different HTML page per route, a client-side rendered website creates each route dynamically directly in the browser.'
19 | }
20 | ];
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 | import Accordion from './components/pages/Accordion';
3 | import Search from './components/pages/Search';
4 | import Dropdown from './components/pages/Dropdown';
5 | import Translate from './components/pages/Translate';
6 | import TextUtils from './components/pages/TextUtils'
7 | import Editor from "./components/pages/Editor/Editor"
8 | import Header from './components/base/Header';
9 |
10 | import Routes from './routes';
11 | import { colorOptions } from './data/colorOptions';
12 | import { accordionOptions } from './data/accordionOptions';
13 |
14 | const App = ()=> {
15 | const [selected, setSelected] = useState(colorOptions[0]);
16 |
17 | return (
18 |
50 | );
51 |
52 | };
53 |
54 | export default Convert;
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
18 |
19 |
28 | React App
29 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Before moving ahead with making contributions please make sure that you have read the code of conduct mentioned in the [CODE_OF_CONDUCT.md](https://github.com/vishal-codes/react-widgets/blob/main/CODE_OF_CONDUCT.md) file.
4 |
5 |
6 | ### Prerequisites
7 | Make sure you have node.js and git installed on your machine.
8 | If you haven't then [this article](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) will help you in installation of git and [this article](https://nodejs.dev/learn/how-to-install-nodejs) will help in istallation of node.js
9 |
10 | ### Setting up project locally
11 | 1. Fork this repository by clicking on the fork button on the top of this page, this will create a copy of this repository in your account.
12 | 2. Clone your forked version by entering ``` git clone "https://github.com/YOUR_GITHUB_UserName/react-widgets.git"```
13 | 3. Change the directory from present to the project directory by entering ``` cd react-widgets/```
14 | 4. Install all dependencies by entering ```npm i```
15 | 5. Run the project locally by entering ```npm start``` This will run the project locally on port `localhost:3000` in your default browser.
16 |
17 | ### Branching
18 | 1. Open a new window of your terminal and change the directory into the project folder
19 | 2. Now create a new branch using `git checkout -b ` For example `git checkout-b vishal-codes`
20 | 3. Now make the required changes in the project which will resolve or add a feature as per mentioned in the respective issue.
21 |
22 | ### Commiting changes
23 | 1. Add the changes to the branch you just created using the `git add .` command
24 | 2. Now commit those changes using `git commit -m <"a short description about changes u made">` For example `git commit -m "Added new language in translator"`
25 | 3. Push the changes using `git push origin ` For example `git push origin vishal-codes`
26 | 4. Submit your changes for review by creating a pull request, if you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button.
27 | 5. Soon I'll be merging all your changes into the master branch of this project. You will get a notification email once the changes have been merged.
28 |
29 | ### Where to go from here?
30 | Congrats! You just completed the standard _fork -> clone -> branch -> edit -> PR_ workflow that you'll encounter often as a contributor!
31 |
32 |
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Widgets
2 |
3 | ## Update
4 | This is a read-only project, so there will not be any further changes in the project and also I have used up my google cloud free credits so google translate api won't work.
5 |
6 | ## Description
7 |
8 | This is a project which I made while learning React.js from a [course on Udemy.](https://www.udemy.com/course/react-redux/) Along with Accordion, Dropdown it has a Search page where in you can search for anything on wikipedia, it uses Wikipedia api for fetching results of the entered search term and displays results on the same page with a button which links to the wikipedia page of a respective result. The project also consists of a translator which uses Google Translate Api for autodetecting the language of entered text and translates it into required language.
9 |
10 | ## Technologies Used
11 |
12 | - React.js
13 | - CSS
14 | - JavaScript
15 | - HTML
16 | - API
17 | - Postman
18 | - Netlify
19 |
20 | #### You can check the deployed version of the project [here](https://wizardly-hoover-38f71b.netlify.app/) and if you want to contribute to the project then checkout [CONTRIBUTING.md](https://github.com/vishal-codes/react-widgets/blob/main/CONTRIBUTING.md) . There are begineer friendly issues listed in the [issues](https://github.com/vishal-codes/react-widgets/issues) section.
21 |
22 |
23 |
24 | ## Project Maintainers 🛠
25 |
26 |
76 | );
77 | }
78 |
79 | export default Dropdown;
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | - Using welcoming and inclusive language
18 | - Being respectful of differing viewpoints and experiences
19 | - Gracefully accepting constructive criticism
20 | - Focusing on what is best for the community
21 | - Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | - The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | - Trolling, insulting/derogatory comments, and personal or political attacks
28 | - Public or private harassment
29 | - Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | - Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## My Responsibilities
35 |
36 | Project maintainer(me) is responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainer has the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainer.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the me at itsvishal2417@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. I am
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 |
65 | ## Attribution
66 |
67 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
68 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
69 |
70 | [homepage]: https://www.contributor-covenant.org
71 |
72 | For answers to common questions about this code of conduct, see
73 | https://www.contributor-covenant.org/faq
74 |
--------------------------------------------------------------------------------
/src/components/pages/TextUtils.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 |
3 | // Buttons Style
4 | const btnStyle = {
5 | backgroundColor: "#0d6efd",
6 | color: "white",
7 | padding: "12px",
8 | borderRadius: "8px",
9 | marginRight: "10px",
10 | cursor: "pointer"
11 | }
12 |
13 | // TextArea Style
14 | const TextAreaStyle = {
15 | backgroundColor: "white",
16 | color:"black",
17 | width: "715px",
18 | resize:"none",
19 | borderRadius: "6px",
20 | fontSize: "20px",
21 | marginBottom: "7px"
22 | }
23 |
24 | // Alert Component
25 | function Alert(props) {
26 | const capitalize =(word)=>{
27 | const lower = word.toLowerCase();
28 | return lower.charAt(0).toUpperCase() + lower.slice(1);
29 | }
30 |
31 | return (
32 | props.alert &&