mirror of
https://github.com/khairul169/code-share.git
synced 2025-04-28 16:49:36 +07:00
merge remote
This commit is contained in:
parent
7703eea760
commit
064f89af68
@ -33,7 +33,8 @@ const CodeEditor = (props: Props) => {
|
|||||||
|
|
||||||
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
|
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
|
||||||
target: monaco.languages.typescript.ScriptTarget.Latest,
|
target: monaco.languages.typescript.ScriptTarget.Latest,
|
||||||
allowNonTsExtensions: true,
|
allowNonTsExtensions: false,
|
||||||
|
allowImportingTsExtensions: true,
|
||||||
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
|
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
|
||||||
module: monaco.languages.typescript.ModuleKind.CommonJS,
|
module: monaco.languages.typescript.ModuleKind.CommonJS,
|
||||||
noEmit: true,
|
noEmit: true,
|
||||||
|
@ -40,15 +40,13 @@ const FileViewer = ({ id }: Props) => {
|
|||||||
return <p>File not found.</p>;
|
return <p>File not found.</p>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { filename } = data;
|
|
||||||
|
|
||||||
if (!data.isFile) {
|
if (!data.isFile) {
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<LoadingLayout />}>
|
<Suspense fallback={<LoadingLayout />}>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
filename={filename}
|
filename={data.filename}
|
||||||
path={data.path}
|
path={data.path}
|
||||||
value={data?.content || ""}
|
value={data.content || ""}
|
||||||
formatOnSave
|
formatOnSave
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
updateFileContent.mutate({
|
updateFileContent.mutate({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user