@@ -7,21 +7,10 @@ import Layout from '@theme/Layout';
77import HomepageFeatures from '@site/src/components/HomepageFeatures' ;
88import CodeEditor from '@site/src/components/CodeEditor2' ;
99import { Box , TextField , MenuItem } from '@mui/material' ;
10- import Select , { SelectChangeEvent } from '@mui/material/Select'
11-
12-
13-
14-
15-
1610import useGeoLocation from "react-ipgeolocation" ;
17-
1811import { useColorMode } from '@docusaurus/theme-common' ;
19-
20-
21- import { EditorView } from '@codemirror/view' ;
22-
12+ import { EditorView } from '@codemirror/view' ;
2313import { Blocks } from 'react-loader-spinner'
24-
2514import useIsBrowser from '@docusaurus/useIsBrowser' ;
2615
2716
@@ -43,7 +32,7 @@ export const defaultLightThemeOption = EditorView.theme(
4332import styles from './index.module.css' ;
4433import { height } from '@mui/system' ;
4534
46-
35+ //Array of Languages on right side of code editor
4736const languages = [
4837
4938 {
@@ -55,8 +44,9 @@ const languages = [
5544 direction : "rtl" ,
5645 fontFamily : "'Roboto Mono'" ,
5746 toEnglishDict : "'languages/ur/ur_native.lang.yaml'" ,
47+ fontWeights : "bold" ,
5848 style : {
59- fontWeight : "bold" ,
49+
6050 direction : "rtl"
6151 }
6252 } ,
@@ -67,17 +57,18 @@ const languages = [
6757 code2 : "hi" ,
6858 name : "Hindi" ,
6959 i18nName : "Hindi" ,
70- fontFamily : "'Hack', 'Courier New', monospaced" ,
60+ fontFamily : "'Roboto Mono'" ,
61+
7162 toEnglishDict : "'languages/hi/hi_native.lang.yaml'" ,
7263 } ,
7364 {
7465 id : "EN" ,
75- // default: true,
7666 code3 : "eng" ,
7767 code2 : "en" ,
7868 name : "English" ,
7969 i18nName : "English" ,
80- fontFamily : "'Hack', 'Courier New', monospaced" ,
70+ fontFamily : "'Roboto Mono'" ,
71+
8172 }
8273]
8374
@@ -339,15 +330,15 @@ export default function Home() {
339330 ***********************************************
340331 *********************************************** */ }
341332
342- < div style = { {
343- padding : "80px"
344-
345- } } >
333+ < div style = { {
334+ padding : "80px"
335+
336+ } } >
346337
347338
348339
349340 < Box width = "250px" >
350- < TextField select fullWidth label = "Select preset " onChange = { ( e ) => {
341+ < TextField select fullWidth label = "Select Preset " onChange = { ( e ) => {
351342 console . log ( "e.target.value:" , e . target . value ) ;
352343 console . log ( `languages.find(l => l.id === e.target.value)` , initialCodes . find ( l => l . id === e . target . value ) )
353344 setCode ( initialCodes . find ( l => l . id === e . target . value ) . en ) ;
@@ -367,54 +358,24 @@ export default function Home() {
367358 }
368359 < MenuItem value = "custom" > Custom</ MenuItem >
369360 </ TextField >
370-
371361 </ Box >
372362
373-
363+ { /* *****************************************
364+ ********DIV FOR THE LANGUAGE SECTION**********
365+ ***********************************************
366+ ************************************************/ }
374367
375368
376- { /* <select style={{
377- flex: 1,
378- // // width: "100%",
379- margin: "12px",
380-
381-
382-
383-
384-
385- }}
386-
387- onChange={(e) => {
388- console.log("e.target.value:", e.target.value);
389- console.log(`languages.find(l => l.id === e.target.value)`, initialCodes.find(l => l.id === e.target.value))
390- setCode(initialCodes.find(l => l.id === e.target.value).en);
391- }}
392- value={initialCodes.find(c => {
393- console.log("c.en === code:", c.en === code);
394- return c.en === code
395- })?.id || "custom"}
396- key={code}
397- >
398- {
399- initialCodes.map((l, idx) => {
400- return (
401- <option value={l.id}>{l.name}</option>
402- )
403- })
404- }
405- <option value="custom">Custom</option>
406- </select> */ }
407- < div style = { {
408- display : "flex" ,
409- flexDirection : "row" ,
410- marginTop : "12px" ,
411- } } >
412- < div
369+ < div style = { {
370+ display : "flex" ,
371+ flexDirection : "row" ,
372+ marginTop : "12px" ,
373+ } } >
374+ < div
413375 style = { {
414376 flex : 1 ,
415377 } } >
416378
417- { /* **************************Language*********************************** */ }
418379 < Box width = "250px" >
419380 < TextField label = "Select Language" fullWidth select onChange = { ( e ) => {
420381 console . log ( "e.target.value:" , e . target . value ) ;
@@ -434,28 +395,6 @@ export default function Home() {
434395 </ TextField >
435396 </ Box >
436397
437- { /* <select style={{
438- flex: 1,
439- // width: "100%",
440- margin: "12px",
441-
442- }}
443-
444- onChange={(e) => {
445- console.log("e.target.value:", e.target.value);
446- console.log(`languages.find(l => l.id === e.target.value)`, languages.find(l => l.id === e.target.value))
447- setSourceLanguage(languages.find(l => l.id === e.target.value));
448- }}
449- value={sourceLanguage?.id}
450- >
451- {
452- languages.map((l, idx) => {
453- return (
454- <option value={l.id}>{l.name}</option>
455- )
456- })
457- }
458- </select> */ }
459398< IDE id = "python-code-editor1"
460399 value = { code }
461400 mode = "python"
@@ -497,7 +436,7 @@ export default function Home() {
497436 ⇄
498437 </ button >
499438
500- < div
439+ < div
501440 style = { {
502441 flex : 1 ,
503442 marginLeft : "12px" ,
@@ -512,7 +451,7 @@ export default function Home() {
512451 } }
513452 value = { targetLanguage ?. id }
514453 >
515- {
454+ {
516455 languages . map ( ( l , idx ) => {
517456 return (
518457 < MenuItem value = { l . id } > { l . name } { targetLanguage ?. id === l . id ? isDetected ? " - detected" : "" : "" } </ MenuItem >
@@ -522,29 +461,6 @@ export default function Home() {
522461 </ TextField >
523462 </ Box >
524463
525- { /* <select style={{
526- flex: 1,
527- // width: "100%",
528- margin: "12px",
529-
530- }}
531-
532- onChange={(e) => {
533- console.log("e.target.value:", e.target.value);
534- console.log(`languages.find(l => l.id === e.target.value)`, languages.find(l => l.id === e.target.value))
535- setTargetLanguage(languages.find(l => l.id === e.target.value));
536- setIsDetected(false);
537- }}
538- value={targetLanguage?.id}
539- >
540- {
541- languages.map((l, idx) => {
542- return (
543- <option value={l.id}>{l.name} {targetLanguage?.id === l.id ? isDetected ? " - detected" : "" : ""}</option>
544- )
545- })
546- }
547- </select> */ }
548464< IDE
549465 id = "python-code-editor2"
550466 // value={code
0 commit comments