related-ui-components 2.3.9 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/app.js +109 -106
- package/lib/module/app.js.map +1 -1
- package/lib/module/theme/ThemeContext.js +7 -36
- package/lib/module/theme/ThemeContext.js.map +1 -1
- package/lib/typescript/src/app.d.ts +1 -3
- package/lib/typescript/src/app.d.ts.map +1 -1
- package/lib/typescript/src/theme/ThemeContext.d.ts +7 -10
- package/lib/typescript/src/theme/ThemeContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +105 -92
- package/src/theme/ThemeContext.tsx +14 -48
package/lib/module/app.js
CHANGED
|
@@ -1,109 +1,112 @@
|
|
|
1
|
-
|
|
1
|
+
// import React, { useState } from "react";
|
|
2
|
+
// import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
3
|
+
// import CarouselCardStack from "./components/CarouselCardStack/CarouselCardStack"; // Adjust path as needed
|
|
4
|
+
// import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
5
|
+
// import { CarRentalForm, DateRangePicker, FlightForm, FlightSummary, HotelForm, HotelSummary, Filters} from "./components";
|
|
6
|
+
// import { RelatedProvider, useTheme } from "./theme";
|
|
7
|
+
|
|
8
|
+
// // Sample data - replace with your actual image URLs
|
|
9
|
+
// const DUMMY_DATA = [
|
|
10
|
+
// {
|
|
11
|
+
// id: "1",
|
|
12
|
+
// image:
|
|
13
|
+
// "https://images.pexels.com/photos/3354648/pexels-photo-3354648.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
14
|
+
// title: "Mountain Lake",
|
|
15
|
+
// },
|
|
16
|
+
// // {
|
|
17
|
+
// // id: "2",
|
|
18
|
+
// // image:
|
|
19
|
+
// // "https://images.pexels.com/photos/163273/sunrise-speedboat-ocean-water-163273.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
20
|
+
// // title: "Sunset Cruise",
|
|
21
|
+
// // },
|
|
22
|
+
// {
|
|
23
|
+
// id: "3",
|
|
24
|
+
// image:
|
|
25
|
+
// "https://images.pexels.com/photos/1430677/pexels-photo-1430677.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
26
|
+
// title: "Ocean Horizon",
|
|
27
|
+
// },
|
|
28
|
+
// {
|
|
29
|
+
// id: "4",
|
|
30
|
+
// image:
|
|
31
|
+
// "https://images.pexels.com/photos/2387793/pexels-photo-2387793.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
32
|
+
// title: "Forest Trail",
|
|
33
|
+
// },
|
|
34
|
+
// // {
|
|
35
|
+
// // id: "5",
|
|
36
|
+
// // image:
|
|
37
|
+
// // "https://images.pexels.com/photos/302804/pexels-photo-302804.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
38
|
+
// // title: "City Lights",
|
|
39
|
+
// // },
|
|
40
|
+
// ];
|
|
41
|
+
|
|
42
|
+
// const App = () => {
|
|
43
|
+
// const { theme } = useTheme();
|
|
2
44
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Adjust path as needed
|
|
6
|
-
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
7
|
-
import { Filters } from "./components/index.js";
|
|
8
|
-
import { RelatedProvider, useTheme } from "./theme/index.js";
|
|
45
|
+
// const [departureDate, setDepartureDate] = useState<string | undefined>(undefined);
|
|
46
|
+
// const [returnDate, setReturnDate] = useState<string | undefined>(undefined);
|
|
9
47
|
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// {
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// }
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onActionButtonPress: result => {
|
|
75
|
-
// setFiltersResult(result);
|
|
76
|
-
},
|
|
77
|
-
sortOptions: [{
|
|
78
|
-
id: 1,
|
|
79
|
-
name: "test",
|
|
80
|
-
value: "test"
|
|
81
|
-
}]
|
|
82
|
-
// onClose={() => setDisplayFilters(false)}
|
|
83
|
-
,
|
|
84
|
-
applyButtonStyle: {
|
|
85
|
-
borderRadius: 8,
|
|
86
|
-
backgroundColor: "black"
|
|
87
|
-
},
|
|
88
|
-
applyButtonTextStyle: {
|
|
89
|
-
color: theme.secondary
|
|
90
|
-
},
|
|
91
|
-
headerStyle: {
|
|
92
|
-
borderBottomWidth: 0
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
})]
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
const styles = StyleSheet.create({
|
|
101
|
-
appContainer: {
|
|
102
|
-
flex: 1,
|
|
103
|
-
backgroundColor: "#212121",
|
|
104
|
-
// Match carousel background or choose another
|
|
105
|
-
justifyContent: "center" // Center the carousel vertically if it's the main content
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
export default App;
|
|
48
|
+
// return (
|
|
49
|
+
// <>
|
|
50
|
+
// <RelatedProvider>
|
|
51
|
+
// <GestureHandlerRootView style={{ flex: 1 }}>
|
|
52
|
+
// <StatusBar barStyle="light-content" />
|
|
53
|
+
// <SafeAreaView style={styles.appContainer}>
|
|
54
|
+
// <DateRangePicker
|
|
55
|
+
// onDatesChange={(t) => {
|
|
56
|
+
// setDepartureDate(t.departure);
|
|
57
|
+
// setReturnDate(t.return);
|
|
58
|
+
// }}
|
|
59
|
+
// departureDate={departureDate}
|
|
60
|
+
// // departureDisplayValue={departureDate}
|
|
61
|
+
// returnDate={returnDate}
|
|
62
|
+
// // returnDisplayValue={returnDate}
|
|
63
|
+
// ></DateRangePicker>
|
|
64
|
+
// {/* <Filters
|
|
65
|
+
// bottomSheetBackgroundStyle={{
|
|
66
|
+
// borderTopRightRadius: 30,
|
|
67
|
+
// borderTopLeftRadius: 30,
|
|
68
|
+
// padding: 10,
|
|
69
|
+
// backgroundColor: "white",
|
|
70
|
+
// }}
|
|
71
|
+
// containerStyle={{
|
|
72
|
+
// backgroundColor: "white",
|
|
73
|
+
// borderTopRightRadius: 60,
|
|
74
|
+
// borderTopLeftRadius: 60,
|
|
75
|
+
// }}
|
|
76
|
+
// resetTextStyle={{ color: theme.primary }}
|
|
77
|
+
// sectionTitleStyle={{ color: "black" }}
|
|
78
|
+
// titleStyle={{ color: "black" }}
|
|
79
|
+
// onActionButtonPress={(result) => {
|
|
80
|
+
// // setFiltersResult(result);
|
|
81
|
+
// }}
|
|
82
|
+
// sortOptions={[{ id: 1, name: "test", value: "test" }]}
|
|
83
|
+
// // onClose={() => setDisplayFilters(false)}
|
|
84
|
+
// applyButtonStyle={{ borderRadius: 8, backgroundColor: "black" }}
|
|
85
|
+
// applyButtonTextStyle={{ color: theme.secondary }}
|
|
86
|
+
// headerStyle={{ borderBottomWidth: 0 }}
|
|
87
|
+
// ></Filters> */}
|
|
88
|
+
// {/* <FlightSummary></FlightSummary> */}
|
|
89
|
+
// {/* <FlightForm></FlightForm> */}
|
|
90
|
+
// {/* <HotelSummary></HotelSummary> */}
|
|
91
|
+
// {/* <HotelForm></HotelForm> */}
|
|
92
|
+
// {/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
93
|
+
// {/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
94
|
+
// {/* <CarouselCardStack data={DUMMY_DATA} /> */}
|
|
95
|
+
// </SafeAreaView>
|
|
96
|
+
// </GestureHandlerRootView>
|
|
97
|
+
// </RelatedProvider>
|
|
98
|
+
// </>
|
|
99
|
+
// );
|
|
100
|
+
// };
|
|
101
|
+
|
|
102
|
+
// const styles = StyleSheet.create({
|
|
103
|
+
// appContainer: {
|
|
104
|
+
// flex: 1,
|
|
105
|
+
// backgroundColor: "#212121", // Match carousel background or choose another
|
|
106
|
+
// justifyContent: "center", // Center the carousel vertically if it's the main content
|
|
107
|
+
// },
|
|
108
|
+
// });
|
|
109
|
+
|
|
110
|
+
// export default App;
|
|
111
|
+
"use strict";
|
|
109
112
|
//# sourceMappingURL=app.js.map
|
package/lib/module/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA","ignoreList":[]}
|
|
@@ -1,53 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { createContext, useContext
|
|
4
|
-
import { I18nManager
|
|
5
|
-
import { lightTheme, darkTheme } from "./Colors.js";
|
|
3
|
+
import React, { createContext, useContext } from "react";
|
|
4
|
+
import { I18nManager } from "react-native";
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
export const ThemeContext = /*#__PURE__*/createContext({
|
|
8
|
-
theme:
|
|
9
|
-
isRTL: I18nManager.isRTL
|
|
10
|
-
isDark: false,
|
|
11
|
-
toggleTheme: () => {}
|
|
7
|
+
theme: {},
|
|
8
|
+
isRTL: I18nManager.isRTL
|
|
12
9
|
});
|
|
13
|
-
|
|
14
|
-
// Define props for ThemeProvider
|
|
15
|
-
|
|
16
|
-
// Provider component
|
|
17
10
|
export const RelatedProvider = ({
|
|
18
11
|
children,
|
|
19
|
-
|
|
20
|
-
customDarkTheme,
|
|
21
|
-
dark
|
|
22
|
-
// forceRTL,
|
|
12
|
+
theme
|
|
23
13
|
}) => {
|
|
24
|
-
const [isDark, setIsDark] = useState(dark || useColorScheme() === "dark");
|
|
25
|
-
|
|
26
|
-
// Allow custom themes to override defaults
|
|
27
|
-
const [themes, setThemes] = useState({
|
|
28
|
-
light: {
|
|
29
|
-
...lightTheme,
|
|
30
|
-
...customLightTheme
|
|
31
|
-
},
|
|
32
|
-
dark: {
|
|
33
|
-
...darkTheme,
|
|
34
|
-
...customDarkTheme
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const toggleTheme = () => setIsDark(prev => !prev);
|
|
38
|
-
const currentTheme = isDark ? themes.dark : themes.light;
|
|
39
14
|
const contextValue = {
|
|
40
|
-
theme
|
|
41
|
-
isRTL: I18nManager.isRTL
|
|
42
|
-
isDark,
|
|
43
|
-
toggleTheme
|
|
15
|
+
theme,
|
|
16
|
+
isRTL: I18nManager.isRTL
|
|
44
17
|
};
|
|
45
18
|
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
46
19
|
value: contextValue,
|
|
47
20
|
children: children
|
|
48
21
|
});
|
|
49
22
|
};
|
|
50
|
-
|
|
51
|
-
// Hook for easy access
|
|
52
23
|
export const useTheme = () => useContext(ThemeContext);
|
|
53
24
|
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","I18nManager","jsx","_jsx","ThemeContext","theme","isRTL","RelatedProvider","children","contextValue","Provider","value","useTheme"],"sourceRoot":"..\\..\\..\\src","sources":["theme/ThemeContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAmB,OAAO;AACnE,SAASC,WAAW,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ3C,OAAO,MAAMC,YAAY,gBAAGL,aAAa,CAAoB;EAC3DM,KAAK,EAAE,CAAC,CAAc;EACtBC,KAAK,EAAEL,WAAW,CAACK;AACrB,CAAC,CAAC;AAQF,OAAO,MAAMC,eAA6C,GAAGA,CAAC;EAC5DC,QAAQ;EACRH;AACF,CAAC,KAAK;EACJ,MAAMI,YAA+B,GAAG;IACtCJ,KAAK;IACLC,KAAK,EAAEL,WAAW,CAACK;EACrB,CAAC;EAED,oBACEH,IAAA,CAACC,YAAY,CAACM,QAAQ;IAACC,KAAK,EAAEF,YAAa;IAAAD,QAAA,EACxCA;EAAQ,CACY,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMI,QAAQ,GAAGA,CAAA,KAAMZ,UAAU,CAACI,YAAY,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":""}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { ThemeType } from "./Colors";
|
|
3
|
-
interface
|
|
3
|
+
interface ThemeContextValue {
|
|
4
4
|
theme: ThemeType;
|
|
5
5
|
isRTL: boolean;
|
|
6
|
-
isDark: boolean;
|
|
7
|
-
toggleTheme: () => void;
|
|
8
6
|
}
|
|
9
|
-
export declare const ThemeContext: React.Context<
|
|
10
|
-
interface
|
|
7
|
+
export declare const ThemeContext: React.Context<ThemeContextValue>;
|
|
8
|
+
interface ThemeProviderProps {
|
|
11
9
|
children: ReactNode;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
dark?: boolean;
|
|
10
|
+
theme: ThemeType;
|
|
11
|
+
toggleTheme: () => void;
|
|
15
12
|
}
|
|
16
|
-
export declare const RelatedProvider: React.FC<
|
|
17
|
-
export declare const useTheme: () =>
|
|
13
|
+
export declare const RelatedProvider: React.FC<ThemeProviderProps>;
|
|
14
|
+
export declare const useTheme: () => ThemeContextValue;
|
|
18
15
|
export {};
|
|
19
16
|
//# sourceMappingURL=ThemeContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/theme/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,UAAU,iBAAiB;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,kCAGvB,CAAC;AAEH,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAcxD,CAAC;AAEF,eAAO,MAAM,QAAQ,yBAAiC,CAAC"}
|
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -1,97 +1,110 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
3
|
-
import CarouselCardStack from "./components/CarouselCardStack/CarouselCardStack"; // Adjust path as needed
|
|
4
|
-
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
5
|
-
import { CarRentalForm, DateRangePicker, FlightForm, FlightSummary, HotelForm, HotelSummary, Filters} from "./components";
|
|
6
|
-
import { RelatedProvider, useTheme } from "./theme";
|
|
1
|
+
// import React, { useState } from "react";
|
|
2
|
+
// import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
3
|
+
// import CarouselCardStack from "./components/CarouselCardStack/CarouselCardStack"; // Adjust path as needed
|
|
4
|
+
// import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
5
|
+
// import { CarRentalForm, DateRangePicker, FlightForm, FlightSummary, HotelForm, HotelSummary, Filters} from "./components";
|
|
6
|
+
// import { RelatedProvider, useTheme } from "./theme";
|
|
7
7
|
|
|
8
|
-
// Sample data - replace with your actual image URLs
|
|
9
|
-
const DUMMY_DATA = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
];
|
|
8
|
+
// // Sample data - replace with your actual image URLs
|
|
9
|
+
// const DUMMY_DATA = [
|
|
10
|
+
// {
|
|
11
|
+
// id: "1",
|
|
12
|
+
// image:
|
|
13
|
+
// "https://images.pexels.com/photos/3354648/pexels-photo-3354648.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
14
|
+
// title: "Mountain Lake",
|
|
15
|
+
// },
|
|
16
|
+
// // {
|
|
17
|
+
// // id: "2",
|
|
18
|
+
// // image:
|
|
19
|
+
// // "https://images.pexels.com/photos/163273/sunrise-speedboat-ocean-water-163273.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
20
|
+
// // title: "Sunset Cruise",
|
|
21
|
+
// // },
|
|
22
|
+
// {
|
|
23
|
+
// id: "3",
|
|
24
|
+
// image:
|
|
25
|
+
// "https://images.pexels.com/photos/1430677/pexels-photo-1430677.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
26
|
+
// title: "Ocean Horizon",
|
|
27
|
+
// },
|
|
28
|
+
// {
|
|
29
|
+
// id: "4",
|
|
30
|
+
// image:
|
|
31
|
+
// "https://images.pexels.com/photos/2387793/pexels-photo-2387793.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
32
|
+
// title: "Forest Trail",
|
|
33
|
+
// },
|
|
34
|
+
// // {
|
|
35
|
+
// // id: "5",
|
|
36
|
+
// // image:
|
|
37
|
+
// // "https://images.pexels.com/photos/302804/pexels-photo-302804.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
38
|
+
// // title: "City Lights",
|
|
39
|
+
// // },
|
|
40
|
+
// ];
|
|
41
41
|
|
|
42
|
-
const App = () => {
|
|
43
|
-
|
|
42
|
+
// const App = () => {
|
|
43
|
+
// const { theme } = useTheme();
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<RelatedProvider>
|
|
48
|
-
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
49
|
-
<StatusBar barStyle="light-content" />
|
|
50
|
-
<SafeAreaView style={styles.appContainer}>
|
|
51
|
-
<Filters
|
|
52
|
-
bottomSheetBackgroundStyle={{
|
|
53
|
-
borderTopRightRadius: 30,
|
|
54
|
-
borderTopLeftRadius: 30,
|
|
55
|
-
padding: 10,
|
|
56
|
-
backgroundColor: "white",
|
|
57
|
-
}}
|
|
58
|
-
containerStyle={{
|
|
59
|
-
backgroundColor: "white",
|
|
60
|
-
borderTopRightRadius: 60,
|
|
61
|
-
borderTopLeftRadius: 60,
|
|
62
|
-
}}
|
|
63
|
-
resetTextStyle={{ color: theme.primary }}
|
|
64
|
-
sectionTitleStyle={{ color: "black" }}
|
|
65
|
-
titleStyle={{ color: "black" }}
|
|
66
|
-
onActionButtonPress={(result) => {
|
|
67
|
-
// setFiltersResult(result);
|
|
68
|
-
}}
|
|
69
|
-
sortOptions={[{ id: 1, name: "test", value: "test" }]}
|
|
70
|
-
// onClose={() => setDisplayFilters(false)}
|
|
71
|
-
applyButtonStyle={{ borderRadius: 8, backgroundColor: "black" }}
|
|
72
|
-
applyButtonTextStyle={{ color: theme.secondary }}
|
|
73
|
-
headerStyle={{ borderBottomWidth: 0 }}
|
|
74
|
-
></Filters>
|
|
75
|
-
{/* <FlightSummary></FlightSummary> */}
|
|
76
|
-
{/* <FlightForm></FlightForm> */}
|
|
77
|
-
{/* <HotelSummary></HotelSummary> */}
|
|
78
|
-
{/* <HotelForm></HotelForm> */}
|
|
79
|
-
{/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
80
|
-
{/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
81
|
-
{/* <CarouselCardStack data={DUMMY_DATA} /> */}
|
|
82
|
-
</SafeAreaView>
|
|
83
|
-
</GestureHandlerRootView>
|
|
84
|
-
</RelatedProvider>
|
|
85
|
-
</>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
45
|
+
// const [departureDate, setDepartureDate] = useState<string | undefined>(undefined);
|
|
46
|
+
// const [returnDate, setReturnDate] = useState<string | undefined>(undefined);
|
|
88
47
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
48
|
+
// return (
|
|
49
|
+
// <>
|
|
50
|
+
// <RelatedProvider>
|
|
51
|
+
// <GestureHandlerRootView style={{ flex: 1 }}>
|
|
52
|
+
// <StatusBar barStyle="light-content" />
|
|
53
|
+
// <SafeAreaView style={styles.appContainer}>
|
|
54
|
+
// <DateRangePicker
|
|
55
|
+
// onDatesChange={(t) => {
|
|
56
|
+
// setDepartureDate(t.departure);
|
|
57
|
+
// setReturnDate(t.return);
|
|
58
|
+
// }}
|
|
59
|
+
// departureDate={departureDate}
|
|
60
|
+
// // departureDisplayValue={departureDate}
|
|
61
|
+
// returnDate={returnDate}
|
|
62
|
+
// // returnDisplayValue={returnDate}
|
|
63
|
+
// ></DateRangePicker>
|
|
64
|
+
// {/* <Filters
|
|
65
|
+
// bottomSheetBackgroundStyle={{
|
|
66
|
+
// borderTopRightRadius: 30,
|
|
67
|
+
// borderTopLeftRadius: 30,
|
|
68
|
+
// padding: 10,
|
|
69
|
+
// backgroundColor: "white",
|
|
70
|
+
// }}
|
|
71
|
+
// containerStyle={{
|
|
72
|
+
// backgroundColor: "white",
|
|
73
|
+
// borderTopRightRadius: 60,
|
|
74
|
+
// borderTopLeftRadius: 60,
|
|
75
|
+
// }}
|
|
76
|
+
// resetTextStyle={{ color: theme.primary }}
|
|
77
|
+
// sectionTitleStyle={{ color: "black" }}
|
|
78
|
+
// titleStyle={{ color: "black" }}
|
|
79
|
+
// onActionButtonPress={(result) => {
|
|
80
|
+
// // setFiltersResult(result);
|
|
81
|
+
// }}
|
|
82
|
+
// sortOptions={[{ id: 1, name: "test", value: "test" }]}
|
|
83
|
+
// // onClose={() => setDisplayFilters(false)}
|
|
84
|
+
// applyButtonStyle={{ borderRadius: 8, backgroundColor: "black" }}
|
|
85
|
+
// applyButtonTextStyle={{ color: theme.secondary }}
|
|
86
|
+
// headerStyle={{ borderBottomWidth: 0 }}
|
|
87
|
+
// ></Filters> */}
|
|
88
|
+
// {/* <FlightSummary></FlightSummary> */}
|
|
89
|
+
// {/* <FlightForm></FlightForm> */}
|
|
90
|
+
// {/* <HotelSummary></HotelSummary> */}
|
|
91
|
+
// {/* <HotelForm></HotelForm> */}
|
|
92
|
+
// {/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
93
|
+
// {/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
94
|
+
// {/* <CarouselCardStack data={DUMMY_DATA} /> */}
|
|
95
|
+
// </SafeAreaView>
|
|
96
|
+
// </GestureHandlerRootView>
|
|
97
|
+
// </RelatedProvider>
|
|
98
|
+
// </>
|
|
99
|
+
// );
|
|
100
|
+
// };
|
|
96
101
|
|
|
97
|
-
|
|
102
|
+
// const styles = StyleSheet.create({
|
|
103
|
+
// appContainer: {
|
|
104
|
+
// flex: 1,
|
|
105
|
+
// backgroundColor: "#212121", // Match carousel background or choose another
|
|
106
|
+
// justifyContent: "center", // Center the carousel vertically if it's the main content
|
|
107
|
+
// },
|
|
108
|
+
// });
|
|
109
|
+
|
|
110
|
+
// export default App;
|
|
@@ -1,63 +1,30 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
useState,
|
|
5
|
-
useEffect,
|
|
6
|
-
ReactNode,
|
|
7
|
-
} from "react";
|
|
1
|
+
import React, { createContext, useContext, ReactNode } from "react";
|
|
2
|
+
import { I18nManager } from "react-native";
|
|
3
|
+
import { ThemeType } from "./Colors";
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
import { lightTheme, ThemeType, darkTheme } from "./Colors";
|
|
11
|
-
|
|
12
|
-
interface RelatedContext {
|
|
5
|
+
interface ThemeContextValue {
|
|
13
6
|
theme: ThemeType;
|
|
14
7
|
isRTL: boolean;
|
|
15
|
-
isDark: boolean,
|
|
16
|
-
toggleTheme: () => void;
|
|
17
8
|
}
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
|
|
10
|
+
export const ThemeContext = createContext<ThemeContextValue>({
|
|
11
|
+
theme: {} as ThemeType,
|
|
20
12
|
isRTL: I18nManager.isRTL,
|
|
21
|
-
isDark: false,
|
|
22
|
-
toggleTheme: () => {}
|
|
23
13
|
});
|
|
24
14
|
|
|
25
|
-
|
|
26
|
-
interface RelatedProviderProps {
|
|
15
|
+
interface ThemeProviderProps {
|
|
27
16
|
children: ReactNode;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
dark?: boolean;
|
|
31
|
-
// forceRTL?: boolean;
|
|
17
|
+
theme: ThemeType;
|
|
18
|
+
toggleTheme: () => void;
|
|
32
19
|
}
|
|
33
20
|
|
|
34
|
-
|
|
35
|
-
export const RelatedProvider: React.FC<RelatedProviderProps> = ({
|
|
21
|
+
export const RelatedProvider: React.FC<ThemeProviderProps> = ({
|
|
36
22
|
children,
|
|
37
|
-
|
|
38
|
-
customDarkTheme,
|
|
39
|
-
dark,
|
|
40
|
-
// forceRTL,
|
|
23
|
+
theme,
|
|
41
24
|
}) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
// Allow custom themes to override defaults
|
|
47
|
-
const [themes, setThemes] = useState({
|
|
48
|
-
light: { ...lightTheme, ...customLightTheme } as ThemeType,
|
|
49
|
-
dark: { ...darkTheme, ...customDarkTheme } as ThemeType,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const toggleTheme = () => setIsDark((prev) => !prev);
|
|
53
|
-
|
|
54
|
-
const currentTheme = isDark ? themes.dark : themes.light;
|
|
55
|
-
|
|
56
|
-
const contextValue: RelatedContext = {
|
|
57
|
-
theme: currentTheme,
|
|
25
|
+
const contextValue: ThemeContextValue = {
|
|
26
|
+
theme,
|
|
58
27
|
isRTL: I18nManager.isRTL,
|
|
59
|
-
isDark,
|
|
60
|
-
toggleTheme
|
|
61
28
|
};
|
|
62
29
|
|
|
63
30
|
return (
|
|
@@ -67,5 +34,4 @@ export const RelatedProvider: React.FC<RelatedProviderProps> = ({
|
|
|
67
34
|
);
|
|
68
35
|
};
|
|
69
36
|
|
|
70
|
-
// Hook for easy access
|
|
71
37
|
export const useTheme = () => useContext(ThemeContext);
|