related-ui-components 2.3.9 → 2.4.1
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 +17 -38
- 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 +30 -44
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,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { createContext, useContext, useState } from "react";
|
|
4
|
-
import { I18nManager
|
|
5
|
-
import { lightTheme, darkTheme } from "./Colors.js";
|
|
3
|
+
import React, { createContext, useContext, useState, useMemo, useEffect } 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:
|
|
7
|
+
theme: {},
|
|
9
8
|
isRTL: I18nManager.isRTL,
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
setTheme: () => {
|
|
10
|
+
console.warn("setTheme was called without a ThemeProvider");
|
|
11
|
+
}
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
// Define props for ThemeProvider
|
|
15
|
-
|
|
16
|
-
// Provider component
|
|
17
|
-
export const RelatedProvider = ({
|
|
13
|
+
export const ThemeProvider = ({
|
|
18
14
|
children,
|
|
19
|
-
|
|
20
|
-
customDarkTheme,
|
|
21
|
-
dark
|
|
22
|
-
// forceRTL,
|
|
15
|
+
theme: initialTheme
|
|
23
16
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
...darkTheme,
|
|
34
|
-
...customDarkTheme
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const toggleTheme = () => setIsDark(prev => !prev);
|
|
38
|
-
const currentTheme = isDark ? themes.dark : themes.light;
|
|
39
|
-
const contextValue = {
|
|
40
|
-
theme: currentTheme,
|
|
41
|
-
isRTL: I18nManager.isRTL,
|
|
42
|
-
isDark,
|
|
43
|
-
toggleTheme
|
|
44
|
-
};
|
|
17
|
+
const [theme, setTheme] = useState(initialTheme);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setTheme(initialTheme);
|
|
20
|
+
}, [initialTheme]);
|
|
21
|
+
const contextValue = useMemo(() => ({
|
|
22
|
+
theme,
|
|
23
|
+
setTheme,
|
|
24
|
+
isRTL: I18nManager.isRTL
|
|
25
|
+
}), [theme]);
|
|
45
26
|
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
46
27
|
value: contextValue,
|
|
47
28
|
children: children
|
|
48
29
|
});
|
|
49
30
|
};
|
|
50
|
-
|
|
51
|
-
// Hook for easy access
|
|
52
31
|
export const useTheme = () => useContext(ThemeContext);
|
|
53
32
|
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","useState","
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useState","useMemo","useEffect","I18nManager","jsx","_jsx","ThemeContext","theme","isRTL","setTheme","console","warn","ThemeProvider","children","initialTheme","contextValue","Provider","value","useTheme"],"sourceRoot":"..\\..\\..\\src","sources":["theme/ThemeContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EAEVC,QAAQ,EACRC,OAAO,EACPC,SAAS,QACJ,OAAO;AACd,SAASC,WAAW,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAS3C,OAAO,MAAMC,YAAY,gBAAGR,aAAa,CAAoB;EAC3DS,KAAK,EAAE,CAAC,CAAc;EACtBC,KAAK,EAAEL,WAAW,CAACK,KAAK;EACxBC,QAAQ,EAAEA,CAAA,KAAM;IACdC,OAAO,CAACC,IAAI,CAAC,6CAA6C,CAAC;EAC7D;AACF,CAAC,CAAC;AAOF,OAAO,MAAMC,aAA2C,GAAGA,CAAC;EAC1DC,QAAQ;EACRN,KAAK,EAAEO;AACT,CAAC,KAAK;EACJ,MAAM,CAACP,KAAK,EAAEE,QAAQ,CAAC,GAAGT,QAAQ,CAAYc,YAAY,CAAC;EAE3DZ,SAAS,CAAC,MAAM;IACdO,QAAQ,CAACK,YAAY,CAAC;EACxB,CAAC,EAAE,CAACA,YAAY,CAAC,CAAC;EAElB,MAAMC,YAAY,GAAGd,OAAO,CAC1B,OAAO;IACLM,KAAK;IACLE,QAAQ;IACRD,KAAK,EAAEL,WAAW,CAACK;EACrB,CAAC,CAAC,EACF,CAACD,KAAK,CACR,CAAC;EAED,oBACEF,IAAA,CAACC,YAAY,CAACU,QAAQ;IAACC,KAAK,EAAEF,YAAa;IAAAF,QAAA,EACxCA;EAAQ,CACY,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMK,QAAQ,GAAGA,CAAA,KAAMnB,UAAU,CAACO,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
|
-
|
|
7
|
-
toggleTheme: () => void;
|
|
6
|
+
setTheme: (theme: ThemeType) => void;
|
|
8
7
|
}
|
|
9
|
-
export declare const ThemeContext: React.Context<
|
|
10
|
-
interface
|
|
8
|
+
export declare const ThemeContext: React.Context<ThemeContextValue>;
|
|
9
|
+
interface ThemeProviderProps {
|
|
11
10
|
children: ReactNode;
|
|
12
|
-
|
|
13
|
-
customDarkTheme?: Partial<ThemeType>;
|
|
14
|
-
dark?: boolean;
|
|
11
|
+
theme: ThemeType;
|
|
15
12
|
}
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const useTheme: () =>
|
|
13
|
+
export declare const ThemeProvider: 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,EAGZ,SAAS,EAIV,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,UAAU,iBAAiB;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,YAAY,kCAMvB,CAAC;AAEH,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwBtD,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,65 +1,52 @@
|
|
|
1
1
|
import React, {
|
|
2
2
|
createContext,
|
|
3
3
|
useContext,
|
|
4
|
+
ReactNode,
|
|
4
5
|
useState,
|
|
6
|
+
useMemo,
|
|
5
7
|
useEffect,
|
|
6
|
-
ReactNode,
|
|
7
8
|
} from "react";
|
|
9
|
+
import { I18nManager } from "react-native";
|
|
10
|
+
import { ThemeType } from "./Colors";
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
import { lightTheme, ThemeType, darkTheme } from "./Colors";
|
|
11
|
-
|
|
12
|
-
interface RelatedContext {
|
|
12
|
+
interface ThemeContextValue {
|
|
13
13
|
theme: ThemeType;
|
|
14
14
|
isRTL: boolean;
|
|
15
|
-
|
|
16
|
-
toggleTheme: () => void;
|
|
15
|
+
setTheme: (theme: ThemeType) => void;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
|
|
18
|
+
export const ThemeContext = createContext<ThemeContextValue>({
|
|
19
|
+
theme: {} as ThemeType,
|
|
20
20
|
isRTL: I18nManager.isRTL,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
setTheme: () => {
|
|
22
|
+
console.warn("setTheme was called without a ThemeProvider");
|
|
23
|
+
},
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
interface RelatedProviderProps {
|
|
26
|
+
interface ThemeProviderProps {
|
|
27
27
|
children: ReactNode;
|
|
28
|
-
|
|
29
|
-
customDarkTheme?: Partial<ThemeType>;
|
|
30
|
-
dark?: boolean;
|
|
31
|
-
// forceRTL?: boolean;
|
|
28
|
+
theme: ThemeType;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
export const RelatedProvider: React.FC<RelatedProviderProps> = ({
|
|
31
|
+
export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
36
32
|
children,
|
|
37
|
-
|
|
38
|
-
customDarkTheme,
|
|
39
|
-
dark,
|
|
40
|
-
// forceRTL,
|
|
33
|
+
theme: initialTheme,
|
|
41
34
|
}) => {
|
|
42
|
-
const [
|
|
43
|
-
|
|
35
|
+
const [theme, setTheme] = useState<ThemeType>(initialTheme);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setTheme(initialTheme);
|
|
39
|
+
}, [initialTheme]);
|
|
40
|
+
|
|
41
|
+
const contextValue = useMemo(
|
|
42
|
+
() => ({
|
|
43
|
+
theme,
|
|
44
|
+
setTheme,
|
|
45
|
+
isRTL: I18nManager.isRTL,
|
|
46
|
+
}),
|
|
47
|
+
[theme],
|
|
44
48
|
);
|
|
45
49
|
|
|
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,
|
|
58
|
-
isRTL: I18nManager.isRTL,
|
|
59
|
-
isDark,
|
|
60
|
-
toggleTheme
|
|
61
|
-
};
|
|
62
|
-
|
|
63
50
|
return (
|
|
64
51
|
<ThemeContext.Provider value={contextValue}>
|
|
65
52
|
{children}
|
|
@@ -67,5 +54,4 @@ export const RelatedProvider: React.FC<RelatedProviderProps> = ({
|
|
|
67
54
|
);
|
|
68
55
|
};
|
|
69
56
|
|
|
70
|
-
|
|
71
|
-
export const useTheme = () => useContext(ThemeContext);
|
|
57
|
+
export const useTheme = () => useContext(ThemeContext);
|