Skip to content

Commit

Permalink
chore: add example ydoc when loading from url
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Jul 26, 2024
1 parent 7d549e6 commit 5088f44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/load-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import { useYDoc } from "../state";
import { fileToYDoc } from "../utils";
import { toast } from "./ui/use-toast";

const ExampleYDocUrl =
"https://insider.affine.pro/api/workspaces/af3478a2-9c9c-4d16-864d-bffa1eb10eb6/docs/-3bEQPBoOEkNH13ULW9Ed";

function LoadFromUrlDialog({ children }: { children: React.ReactNode }) {
const [open, setOpen] = useState(false);
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -73,6 +76,7 @@ function LoadFromUrlDialog({ children }: { children: React.ReactNode }) {
id="load-from-url-input"
type="url"
placeholder="https://example.com/ydoc"
defaultValue={ExampleYDocUrl}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
Expand Down

0 comments on commit 5088f44

Please sign in to comment.