feat: Implement OS_Wrapper system and migrate all Job screens
Create OS-specific wrapper system: - Add IOSWrapper (based on NewWrapper for iOS) - Add AndroidWrapper (based on NewWrapper_V2 with keyboard handling) - Add OS_Wrapper (auto platform detection) - Add PageWrapper (with keyboard handling for Android forms) Migrate all Job screens (8 files): - ScreenJobCreate: NewWrapper_V2 → PageWrapper - ScreenJobEdit: NewWrapper_V2 → PageWrapper - ScreenBeranda2: NewWrapper_V2 → OS_Wrapper - ScreenArchive2: NewWrapper_V2 → OS_Wrapper - MainViewStatus2: NewWrapper_V2 → OS_Wrapper - ScreenBeranda: ViewWrapper → OS_Wrapper - ScreenArchive: ViewWrapper → OS_Wrapper - MainViewStatus: ViewWrapper → OS_Wrapper Benefits: - Automatic platform detection (no manual Platform.OS checks) - Consistent tabs behavior across iOS and Android - Keyboard handling for forms (Android only) - Cleaner code with unified API Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
import {
|
||||
BaseBox,
|
||||
LoaderCustom,
|
||||
OS_Wrapper,
|
||||
ScrollableCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
||||
@@ -64,7 +64,7 @@ export default function Job_MainViewStatus() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper headerComponent={scrollComponent} hideFooter>
|
||||
<OS_Wrapper headerComponent={scrollComponent} hideFooter>
|
||||
{isLoadList ? (
|
||||
<LoaderCustom />
|
||||
) : _.isEmpty(listData) ? (
|
||||
@@ -85,7 +85,7 @@ export default function Job_MainViewStatus() {
|
||||
</BaseBox>
|
||||
))
|
||||
)}
|
||||
</ViewWrapper>
|
||||
</OS_Wrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
import { BaseBox, NewWrapper_V2, ScrollableCustom, TextCustom } from "@/components";
|
||||
import { BaseBox, OS_Wrapper, ScrollableCustom, TextCustom } from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||
@@ -86,7 +86,7 @@ export default function Job_MainViewStatus2() {
|
||||
);
|
||||
|
||||
return (
|
||||
<NewWrapper_V2
|
||||
<OS_Wrapper
|
||||
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
||||
listData={pagination.listData}
|
||||
renderItem={renderJobItem}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
import { BaseBox, LoaderCustom, TextCustom, ViewWrapper } from "@/components";
|
||||
import { BaseBox, LoaderCustom, OS_Wrapper, TextCustom } from "@/components";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { apiJobGetAll } from "@/service/api-client/api-job";
|
||||
import { useFocusEffect } from "expo-router";
|
||||
@@ -33,7 +33,7 @@ export default function Job_ScreenArchive() {
|
||||
};
|
||||
|
||||
return (
|
||||
<ViewWrapper hideFooter>
|
||||
<OS_Wrapper hideFooter>
|
||||
{isLoadData ? (
|
||||
<LoaderCustom />
|
||||
) : _.isEmpty(listData) ? (
|
||||
@@ -52,6 +52,6 @@ export default function Job_ScreenArchive() {
|
||||
</BaseBox>
|
||||
))
|
||||
)}
|
||||
</ViewWrapper>
|
||||
</OS_Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
import { BaseBox, NewWrapper_V2, TextCustom, ViewWrapper } from "@/components";
|
||||
import { BaseBox, OS_Wrapper, TextCustom, ViewWrapper } from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
@@ -55,7 +55,7 @@ export default function Job_ScreenArchive2() {
|
||||
);
|
||||
|
||||
return (
|
||||
<NewWrapper_V2
|
||||
<OS_Wrapper
|
||||
listData={pagination.listData}
|
||||
renderItem={renderJobItem}
|
||||
refreshControl={
|
||||
|
||||
@@ -3,11 +3,11 @@ import {
|
||||
BoxWithHeaderSection,
|
||||
FloatingButton,
|
||||
LoaderCustom,
|
||||
OS_Wrapper,
|
||||
SearchInput,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { apiJobGetAll } from "@/service/api-client/api-job";
|
||||
import { router, useFocusEffect } from "expo-router";
|
||||
@@ -43,7 +43,7 @@ export default function Job_ScreenBeranda() {
|
||||
};
|
||||
|
||||
return (
|
||||
<ViewWrapper
|
||||
<OS_Wrapper
|
||||
hideFooter
|
||||
floatingButton={
|
||||
<FloatingButton onPress={() => router.push("/job/create")} />
|
||||
@@ -78,6 +78,6 @@ export default function Job_ScreenBeranda() {
|
||||
))
|
||||
)}
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
</OS_Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
AvatarUsernameAndOtherComponent,
|
||||
BoxWithHeaderSection,
|
||||
FloatingButton,
|
||||
NewWrapper_V2,
|
||||
OS_Wrapper,
|
||||
SearchInput,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
@@ -74,7 +74,7 @@ export default function Job_ScreenBeranda2() {
|
||||
);
|
||||
|
||||
return (
|
||||
<NewWrapper_V2
|
||||
<OS_Wrapper
|
||||
hideFooter
|
||||
headerComponent={
|
||||
<View style={{ paddingTop: 8 }}>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ButtonCustom,
|
||||
InformationBox,
|
||||
LandscapeFrameUploaded,
|
||||
NewWrapper_V2,
|
||||
PageWrapper,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
@@ -118,7 +118,7 @@ export function Job_ScreenCreate() {
|
||||
};
|
||||
|
||||
return (
|
||||
<NewWrapper_V2
|
||||
<PageWrapper
|
||||
enableKeyboardHandling
|
||||
keyboardScrollOffset={100}
|
||||
footerComponent={buttonSubmit()}
|
||||
@@ -174,6 +174,6 @@ export function Job_ScreenCreate() {
|
||||
/>
|
||||
</View>
|
||||
</StackCustom>
|
||||
</NewWrapper_V2>
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
InformationBox,
|
||||
LandscapeFrameUploaded,
|
||||
LoaderCustom,
|
||||
NewWrapper_V2,
|
||||
PageWrapper,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
@@ -134,7 +134,7 @@ export function Job_ScreenEdit() {
|
||||
};
|
||||
|
||||
return (
|
||||
<NewWrapper_V2
|
||||
<PageWrapper
|
||||
enableKeyboardHandling
|
||||
keyboardScrollOffset={100}
|
||||
footerComponent={buttonSubmit()}
|
||||
@@ -203,6 +203,6 @@ export function Job_ScreenEdit() {
|
||||
{buttonSubmit()}
|
||||
</StackCustom>
|
||||
)}
|
||||
</NewWrapper_V2>
|
||||
</PageWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user