Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated code Templates #62

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,40 @@ export const LANGUAGES = [
ID: LANGUAGE_ID_FOR_JAVASCRIPT,
NAME: "Javascript",
DEFAULT_LANGUAGE: "javascript",
LOGO: <JavascriptLogo/>
LOGO: <JavascriptLogo />,
HELLO_WORLD: `console.log("Hello World")
`
},
{
ID: LANGUAGE_ID_FOR_PYTHON3,
NAME: "Python3",
DEFAULT_LANGUAGE: "python",
LOGO: <PythonLogo/>
LOGO: <PythonLogo />,
HELLO_WORLD: `print("Hello World")
`
},
{
ID: LANGUAGE_ID_FOR_CPP,
NAME: "C++",
DEFAULT_LANGUAGE: "C++(Clang 7.0.1)",
LOGO: <CppLogo/>
LOGO: <CppLogo />,
HELLO_WORLD: `#include<iostream>
using namespace std;
int main(){
cout<<"Hello World"<<endl;
return 0;
}`
},
{
ID: LANGUAGE_ID_FOR_JAVA,
NAME: "Java",
DEFAULT_LANGUAGE: "java",
LOGO: <JavaLogo/>
LOGO: <JavaLogo />,
HELLO_WORLD: `public class Main
{
public static void main(String[] args) {
System.out.println("Hello World");
}
}`
},
];
1 change: 1 addition & 0 deletions src/pages/EditorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function EditorComponent() {
LANGUAGE_NAME: selectedLanguage.NAME,
DEFAULT_LANGUAGE: selectedLanguage.DEFAULT_LANGUAGE,
});
setCode(selectedLanguage.HELLO_WORLD);
}, [currentLanguage]);

// Reference to the Monaco editor instance
Expand Down