From a7423859322d377d5fcb0149a1361ad3e5c97400 Mon Sep 17 00:00:00 2001 From: PranabKumarSahoo Date: Tue, 5 Mar 2024 23:30:47 +0530 Subject: [PATCH] code updated --- src/Components/CustomComp/Button/Button.css | 1 - .../CustomComp/InputBox/InputBox.css | 6 ++--- .../CustomComp/OutputBox/OutputBox.css | 4 +-- .../CustomComp/OutputBox/OutputBox.jsx | 7 ++--- src/Components/Sidebar/Sidebar.css | 5 ++-- src/Pages/HomePage/HomePage.css | 27 +++---------------- src/Sections/CountOfRows/CountOfRows.css | 4 +-- src/Sections/CountOfRows/CountOfRows.jsx | 22 +++++++-------- .../DropConstraintSec/DropConstraintSec.css | 4 +-- .../DropConstraintSec/DropConstraintSec.jsx | 22 +++++++-------- src/Sections/NthHighest/NthHighest.css | 6 ++--- src/Sections/NthHighest/NthHighest.jsx | 19 +++++++------ src/Sections/NthMinimum/NthMinimum.css | 6 ++--- src/Sections/NthMinimum/NthMinimum.jsx | 6 ++--- .../SelectStatement/SelectStatement.css | 4 +-- .../SelectStatement/SelectStatement.jsx | 18 ++++++------- 16 files changed, 58 insertions(+), 103 deletions(-) diff --git a/src/Components/CustomComp/Button/Button.css b/src/Components/CustomComp/Button/Button.css index b316ec0..7494c69 100644 --- a/src/Components/CustomComp/Button/Button.css +++ b/src/Components/CustomComp/Button/Button.css @@ -15,7 +15,6 @@ .submit-btn:hover { background-color: grey; - /* border: 1px solid rgb(255, 255, 255); */ } .submit-btn:active { diff --git a/src/Components/CustomComp/InputBox/InputBox.css b/src/Components/CustomComp/InputBox/InputBox.css index 4e4ae5d..0c49096 100644 --- a/src/Components/CustomComp/InputBox/InputBox.css +++ b/src/Components/CustomComp/InputBox/InputBox.css @@ -7,9 +7,7 @@ } .input-box-title { - /* color: white; -*/ -color: var(--text_color); + color: var(--text_color); font-size: 20px; } @@ -32,7 +30,7 @@ color: var(--text_color); border-radius: 0 4px 4px 0; border: none; outline: none; - + } .input-box-comp .input-box { diff --git a/src/Components/CustomComp/OutputBox/OutputBox.css b/src/Components/CustomComp/OutputBox/OutputBox.css index 07f5c2e..b78b292 100644 --- a/src/Components/CustomComp/OutputBox/OutputBox.css +++ b/src/Components/CustomComp/OutputBox/OutputBox.css @@ -15,9 +15,7 @@ outline: none; padding: 10px; font-size: 20px; - /* color: white; - */ - color: var(--text_color); + color: var(--text_color); } @media only screen and (max-width: 600px) { diff --git a/src/Components/CustomComp/OutputBox/OutputBox.jsx b/src/Components/CustomComp/OutputBox/OutputBox.jsx index 91e8759..264e0f4 100644 --- a/src/Components/CustomComp/OutputBox/OutputBox.jsx +++ b/src/Components/CustomComp/OutputBox/OutputBox.jsx @@ -15,21 +15,18 @@ export default function OutputBox({ data }) { const textareaRef = useRef(); const handleCopyClick = () => { - // Select the text inside the textarea textareaRef.current.select(); - toast.success("Copied", { position: toast.POSITION.TOP_RIGHT,autoClose:1000 }); + toast.success("Copied", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); - // Change the style and text of the copy button setCopyBtnCss({ position: 'absolute', right: 0, - color: 'green', // Change color back to green on successful copy + color: 'green', }); setCopyBtnText('✓'); document.execCommand('copy'); - // Reset the style and text after two seconds setTimeout(() => { setCopyBtnCss({ position: 'absolute', diff --git a/src/Components/Sidebar/Sidebar.css b/src/Components/Sidebar/Sidebar.css index 4596e51..52ad3a3 100644 --- a/src/Components/Sidebar/Sidebar.css +++ b/src/Components/Sidebar/Sidebar.css @@ -7,8 +7,7 @@ a { .sidebar { width: 300px; height: 100vh; - /* background: linear-gradient(to bottom, #303154, #2e2e4c); -*/background: var(--sidebar-background); + background: var(--sidebar-background); box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); position: fixed; top: 0; @@ -70,4 +69,4 @@ nav ul { .author { margin-bottom: 40px; } -} +} \ No newline at end of file diff --git a/src/Pages/HomePage/HomePage.css b/src/Pages/HomePage/HomePage.css index 1e9431b..9188114 100644 --- a/src/Pages/HomePage/HomePage.css +++ b/src/Pages/HomePage/HomePage.css @@ -4,14 +4,11 @@ flex-direction: column; align-items: center; justify-content: center; - /* background-color: #181828; */ background-color: var(--body_background); } .home-page-title { padding: 20px; - /* color: white; - */ color: var(--home-page-title-color); text-shadow: 1px 1px 3px red; } @@ -19,7 +16,6 @@ #drop-constraint { width: 100%; height: fit-content; - /* background-color: #181828; */ background-color: var(--body_background); width: 100%; display: flex; @@ -30,16 +26,12 @@ } .drop-const-title { - /* color: white; - */ color: var(--home-page-title-color); } #row-count { width: 100%; height: fit-content; - /* background-color: #141421; - */ background-color: var(--body_background); width: 100%; display: flex; @@ -52,8 +44,6 @@ #select-statement { width: 100%; height: fit-content; - /* background-color: #141421; - */ background-color: var(--body_background); width: 100%; display: flex; @@ -66,8 +56,6 @@ #nth-highest { width: 100%; height: fit-content; - /* background-color: #141421; - */ background-color: var(--body_background); width: 100%; display: flex; @@ -80,8 +68,6 @@ #nth-minimum { width: 100%; height: fit-content; - /* background-color: #141421; - */ background-color: var(--body_background); width: 100%; display: flex; @@ -94,8 +80,6 @@ #section-6 { width: 100%; height: fit-content; - /* background-color: #141421; - */ background-color: var(--body_background); width: 100%; display: flex; @@ -118,12 +102,9 @@ .section-4-title, .section-5-title, .section-6-title { - /* color: white; - */ color: var(--home-page-title-color); } -/* Add this style to your HomePage.css or create a new CSS file */ .scroll-up-button { position: fixed; bottom: 20px; @@ -131,17 +112,17 @@ display: flex; align-items: center; justify-content: center; - padding: 10px; - background-color: #007bff; + padding: 12px; + background-color: tomato; color: #fff; border: none; - border-radius: 5px; + border-radius: 50px; cursor: pointer; transition: background-color 0.3s ease; } .scroll-up-button:hover { - background-color: #0056b3; + background-color: rgba(255, 99, 71, 0.709); } @media only screen and (max-width: 600px) { diff --git a/src/Sections/CountOfRows/CountOfRows.css b/src/Sections/CountOfRows/CountOfRows.css index 61e2895..5de392f 100644 --- a/src/Sections/CountOfRows/CountOfRows.css +++ b/src/Sections/CountOfRows/CountOfRows.css @@ -4,8 +4,6 @@ align-items: center; justify-content: center; gap: 30px; - /* background-color: #141421; -*/ -background-color: var(--body_background); + background-color: var(--body_background); width: 100%; } \ No newline at end of file diff --git a/src/Sections/CountOfRows/CountOfRows.jsx b/src/Sections/CountOfRows/CountOfRows.jsx index 3fd5bd5..469c05c 100644 --- a/src/Sections/CountOfRows/CountOfRows.jsx +++ b/src/Sections/CountOfRows/CountOfRows.jsx @@ -5,7 +5,7 @@ import TextBox from '../../Components/CustomComp/TextBox/TextBox'; import Button from '../../Components/CustomComp/Button/Button'; import OutputBox from '../../Components/CustomComp/OutputBox/OutputBox'; import Warning from '../../Components/CustomComp/Warning/Warning'; -import {ToastContainer,toast} from 'react-toastify'; +import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import { countOfRows } from '../../data/guideTexts'; @@ -15,8 +15,8 @@ export default function CountOfRows() { const [specificWord, setSpecificWord] = useState(''); const [outputSql, setOutputSql] = useState(null); const [warnMsg, setWarnMsg] = useState(''); - const [showGuide, setShowGuide] = useState(false); - + const [showGuide, setShowGuide] = useState(false); + const handleTextBoxChange = (value) => { setWordsInput(value); }; @@ -26,12 +26,12 @@ export default function CountOfRows() { } - const notification=(val)=>{ - if(val!==''){ - toast.success("Submitted successfully!",{position:toast.POSITION.TOP_RIGHT,autoClose:1000}); + const notification = (val) => { + if (val !== '') { + toast.success("Submitted successfully!", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); } - else{ - toast.warning("Please enter the schema name",{position:toast.POSITION.TOP_RIGHT,autoClose:1000}); + else { + toast.warning("Please enter the schema name", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); } } @@ -68,8 +68,8 @@ ORDER BY }; const handleGuideButtonClick = () => { setShowGuide(!showGuide); - setOutputSql(showGuide ? countOfRows : null); // Clear output if guide is hidden - }; + setOutputSql(showGuide ? countOfRows : null); + }; return (
@@ -79,7 +79,7 @@ ORDER BY
diff --git a/src/Sections/DropConstraintSec/DropConstraintSec.css b/src/Sections/DropConstraintSec/DropConstraintSec.css index a63c255..ffbf1c6 100644 --- a/src/Sections/DropConstraintSec/DropConstraintSec.css +++ b/src/Sections/DropConstraintSec/DropConstraintSec.css @@ -4,8 +4,6 @@ align-items: center; justify-content: center; gap: 30px; - /* background-color: #141421; -*/ -background-color: var(--body_background); + background-color: var(--body_background); width: 100%; } \ No newline at end of file diff --git a/src/Sections/DropConstraintSec/DropConstraintSec.jsx b/src/Sections/DropConstraintSec/DropConstraintSec.jsx index d76bfa7..24dc272 100644 --- a/src/Sections/DropConstraintSec/DropConstraintSec.jsx +++ b/src/Sections/DropConstraintSec/DropConstraintSec.jsx @@ -3,7 +3,7 @@ import './DropConstraintSec.css' import TextBox from '../../Components/CustomComp/TextBox/TextBox' import Button from '../../Components/CustomComp/Button/Button' import OutputBox from '../../Components/CustomComp/OutputBox/OutputBox' -import {ToastContainer,toast} from 'react-toastify'; +import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import { dropConstraint } from '../../data/guideTexts' @@ -15,12 +15,12 @@ export default function DropConstraintSec() { setTextBoxValue(value); }; - const notification=(val)=>{ - if(val>0){ - toast.success("Submitted successfully!",{position:toast.POSITION.TOP_RIGHT,autoClose:1000}); + const notification = (val) => { + if (val > 0) { + toast.success("Submitted successfully!", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); } - else{ - toast.warning("Please enter key constraint",{position:toast.POSITION.TOP_RIGHT,autoClose:1000}); + else { + toast.warning("Please enter key constraint", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); } } @@ -39,13 +39,9 @@ export default function DropConstraintSec() { if (line.includes(":")) { result = result.replace(":", " DROP CONSTRAINT "); } - - // Add a new line character after each transformed line result += ";\n"; } } - - // Set the result to the state setOutputData(result); } else { notification(0); @@ -54,8 +50,8 @@ export default function DropConstraintSec() { }; const handleGuideButtonClick = () => { setShowGuide(!showGuide); - setOutputData(showGuide ? dropConstraint : null); // Clear output if guide is hidden - }; + setOutputData(showGuide ? dropConstraint : null); + }; return (
{ + if (val) { + toast.success("Submitted successfully!", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); } - else{ - toast.warning("Please enter values for all input",{position:toast.POSITION.TOP_CENTER,autoClose:1000}); + else { + toast.warning("Please enter values for all input", { position: toast.POSITION.TOP_CENTER, autoClose: 1000 }); } -} + } const generateSelectStat = () => { if (columnName && tableName && nthHighest) { @@ -49,7 +48,7 @@ export default function NthHighest() { }; const handleGuideButtonClick = () => { setShowGuide(!showGuide); - setOutputState(showGuide ? nthHighestText : null); // Clear output if guide is hidden + setOutputState(showGuide ? nthHighestText : null); }; return (
@@ -59,7 +58,7 @@ export default function NthHighest() {
); diff --git a/src/Sections/NthMinimum/NthMinimum.css b/src/Sections/NthMinimum/NthMinimum.css index 626be70..7057624 100644 --- a/src/Sections/NthMinimum/NthMinimum.css +++ b/src/Sections/NthMinimum/NthMinimum.css @@ -4,8 +4,6 @@ align-items: center; justify-content: center; gap: 30px; - /* background-color: #141421; -*/ -background-color: var(--body_background); + background-color: var(--body_background); width: 100%; -} +} \ No newline at end of file diff --git a/src/Sections/NthMinimum/NthMinimum.jsx b/src/Sections/NthMinimum/NthMinimum.jsx index 7e673f6..b6533fd 100644 --- a/src/Sections/NthMinimum/NthMinimum.jsx +++ b/src/Sections/NthMinimum/NthMinimum.jsx @@ -24,8 +24,6 @@ export default function NthMinimum() { const generateSelectStat = () => { if (columnName && tableName && nthMinimum) { - - //n_minus_1 for MySQL Syntax const n_minus_1 = parseInt(nthMinimum, 10) - 1; const result = ` Using Oracle 10g: @@ -53,7 +51,7 @@ export default function NthMinimum() { }; const handleGuideButtonClick = () => { setShowGuide(!showGuide); - setOutputState(showGuide ? NthMinimumText : null); // Clear output if guide is hidden + setOutputState(showGuide ? NthMinimumText : null); }; return ( @@ -64,7 +62,7 @@ export default function NthMinimum() {
); } diff --git a/src/Sections/SelectStatement/SelectStatement.css b/src/Sections/SelectStatement/SelectStatement.css index 2a8fe99..629412e 100644 --- a/src/Sections/SelectStatement/SelectStatement.css +++ b/src/Sections/SelectStatement/SelectStatement.css @@ -4,9 +4,7 @@ align-items: center; justify-content: center; gap: 30px; - /* background-color: #141421; -*/ -background-color: var(--body_background); + background-color: var(--body_background); width: 100%; } diff --git a/src/Sections/SelectStatement/SelectStatement.jsx b/src/Sections/SelectStatement/SelectStatement.jsx index 8de44cb..bac07dc 100644 --- a/src/Sections/SelectStatement/SelectStatement.jsx +++ b/src/Sections/SelectStatement/SelectStatement.jsx @@ -4,7 +4,7 @@ import TextBox from '../../Components/CustomComp/TextBox/TextBox' import InputBox from '../../Components/CustomComp/InputBox/InputBox'; import Button from '../../Components/CustomComp/Button/Button'; import OutputBox from '../../Components/CustomComp/OutputBox/OutputBox'; -import {ToastContainer,toast} from 'react-toastify'; +import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import { SelectStatementText } from '../../data/guideTexts'; @@ -26,12 +26,12 @@ export default function SelectStatement() { } } - const notification=(val)=>{ - if(val){ - toast.success("Submitted successfully!",{position:toast.POSITION.TOP_RIGHT,autoClose:1000}); + const notification = (val) => { + if (val) { + toast.success("Submitted successfully!", { position: toast.POSITION.TOP_RIGHT, autoClose: 1000 }); } - else{ - toast.warning("Please Enter The Tables Name or Middle Statement",{position:toast.POSITION.TOP_CENTER,autoClose:1000}); + else { + toast.warning("Please Enter The Tables Name or Middle Statement", { position: toast.POSITION.TOP_CENTER, autoClose: 1000 }); } } const generateSelectStat = () => { @@ -59,8 +59,8 @@ export default function SelectStatement() { } const handleGuideButtonClick = () => { setShowGuide(!showGuide); - setOutputState(showGuide ? SelectStatementText : null); // Clear output if guide is hidden - }; + setOutputState(showGuide ? SelectStatementText : null); + }; return (
@@ -73,7 +73,7 @@ export default function SelectStatement() {
)