diff --git a/english_to_ipa_translator/src/Components/Header.js b/english_to_ipa_translator/src/Components/Header.js index 9935fa5..bb90c6f 100644 --- a/english_to_ipa_translator/src/Components/Header.js +++ b/english_to_ipa_translator/src/Components/Header.js @@ -7,6 +7,7 @@ import { Button, } from "@material-ui/core"; import MenuIcon from "@material-ui/icons/Menu"; +import { Link } from "react-router-dom"; export default class Header extends Component { render() { return ( @@ -33,8 +34,9 @@ export default class Header extends Component { {/* */} - - About us + + About us + ); diff --git a/english_to_ipa_translator/src/Components/ResultBox.js b/english_to_ipa_translator/src/Components/ResultBox.js new file mode 100644 index 0000000..fe1f8b0 --- /dev/null +++ b/english_to_ipa_translator/src/Components/ResultBox.js @@ -0,0 +1,24 @@ +import * as React from "react"; +import Card from "@material-ui/core/Card"; +import CardActions from "@material-ui/core/CardActions"; +import CardContent from "@material-ui/core/CardContent"; +import Typography from "@material-ui/core/Typography"; +import Button from "@material-ui/core/Button"; +import CardHeader from "@material-ui/core/CardHeader"; +import { NoWordsFound } from "./Notification"; + +export default function ResultBox({ result, englishWord }) { + return ( + + + + + {result ?? } + + + + + + + ); +} diff --git a/english_to_ipa_translator/src/Pages/Index.js b/english_to_ipa_translator/src/Pages/Index.js index 9e87623..5164734 100644 --- a/english_to_ipa_translator/src/Pages/Index.js +++ b/english_to_ipa_translator/src/Pages/Index.js @@ -7,6 +7,7 @@ import { getIPAData } from "../API/index"; import { useState } from "react"; import { Searching, NoWordsFound } from "../Components/Notification"; import { makeStyles } from "@material-ui/core/styles"; +import ResultBox from "../Components/ResultBox"; const useStyles = makeStyles((theme) => ({ root: { @@ -47,52 +48,47 @@ const Index = () => { }; return ( - - +
-
{ + setEnglishWord(e.target.value); + if (e.target.value) { + setIPAValue(""); + } }} + /> + { + inputValue(); + }} + onSubmit={inputValue} > - { - setEnglishWord(e.target.value); - if (e.target.value) { - setIPAValue(""); - } - }} - /> - { - inputValue(); - }} - onSubmit={inputValue} - > - - -
- + + +
+
{searchStatus && } - {englishWord && ( - - {ipaValue === "" ? : ipaValue} - - )} - - + {ipaValue && } +
+ ); }; diff --git a/english_to_ipa_translator/src/index.js b/english_to_ipa_translator/src/index.js index ef2edf8..e651122 100644 --- a/english_to_ipa_translator/src/index.js +++ b/english_to_ipa_translator/src/index.js @@ -1,14 +1,22 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; +import React from "react"; +import ReactDOM from "react-dom"; +import "./index.css"; +import App from "./App"; +import reportWebVitals from "./reportWebVitals"; +import { createBrowserRouter, RouterProvider } from "react-router-dom"; + +const router = createBrowserRouter([ + { + path: "/", + element: , + }, +]); ReactDOM.render( - + , - document.getElementById('root') + document.getElementById("root") ); // If you want to start measuring performance in your app, pass a function