refactor: Update NewWrapper_V2 padding defaults

- Change default paddingTop to 8
- Change default paddingHorizontal to 0 (safe for existing layouts)
- Add explicit contentPaddingHorizontal={16} to Job screens
- Update interface documentation

This makes NewWrapper_V2 safer for mass migration while keeping
Job screens looking good with proper spacing.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-04-04 09:16:15 +08:00
parent b34bc3799e
commit 940d31bfdc
6 changed files with 18 additions and 6 deletions

View File

@@ -45,10 +45,14 @@ interface BaseProps {
*/
contentPaddingBottom?: number;
/**
* Padding untuk content container (default: 16)
* Set to 0 untuk tidak ada padding, atau custom value sesuai kebutuhan
* Padding Top untuk content container (default: 8)
*/
contentPadding?: number;
contentPaddingTop?: number;
/**
* Padding Horizontal untuk content container (default: 0)
* Set ke 16 atau lebih jika butuh spacing di kiri-kanan
*/
contentPaddingHorizontal?: number;
}
interface StaticModeProps extends BaseProps {
@@ -83,7 +87,8 @@ 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
contentPaddingTop = 8, // Default 8 untuk spacing atas
contentPaddingHorizontal = 0, // Default 0 agar aman untuk layout existing
} = props;
const assetBackground = require("../../assets/images/main-background.png");
@@ -137,8 +142,9 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
ListEmptyComponent={listProps.ListEmptyComponent}
contentContainerStyle={{
flexGrow: 1,
paddingTop: contentPaddingTop,
paddingHorizontal: contentPaddingHorizontal,
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
padding: contentPadding,
}}
keyboardShouldPersistTaps="handled"
/>
@@ -186,8 +192,9 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
style={{ flex: 1 }}
contentContainerStyle={{
flexGrow: 1,
paddingTop: contentPaddingTop,
paddingHorizontal: contentPaddingHorizontal,
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
padding: contentPadding,
}}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}

View File

@@ -87,6 +87,7 @@ export default function Job_MainViewStatus2() {
return (
<NewWrapper_V2
contentPaddingHorizontal={16}
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
listData={pagination.listData}
renderItem={renderJobItem}

View File

@@ -56,6 +56,7 @@ export default function Job_ScreenArchive2() {
return (
<NewWrapper_V2
contentPaddingHorizontal={16}
listData={pagination.listData}
renderItem={renderJobItem}
refreshControl={

View File

@@ -75,6 +75,7 @@ export default function Job_ScreenBeranda2() {
return (
<NewWrapper_V2
contentPaddingHorizontal={16}
hideFooter
headerComponent={
<View style={{ paddingTop: 8 }}>

View File

@@ -121,6 +121,7 @@ export function Job_ScreenCreate() {
<NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
contentPaddingHorizontal={16}
footerComponent={buttonSubmit()}
>
<StackCustom gap={"xs"}>

View File

@@ -138,6 +138,7 @@ export function Job_ScreenEdit() {
<NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
contentPaddingHorizontal={16}
footerComponent={buttonSubmit()}
>
{isLoadData ? (