Skip to content

Commit

Permalink
feat: Add Announcement Banner Schema and JSON (#7)
Browse files Browse the repository at this point in the history
* feat: add announcement banner schema and json

* feat: set is chain halted as true

* feat: add start and end date to top announcement banner

* feat: add 'isChainHalted' to top announcement banner

* feat: remove "isChainHalted" property from
"swap-rotating-banner" schema and add
"isChainHalted" property to
"top-announcement-banner" schema

* Update top announcement banner settings

* Remove unnecessary code in
top-announcement-banner.json
  • Loading branch information
JoseRFelix authored Jan 8, 2024
1 parent bdcbc27 commit fc63454
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cms/top-announcement-banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "../schemas/top-announcement-banner.schema.json",
"isChainHalted": false,
"banner": {
"enTextOrLocalizationPath": "This is a test of the top announcement banner.",
"link": {
"enTextOrLocalizationKey": "Click here to learn more.",
"isExternal": true,
"url": "https://www.google.com"
},
"localStorageKey": "top-announcement-banner-test"
}
}
67 changes: 67 additions & 0 deletions schemas/top-announcement-banner.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"isChainHalted": {
"type": "boolean"
},
"banner": {
"type": ["object", "null"],
"properties": {
"localStorageKey": {
"type": "string"
},
"pageRoute": {
"type": "string",
"$comment": "Leave undefined to include all pages."
},
"enTextOrLocalizationPath": {
"type": "string",
"$comment": "English text or key into localization jsons."
},
"link": {
"type": "object",
"properties": {
"enTextOrLocalizationKey": {
"type": "string",
"$comment": "English text or key into localization jsons."
},
"url": {
"type": "string"
},
"isExternal": {
"type": "boolean",
"$comment": "External to Osmosis. Show disclaimer before linking out of app."
}
},
"$comment": "Link to external page.",
"required": ["url"]
},
"isWarning": {
"type": "boolean",
"$comment": "Use orange styling, persist on page reloads."
},
"persistent": {
"type": "boolean",
"$comment": "Will always show on page reload. Use with caution. (Warnings persist)"
},
"bg": {
"type": "string",
"$comment": "Custom Background color."
},
"startDate": {
"type": "string",
"format": "date-time",
"$comment": "ISO 8601 date-time string. Banner will not show until this date."
},
"endDate": {
"type": "string",
"format": "date-time",
"$comment": "ISO 8601 date-time string. Banner will not show after this date."
}
},
"required": ["enTextOrLocalizationPath"]
}
},
"required": ["banner", "isChainHalted"]
}

0 comments on commit fc63454

Please sign in to comment.