feat: migrate static pages to native tabbar
This commit is contained in:
22
utils/static-ux/shared.js
Normal file
22
utils/static-ux/shared.js
Normal file
@@ -0,0 +1,22 @@
|
||||
function cloneItem(item) {
|
||||
return { ...item }
|
||||
}
|
||||
|
||||
function cloneList(items) {
|
||||
return items.map(cloneItem)
|
||||
}
|
||||
|
||||
function resolveScene(rawScene, allowedScenes, fallbackScene) {
|
||||
return allowedScenes.includes(rawScene) ? rawScene : fallbackScene
|
||||
}
|
||||
|
||||
function resolveKind(rawKind, allowedKinds, fallbackKind) {
|
||||
return allowedKinds.includes(rawKind) ? rawKind : fallbackKind
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
cloneItem,
|
||||
cloneList,
|
||||
resolveScene,
|
||||
resolveKind
|
||||
}
|
||||
Reference in New Issue
Block a user