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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user