feat: Add default contentPadding to NewWrapper_V2

- Set default contentPadding to 16px for consistent spacing
- Added contentPadding prop to BaseProps interface
- Updated documentation in TASK-004

Benefits:
- All screens automatically have 16px padding
- Cleaner code (no need to specify padding everywhere)
- Still customizable (set to 0 or custom value if needed)
- Box content not too tight to screen edges

Phase 1 completed with consistent padding!

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-04-02 17:16:19 +08:00
parent 7cb4f30ae9
commit b34bc3799e
2 changed files with 44 additions and 1 deletions

View File

@@ -44,6 +44,11 @@ interface BaseProps {
* Extra padding bottom for content to avoid navigation bar (default: 80)
*/
contentPaddingBottom?: number;
/**
* Padding untuk content container (default: 16)
* Set to 0 untuk tidak ada padding, atau custom value sesuai kebutuhan
*/
contentPadding?: number;
}
interface StaticModeProps extends BaseProps {
@@ -78,6 +83,7 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
enableKeyboardHandling = false,
keyboardScrollOffset = 100,
contentPaddingBottom = 80, // Default 80 untuk navigasi device
contentPadding = 16, // Default 16 untuk padding konsisten
} = props;
const assetBackground = require("../../assets/images/main-background.png");
@@ -132,6 +138,7 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
contentContainerStyle={{
flexGrow: 1,
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
padding: contentPadding,
}}
keyboardShouldPersistTaps="handled"
/>
@@ -180,6 +187,7 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
contentContainerStyle={{
flexGrow: 1,
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
padding: contentPadding,
}}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}