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:
@@ -45,10 +45,14 @@ interface BaseProps {
|
|||||||
*/
|
*/
|
||||||
contentPaddingBottom?: number;
|
contentPaddingBottom?: number;
|
||||||
/**
|
/**
|
||||||
* Padding untuk content container (default: 16)
|
* Padding Top untuk content container (default: 8)
|
||||||
* Set to 0 untuk tidak ada padding, atau custom value sesuai kebutuhan
|
|
||||||
*/
|
*/
|
||||||
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 {
|
interface StaticModeProps extends BaseProps {
|
||||||
@@ -83,7 +87,8 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
|
|||||||
enableKeyboardHandling = false,
|
enableKeyboardHandling = false,
|
||||||
keyboardScrollOffset = 100,
|
keyboardScrollOffset = 100,
|
||||||
contentPaddingBottom = 80, // Default 80 untuk navigasi device
|
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;
|
} = props;
|
||||||
|
|
||||||
const assetBackground = require("../../assets/images/main-background.png");
|
const assetBackground = require("../../assets/images/main-background.png");
|
||||||
@@ -137,8 +142,9 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
|
|||||||
ListEmptyComponent={listProps.ListEmptyComponent}
|
ListEmptyComponent={listProps.ListEmptyComponent}
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
paddingTop: contentPaddingTop,
|
||||||
|
paddingHorizontal: contentPaddingHorizontal,
|
||||||
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
||||||
padding: contentPadding,
|
|
||||||
}}
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
/>
|
/>
|
||||||
@@ -186,8 +192,9 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
|
|||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
paddingTop: contentPaddingTop,
|
||||||
|
paddingHorizontal: contentPaddingHorizontal,
|
||||||
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
||||||
padding: contentPadding,
|
|
||||||
}}
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export default function Job_MainViewStatus2() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper_V2
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderJobItem}
|
renderItem={renderJobItem}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export default function Job_ScreenArchive2() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper_V2
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderJobItem}
|
renderItem={renderJobItem}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export default function Job_ScreenBeranda2() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper_V2
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
hideFooter
|
hideFooter
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<View style={{ paddingTop: 8 }}>
|
<View style={{ paddingTop: 8 }}>
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ export function Job_ScreenCreate() {
|
|||||||
<NewWrapper_V2
|
<NewWrapper_V2
|
||||||
enableKeyboardHandling
|
enableKeyboardHandling
|
||||||
keyboardScrollOffset={100}
|
keyboardScrollOffset={100}
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
footerComponent={buttonSubmit()}
|
footerComponent={buttonSubmit()}
|
||||||
>
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ export function Job_ScreenEdit() {
|
|||||||
<NewWrapper_V2
|
<NewWrapper_V2
|
||||||
enableKeyboardHandling
|
enableKeyboardHandling
|
||||||
keyboardScrollOffset={100}
|
keyboardScrollOffset={100}
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
footerComponent={buttonSubmit()}
|
footerComponent={buttonSubmit()}
|
||||||
>
|
>
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user