Fix capsule-aligned navigation and refresh mini program typography
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
function navigationGeometry(info = {}, menu = {}) {
|
||||
const width = info.windowWidth || 375;
|
||||
const height = info.windowHeight || 812;
|
||||
const status = info.statusBarHeight || 24;
|
||||
const validMenu = menu.top >= status && menu.height > 0 && menu.left > 0 && menu.left < width;
|
||||
const top = validMenu ? menu.top : status + 6;
|
||||
const rowHeight = validMenu ? menu.height : 32;
|
||||
const menuLeft = validMenu ? menu.left : width - 100;
|
||||
const headerHeight = top + rowHeight + 12;
|
||||
return {
|
||||
top,
|
||||
rowHeight,
|
||||
titleWidth: Math.max(80, menuLeft - 28),
|
||||
headerHeight,
|
||||
scrollHeight: Math.max(0, height - headerHeight),
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = { navigationGeometry };
|
||||
Reference in New Issue
Block a user