Skip to content

Instantly share code, notes, and snippets.

@hernandazevedozup
Forked from Tiagoperes/invalid.json
Last active October 31, 2022 18:48
Show Gist options
  • Save hernandazevedozup/c525a75a7706afc7816cf12d9213eda3 to your computer and use it in GitHub Desktop.
Save hernandazevedozup/c525a75a7706afc7816cf12d9213eda3 to your computer and use it in GitHub Desktop.
Nimbus navigation test
{
"_:component": "material:button",
"properties": {
"text": "This is an invalid json (extra comma right here)",
}
}
{
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Screen 1"
}
},
{
"properties": {
"text": "This component is malformed (missing the \"component\" key)"
}
}
]
}
{
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Root"
}
},
{
"_:component": "material:button",
"properties": {
"text": "Present",
"onPress": [{
"_:action": "present",
"properties": {
"url": "/presentable.json"
}
}]
}
}
]
}
{
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Presenting"
}
},
{
"_:component": "material:button",
"properties": {
"text": "Present another",
"onPress": [{
"_:action": "present",
"properties": {
"url": "/presentable.json"
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Dismiss",
"onPress": [{
"_:action": "dismiss"
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Start navigation flow",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/screen1.json"
}
}]
}
}
]
}
{
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Screen 1"
}
},
{
"_:component": "material:button",
"properties": {
"text": "Next",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/screen2.json"
}
}]
}
}
]
}
{
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Screen 2"
}
},
{
"_:component": "material:button",
"properties": {
"text": "Next",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/screen3.json"
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Previous",
"onPress": [{
"_:action": "pop"
}]
}
}
]
}
{
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Screen 3"
}
},
{
"_:component": "material:button",
"properties": {
"text": "Next (error with fallback)",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/screen4.json",
"fallback": {
"_:component": "layout:container",
"children": [
{
"_:component": "material:text",
"properties": {
"text": "Error fallback"
}
},
{
"_:component": "material:button",
"properties": {
"text": "Back to /screen1 (popTo)",
"onPress": [{
"_:action": "popTo",
"properties": {
"url": "/screen1.json"
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Back to last page (pop)",
"onPress": [{
"_:action": "pop"
}]
}
}
]
}
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Next (ResponseError: 404)",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/screen4.json"
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Next (MalformedJsonError: invalid json)",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/invalid.json"
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Next (MalformedComponentError)",
"onPress": [{
"_:action": "push",
"properties": {
"url": "/malformed.json"
}
}]
}
},
{
"_:component": "material:button",
"properties": {
"text": "Previous",
"onPress": [{
"_:action": "pop"
}]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment