-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gnoweb): "No render" page/component (#3611)
## Description Defining a `Render()` function in realms is optional. Currently gnoweb presents an error if a realm that doesn't have a render func is requested. This should not be the case. This PR also adds a VM error, `RenderNotDeclared`, which is to be returned when `vm/qrender` is called on a realm which does not have a `Render()` function declared. I updated the status component to return the following in the aforementioned case: <img width="1557" alt="Screenshot 2025-01-25 at 16 30 55" src="https://github.com/user-attachments/assets/dc82c1d6-d815-4d92-a1a9-7639cbf7bca2" /> Also adds another `r/docs` realm mentioning that a render function is optional in `r/`.
- Loading branch information
Showing
14 changed files
with
139 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module gno.land/r/docs/optional_render |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package optional_render | ||
|
||
func Info() string { | ||
return `Having a Render() function in your realm is optional! | ||
If you do decide to have a Render() function, it must have the following signature: | ||
func Render(path string) 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
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,8 +1,12 @@ | ||
{{ define "status" }} | ||
<div class="col-span-10 flex flex-col h-full w-full mt-10 pb-24 justify-center items-center"> | ||
<img src="/public/imgs/gnoland.svg" alt="gno land" width="70px" height="70px" /> | ||
<h1 class="text-600 font-bold text-gray-600 pb-4 capitalize"><span>Error:</span> <span>{{ .Message }}</span></h1> | ||
<p class="pb-3">Something went wrong. Let’s find our way back!</p> | ||
<a href="/" class="rounded border py-1 px-2 hover:bg-gray-100">Go Back Home</a> | ||
<h1 class="text-600 font-bold text-gray-600 pb-4 capitalize"> | ||
{{ .Title }} | ||
</h1> | ||
<p class="pb-3">{{ .Body }}</p> | ||
<a href="{{ .ButtonURL }}" class="rounded border py-1 px-2 hover:bg-gray-100"> | ||
{{ .ButtonText }} | ||
</a> | ||
</div> | ||
{{ end }} |
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
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
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