Start typing to search...

UI.navigate

Provides methods for controlling navigation within your Koji app.

Methods

.createRemix(appId)

Starts a new customization.

Parameters

  • appId - String (Optional), ID of the Koji project to customize. Defaults to the current Koji app if an ID is not specified.

Example

<button type="button" onClick={() => Koji.ui.navigate.createRemix()}>
  Create my own customization
</button>

Source: frontend/ui/navigate/index.ts#L67

.dismiss()

Closes a Koji app that is in a modal window.

Example

<button type="button" onClick={() => Koji.ui.navigate.dismiss()}>
  Close window
</button>

Source: frontend/ui/navigate/index.ts#L110

.edit()

Opens the Koji app in editing mode.

Note
Check that the current user is an admin before calling this method. Otherwise, the user will not be authorized to edit the Koji app.

Example

<button type="button" onClick={() => Koji.ui.navigate.edit()}>
  Edit this Koji
</button>

Source: frontend/ui/navigate/index.ts#L92

.openShareDialog(url)

Opens the sharing dialog box. By default, the dialog box shares the URL of the current Koji. Specify a full or a relative URL to open a dialog box for sharing a different URL or for a deep link into your Koji app.

Note
If you use this method to share a deep link in your Koji app, a koji.to short URL is automatically created for it.

Parameters

  • url - String (Optional), URL to use instead of the current Koji.

Example

<button type="button" onClick={() => Koji.ui.navigate.openShareDialog()}>
  Share this Koji
</button>

// full URL
<button type="button" onClick={() => Koji.ui.navigate.openShareDialog('https://withkoji.com/@myname')}>
  Share your profile
</button>

// relative URL
<button type="button" onClick={() => Koji.ui.navigate.openShareDialog('?key=value')}>
  Share this info
</button>

Source: frontend/ui/navigate/index.ts#L143

.presentInModal(url)

Opens the content at the specified URL in a modal window that animates from the bottom of the screen. If the parent Koji is already displayed in a modal window, the content will open in the same window, replacing the current view.

Parameters

  • url - String, URL of the content to load.

Example

<button type="button" onClick={() => Koji.ui.navigate.presentInModal(url)}>
  My favorite Koji
</button>

Source: frontend/ui/navigate/index.ts#L44

.to(url)

Replaces the currently loaded Koji with the content at the specified URL.

Parameters

  • url - String, URL of the content to load.

Example

<button type="button" onClick={() => Koji.ui.navigate.to(url)}>
 My favorite Koji
</button>

Source: frontend/ui/navigate/index.ts#L21