-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d115616
commit aa87131
Showing
8 changed files
with
98 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
import Editor from "./components/Editor"; | ||
import "./App.css"; | ||
|
||
const { VITE_LANGUAGE } = import.meta.env; | ||
const { VITE_API_URL, VITE_IDB_NAME, VITE_LANGUAGE, VITE_WS_URL } = import.meta | ||
.env; | ||
|
||
export default function App() { | ||
const urlParams = window.location.pathname.slice(1).split("/"); | ||
const roomId = urlParams[0] === "r" ? urlParams[1] : undefined; | ||
|
||
return ( | ||
<div className="tldraw"> | ||
<Editor roomId={roomId} language={VITE_LANGUAGE} /> | ||
<Editor | ||
idbName={VITE_IDB_NAME} | ||
apiUrl={VITE_API_URL} | ||
wsUrl={VITE_WS_URL} | ||
roomId={roomId} | ||
language={VITE_LANGUAGE} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
export type Settings = { | ||
idbName: string; | ||
apiUrl: string; | ||
wsUrl?: string; | ||
roomId?: string; | ||
readOnly?: boolean; | ||
language?: string; | ||
}; | ||
|
||
export type Default = { | ||
export type Singleplayer = { | ||
apiUrl: string; | ||
language: string; | ||
}; | ||
|
||
export type Multiplayer = { | ||
apiUrl: string; | ||
roomId: string; | ||
language: string; | ||
}; | ||
|
||
export type MultiplayerReadOnly = { | ||
roomId: string; | ||
language: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters