@tradly/asset 1.0.14 → 1.0.16
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/README.md +172 -15
- package/dist/esm/index.js +3 -0
- package/dist/esm/native/FileUpload.native.js +35 -23
- package/dist/esm/native/MediaGallery.native.js +17 -10
- package/dist/esm/native/MediaPopup.native.js +44 -23
- package/dist/esm/native/MediaTab.native.js +66 -41
- package/dist/esm/native/Pagination.native.js +43 -19
- package/dist/esm/native/THEME_EXAMPLE.js +112 -0
- package/dist/esm/native/VideosGallery.native.js +14 -7
- package/dist/esm/native/theme.js +167 -0
- package/dist/index.js +14 -0
- package/dist/native/FileUpload.native.js +35 -23
- package/dist/native/MediaGallery.native.js +17 -10
- package/dist/native/MediaPopup.native.js +44 -23
- package/dist/native/MediaTab.native.js +62 -37
- package/dist/native/Pagination.native.js +43 -19
- package/dist/native/THEME_EXAMPLE.js +117 -0
- package/dist/native/VideosGallery.native.js +14 -7
- package/dist/native/theme.js +173 -0
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _MediaGallery = _interopRequireDefault(require("./MediaGallery.native"));
|
|
11
11
|
var _VideosGallery = _interopRequireDefault(require("./VideosGallery.native"));
|
|
12
|
+
var _theme = require("./theme");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -28,18 +29,24 @@ var MediaTab = function MediaTab(_ref) {
|
|
|
28
29
|
onError = _ref.onError,
|
|
29
30
|
picker = _ref.picker,
|
|
30
31
|
pickerOptions = _ref.pickerOptions,
|
|
32
|
+
_ref$theme = _ref.theme,
|
|
33
|
+
theme = _ref$theme === void 0 ? _theme.defaultTheme : _ref$theme,
|
|
31
34
|
containerStyle = _ref.containerStyle,
|
|
32
35
|
tabListStyle = _ref.tabListStyle,
|
|
33
36
|
tabButtonStyle = _ref.tabButtonStyle,
|
|
34
37
|
tabButtonActiveStyle = _ref.tabButtonActiveStyle,
|
|
35
38
|
tabButtonInactiveStyle = _ref.tabButtonInactiveStyle,
|
|
39
|
+
tabButtonTextStyle = _ref.tabButtonTextStyle,
|
|
40
|
+
tabButtonTextActiveStyle = _ref.tabButtonTextActiveStyle,
|
|
41
|
+
tabButtonTextInactiveStyle = _ref.tabButtonTextInactiveStyle,
|
|
42
|
+
tabIndicatorStyle = _ref.tabIndicatorStyle,
|
|
36
43
|
tabPanelStyle = _ref.tabPanelStyle;
|
|
37
44
|
// Build a stable list of enabled tabs in order
|
|
38
45
|
var availableTabs = (0, _react.useMemo)(function () {
|
|
39
46
|
var tabs = [];
|
|
40
|
-
if (options !== null && options !== void 0 && options.includes(
|
|
41
|
-
if (options !== null && options !== void 0 && options.includes(
|
|
42
|
-
if (options !== null && options !== void 0 && options.includes(
|
|
47
|
+
if (options !== null && options !== void 0 && options.includes("image")) tabs.push("image");
|
|
48
|
+
if (options !== null && options !== void 0 && options.includes("video")) tabs.push("video");
|
|
49
|
+
if (options !== null && options !== void 0 && options.includes("file")) tabs.push("file");
|
|
43
50
|
return tabs;
|
|
44
51
|
}, [options]);
|
|
45
52
|
var _useState = (0, _react.useState)(0),
|
|
@@ -52,13 +59,13 @@ var MediaTab = function MediaTab(_ref) {
|
|
|
52
59
|
return null;
|
|
53
60
|
}
|
|
54
61
|
var renderTabLabel = function renderTabLabel(type) {
|
|
55
|
-
if (type ===
|
|
56
|
-
if (type ===
|
|
57
|
-
if (type ===
|
|
62
|
+
if (type === "image") return "Images";
|
|
63
|
+
if (type === "video") return "Videos";
|
|
64
|
+
if (type === "file") return "Files";
|
|
58
65
|
return type;
|
|
59
66
|
};
|
|
60
67
|
var renderPanel = function renderPanel(type) {
|
|
61
|
-
if (type ===
|
|
68
|
+
if (type === "image") {
|
|
62
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaGallery.default, {
|
|
63
70
|
imagePopup: imagePopup,
|
|
64
71
|
update_data: update_data,
|
|
@@ -67,10 +74,11 @@ var MediaTab = function MediaTab(_ref) {
|
|
|
67
74
|
apiService: apiService,
|
|
68
75
|
onError: onError,
|
|
69
76
|
picker: picker,
|
|
70
|
-
pickerOptions: pickerOptions
|
|
77
|
+
pickerOptions: pickerOptions,
|
|
78
|
+
theme: theme
|
|
71
79
|
});
|
|
72
80
|
}
|
|
73
|
-
if (type ===
|
|
81
|
+
if (type === "video") {
|
|
74
82
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideosGallery.default, {
|
|
75
83
|
imagePopup: imagePopup,
|
|
76
84
|
update_data: update_data,
|
|
@@ -79,10 +87,11 @@ var MediaTab = function MediaTab(_ref) {
|
|
|
79
87
|
apiService: apiService,
|
|
80
88
|
onError: onError,
|
|
81
89
|
picker: picker,
|
|
82
|
-
pickerOptions: pickerOptions
|
|
90
|
+
pickerOptions: pickerOptions,
|
|
91
|
+
theme: theme
|
|
83
92
|
});
|
|
84
93
|
}
|
|
85
|
-
if (type ===
|
|
94
|
+
if (type === "file") {
|
|
86
95
|
// Reuse ImagesGallery for files as in original implementation
|
|
87
96
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaGallery.default, {
|
|
88
97
|
imagePopup: imagePopup,
|
|
@@ -92,7 +101,8 @@ var MediaTab = function MediaTab(_ref) {
|
|
|
92
101
|
apiService: apiService,
|
|
93
102
|
onError: onError,
|
|
94
103
|
picker: picker,
|
|
95
|
-
pickerOptions: pickerOptions
|
|
104
|
+
pickerOptions: pickerOptions,
|
|
105
|
+
theme: theme
|
|
96
106
|
});
|
|
97
107
|
}
|
|
98
108
|
return null;
|
|
@@ -100,19 +110,41 @@ var MediaTab = function MediaTab(_ref) {
|
|
|
100
110
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
101
111
|
style: [styles.container, containerStyle],
|
|
102
112
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
103
|
-
style: [styles.tabList,
|
|
113
|
+
style: [styles.tabList, {
|
|
114
|
+
backgroundColor: theme.colors.tabBackground,
|
|
115
|
+
borderBottomColor: theme.colors.border,
|
|
116
|
+
paddingHorizontal: theme.spacing.xs,
|
|
117
|
+
// Center align if only one tab
|
|
118
|
+
justifyContent: availableTabs.length === 1 ? "center" : "flex-start"
|
|
119
|
+
}, tabListStyle],
|
|
104
120
|
children: availableTabs.map(function (type, index) {
|
|
105
121
|
var isSelected = index === selectedIndex;
|
|
122
|
+
var isSingleTab = availableTabs.length === 1;
|
|
106
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
107
124
|
onPress: function onPress() {
|
|
108
125
|
return setSelectedIndex(index);
|
|
109
126
|
},
|
|
110
|
-
style: [styles.tabButton,
|
|
127
|
+
style: [styles.tabButton, {
|
|
128
|
+
paddingVertical: theme.spacing.md,
|
|
129
|
+
paddingHorizontal: theme.spacing.lg,
|
|
130
|
+
// If single tab, don't use flex: 1, use auto width
|
|
131
|
+
flex: isSingleTab ? 0 : 1,
|
|
132
|
+
alignSelf: isSingleTab ? "center" : "stretch"
|
|
133
|
+
}, tabButtonStyle, isSelected ? [styles.tabButtonActive, tabButtonActiveStyle] : [styles.tabButtonInactive, tabButtonInactiveStyle]],
|
|
111
134
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
112
|
-
style: [styles.tabButtonText,
|
|
135
|
+
style: [styles.tabButtonText, {
|
|
136
|
+
fontSize: theme.typography.body.fontSize,
|
|
137
|
+
fontWeight: theme.typography.body.fontWeight
|
|
138
|
+
}, isSelected ? [styles.tabButtonTextActive, {
|
|
139
|
+
color: theme.colors.tabActive
|
|
140
|
+
}, tabButtonTextActiveStyle] : [styles.tabButtonTextInactive, {
|
|
141
|
+
color: theme.colors.tabInactive
|
|
142
|
+
}, tabButtonTextInactiveStyle], tabButtonTextStyle],
|
|
113
143
|
children: renderTabLabel(type)
|
|
114
144
|
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
115
|
-
style: styles.tabIndicator
|
|
145
|
+
style: [styles.tabIndicator, {
|
|
146
|
+
backgroundColor: theme.colors.tabIndicator
|
|
147
|
+
}, tabIndicatorStyle]
|
|
116
148
|
})]
|
|
117
149
|
}, type);
|
|
118
150
|
})
|
|
@@ -133,43 +165,36 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
133
165
|
flex: 1
|
|
134
166
|
},
|
|
135
167
|
tabList: {
|
|
136
|
-
flexDirection:
|
|
137
|
-
borderBottomWidth: 2
|
|
138
|
-
borderBottomColor: '#E5E5E5',
|
|
139
|
-
backgroundColor: '#FFFFFF',
|
|
140
|
-
paddingHorizontal: 4
|
|
168
|
+
flexDirection: "row",
|
|
169
|
+
borderBottomWidth: 2
|
|
141
170
|
},
|
|
142
171
|
tabButton: {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
justifyContent: 'center',
|
|
148
|
-
position: 'relative'
|
|
172
|
+
alignItems: "center",
|
|
173
|
+
justifyContent: "center",
|
|
174
|
+
position: "relative",
|
|
175
|
+
minWidth: 80 // Minimum width for single tab
|
|
149
176
|
},
|
|
150
177
|
tabButtonActive: {
|
|
151
|
-
// Active state styling
|
|
178
|
+
// Active state styling applied via theme
|
|
152
179
|
},
|
|
153
180
|
tabButtonInactive: {
|
|
154
|
-
// Inactive state styling
|
|
181
|
+
// Inactive state styling applied via theme
|
|
155
182
|
},
|
|
156
183
|
tabButtonText: {
|
|
157
|
-
|
|
158
|
-
fontWeight: '500'
|
|
184
|
+
// Base text styling applied via theme
|
|
159
185
|
},
|
|
160
186
|
tabButtonTextActive: {
|
|
161
|
-
color
|
|
187
|
+
// Active text color applied via theme
|
|
162
188
|
},
|
|
163
189
|
tabButtonTextInactive: {
|
|
164
|
-
color
|
|
190
|
+
// Inactive text color applied via theme
|
|
165
191
|
},
|
|
166
192
|
tabIndicator: {
|
|
167
|
-
position:
|
|
193
|
+
position: "absolute",
|
|
168
194
|
bottom: -2,
|
|
169
195
|
left: 0,
|
|
170
196
|
right: 0,
|
|
171
|
-
height: 2
|
|
172
|
-
backgroundColor: '#3B3269' // primary color
|
|
197
|
+
height: 2
|
|
173
198
|
},
|
|
174
199
|
tabPanel: {
|
|
175
200
|
flex: 1
|
|
@@ -178,7 +203,7 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
178
203
|
flex: 1
|
|
179
204
|
},
|
|
180
205
|
panelHidden: {
|
|
181
|
-
display:
|
|
206
|
+
display: "none"
|
|
182
207
|
}
|
|
183
208
|
});
|
|
184
209
|
var _default = exports.default = MediaTab;
|
|
@@ -6,19 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _theme = require("./theme");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
var Pagination = function Pagination(_ref) {
|
|
12
13
|
var nextPage = _ref.nextPage,
|
|
13
14
|
current_page = _ref.current_page,
|
|
14
15
|
pageCount = _ref.pageCount,
|
|
16
|
+
_ref$theme = _ref.theme,
|
|
17
|
+
theme = _ref$theme === void 0 ? _theme.defaultTheme : _ref$theme,
|
|
15
18
|
containerStyle = _ref.containerStyle,
|
|
16
19
|
navStyle = _ref.navStyle,
|
|
17
20
|
previousButtonStyle = _ref.previousButtonStyle,
|
|
18
21
|
nextButtonStyle = _ref.nextButtonStyle,
|
|
19
22
|
pageButtonStyle = _ref.pageButtonStyle,
|
|
20
23
|
pageButtonActiveStyle = _ref.pageButtonActiveStyle,
|
|
21
|
-
ellipsisStyle = _ref.ellipsisStyle
|
|
24
|
+
ellipsisStyle = _ref.ellipsisStyle,
|
|
25
|
+
pageButtonTextStyle = _ref.pageButtonTextStyle,
|
|
26
|
+
pageButtonTextActiveStyle = _ref.pageButtonTextActiveStyle;
|
|
22
27
|
var totalPages = Math.ceil(pageCount) || 1;
|
|
23
28
|
var currentPage = current_page || 1;
|
|
24
29
|
|
|
@@ -78,17 +83,27 @@ var Pagination = function Pagination(_ref) {
|
|
|
78
83
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
79
84
|
onPress: handlePrevious,
|
|
80
85
|
disabled: currentPage === 1,
|
|
81
|
-
style: [styles.button, styles.previousButton,
|
|
86
|
+
style: [styles.button, styles.previousButton, {
|
|
87
|
+
backgroundColor: theme.colors.paginationButton,
|
|
88
|
+
borderColor: theme.colors.paginationBorder
|
|
89
|
+
}, previousButtonStyle, currentPage === 1 && styles.buttonDisabled],
|
|
82
90
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
83
|
-
style: styles.buttonText,
|
|
91
|
+
style: [styles.buttonText, {
|
|
92
|
+
color: theme.colors.paginationText
|
|
93
|
+
}],
|
|
84
94
|
children: "\u2039"
|
|
85
95
|
})
|
|
86
96
|
}), pageNumbers.map(function (page, index) {
|
|
87
97
|
if (page === '...') {
|
|
88
98
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
89
|
-
style: [styles.ellipsis,
|
|
99
|
+
style: [styles.ellipsis, {
|
|
100
|
+
backgroundColor: theme.colors.paginationButton,
|
|
101
|
+
borderColor: theme.colors.paginationBorder
|
|
102
|
+
}, ellipsisStyle],
|
|
90
103
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
91
|
-
style: styles.ellipsisText,
|
|
104
|
+
style: [styles.ellipsisText, {
|
|
105
|
+
color: theme.colors.paginationText
|
|
106
|
+
}],
|
|
92
107
|
children: "..."
|
|
93
108
|
})
|
|
94
109
|
}, "ellipsis-".concat(index));
|
|
@@ -98,18 +113,29 @@ var Pagination = function Pagination(_ref) {
|
|
|
98
113
|
onPress: function onPress() {
|
|
99
114
|
return handlePageClick(page);
|
|
100
115
|
},
|
|
101
|
-
style: [styles.button, styles.pageButton,
|
|
116
|
+
style: [styles.button, styles.pageButton, {
|
|
117
|
+
backgroundColor: isActive ? theme.colors.paginationButtonActive : theme.colors.paginationButton,
|
|
118
|
+
borderColor: isActive ? theme.colors.paginationButtonActive : theme.colors.paginationBorder
|
|
119
|
+
}, pageButtonStyle, isActive && [styles.pageButtonActive, pageButtonActiveStyle]],
|
|
102
120
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
103
|
-
style: [styles.pageButtonText,
|
|
121
|
+
style: [styles.pageButtonText, {
|
|
122
|
+
color: isActive ? theme.colors.paginationTextActive : theme.colors.paginationText,
|
|
123
|
+
fontWeight: isActive ? '600' : '500'
|
|
124
|
+
}, isActive && pageButtonTextActiveStyle, pageButtonTextStyle],
|
|
104
125
|
children: page
|
|
105
126
|
})
|
|
106
127
|
}, page);
|
|
107
128
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
108
129
|
onPress: handleNext,
|
|
109
130
|
disabled: currentPage === totalPages,
|
|
110
|
-
style: [styles.button, styles.nextButton,
|
|
131
|
+
style: [styles.button, styles.nextButton, {
|
|
132
|
+
backgroundColor: theme.colors.paginationButton,
|
|
133
|
+
borderColor: theme.colors.paginationBorder
|
|
134
|
+
}, nextButtonStyle, currentPage === totalPages && styles.buttonDisabled],
|
|
111
135
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
112
|
-
style: styles.buttonText,
|
|
136
|
+
style: [styles.buttonText, {
|
|
137
|
+
color: theme.colors.paginationText
|
|
138
|
+
}],
|
|
113
139
|
children: "\u203A"
|
|
114
140
|
})
|
|
115
141
|
})]
|
|
@@ -133,9 +159,8 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
133
159
|
paddingHorizontal: 12,
|
|
134
160
|
justifyContent: 'center',
|
|
135
161
|
alignItems: 'center',
|
|
136
|
-
borderWidth: 1
|
|
137
|
-
|
|
138
|
-
backgroundColor: '#FFFFFF'
|
|
162
|
+
borderWidth: 1
|
|
163
|
+
// Colors applied via theme
|
|
139
164
|
},
|
|
140
165
|
previousButton: {
|
|
141
166
|
borderTopLeftRadius: 6,
|
|
@@ -160,17 +185,17 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
160
185
|
},
|
|
161
186
|
buttonText: {
|
|
162
187
|
fontSize: 18,
|
|
163
|
-
color: '#6B7280',
|
|
164
188
|
fontWeight: '500'
|
|
189
|
+
// Color applied via theme
|
|
165
190
|
},
|
|
166
191
|
pageButtonText: {
|
|
167
192
|
fontSize: 14,
|
|
168
|
-
color: '#6B7280',
|
|
169
193
|
fontWeight: '500'
|
|
194
|
+
// Color applied via theme
|
|
170
195
|
},
|
|
171
196
|
pageButtonTextActive: {
|
|
172
|
-
color: '#FFFFFF',
|
|
173
197
|
fontWeight: '600'
|
|
198
|
+
// Color applied via theme
|
|
174
199
|
},
|
|
175
200
|
ellipsis: {
|
|
176
201
|
minWidth: 40,
|
|
@@ -179,15 +204,14 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
179
204
|
justifyContent: 'center',
|
|
180
205
|
alignItems: 'center',
|
|
181
206
|
borderWidth: 1,
|
|
182
|
-
borderColor: '#D1D5DB',
|
|
183
207
|
borderLeftWidth: 0,
|
|
184
|
-
borderRightWidth: 0
|
|
185
|
-
|
|
208
|
+
borderRightWidth: 0
|
|
209
|
+
// Colors applied via theme
|
|
186
210
|
},
|
|
187
211
|
ellipsisText: {
|
|
188
212
|
fontSize: 14,
|
|
189
|
-
color: '#374151',
|
|
190
213
|
fontWeight: '500'
|
|
214
|
+
// Color applied via theme
|
|
191
215
|
}
|
|
192
216
|
});
|
|
193
217
|
var _default = exports.default = Pagination;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lightTheme = exports.fullyCustomTheme = exports.darkTheme = exports.customBrandTheme = void 0;
|
|
7
|
+
var _theme = require("./theme");
|
|
8
|
+
/**
|
|
9
|
+
* Theme Configuration Examples
|
|
10
|
+
*
|
|
11
|
+
* This file shows how to customize the Media Gallery theme for React Native
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Example 1: Light Mode (Default)
|
|
15
|
+
var lightTheme = exports.lightTheme = (0, _theme.createTheme)({
|
|
16
|
+
mode: 'light'
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// Example 2: Dark Mode
|
|
20
|
+
var darkTheme = exports.darkTheme = (0, _theme.createTheme)({
|
|
21
|
+
mode: 'dark'
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Example 3: Custom Brand Colors
|
|
25
|
+
var customBrandTheme = exports.customBrandTheme = (0, _theme.createTheme)({
|
|
26
|
+
mode: 'light',
|
|
27
|
+
colors: {
|
|
28
|
+
primary: '#FF6B6B',
|
|
29
|
+
// Custom red primary
|
|
30
|
+
tabActive: '#FF6B6B',
|
|
31
|
+
tabIndicator: '#FF6B6B',
|
|
32
|
+
uploadBorder: '#FF6B6B',
|
|
33
|
+
uploadIconBackground: '#FF6B6B',
|
|
34
|
+
paginationButtonActive: '#FF6B6B'
|
|
35
|
+
},
|
|
36
|
+
bottomSheetHeight: 0.85 // 85% of screen height
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Example 4: Full Customization
|
|
40
|
+
var fullyCustomTheme = exports.fullyCustomTheme = (0, _theme.createTheme)({
|
|
41
|
+
mode: 'dark',
|
|
42
|
+
colors: {
|
|
43
|
+
// Primary colors
|
|
44
|
+
primary: '#6366F1',
|
|
45
|
+
primaryLight: '#818CF8',
|
|
46
|
+
primaryDark: '#4F46E5',
|
|
47
|
+
// Backgrounds
|
|
48
|
+
background: '#0F172A',
|
|
49
|
+
backgroundSecondary: '#1E293B',
|
|
50
|
+
backgroundTertiary: '#334155',
|
|
51
|
+
// Text
|
|
52
|
+
text: '#F1F5F9',
|
|
53
|
+
textSecondary: '#CBD5E1',
|
|
54
|
+
textTertiary: '#94A3B8',
|
|
55
|
+
// Tabs
|
|
56
|
+
tabActive: '#6366F1',
|
|
57
|
+
tabInactive: '#94A3B8',
|
|
58
|
+
tabIndicator: '#6366F1',
|
|
59
|
+
tabBackground: '#0F172A',
|
|
60
|
+
// Borders
|
|
61
|
+
border: '#334155',
|
|
62
|
+
borderLight: '#1E293B',
|
|
63
|
+
borderDark: '#475569',
|
|
64
|
+
// Overlay
|
|
65
|
+
overlay: 'rgba(0, 0, 0, 0.8)',
|
|
66
|
+
// Pagination
|
|
67
|
+
paginationBackground: '#1E293B',
|
|
68
|
+
paginationButton: '#0F172A',
|
|
69
|
+
paginationButtonActive: '#6366F1',
|
|
70
|
+
paginationText: '#CBD5E1',
|
|
71
|
+
paginationTextActive: '#FFFFFF',
|
|
72
|
+
paginationBorder: '#334155',
|
|
73
|
+
// Upload
|
|
74
|
+
uploadBorder: '#6366F1',
|
|
75
|
+
uploadBackground: '#0F172A',
|
|
76
|
+
uploadIconBackground: '#6366F1',
|
|
77
|
+
uploadText: '#F1F5F9',
|
|
78
|
+
// Items
|
|
79
|
+
itemBackground: '#1E293B',
|
|
80
|
+
itemShadow: '#000000',
|
|
81
|
+
// Loading
|
|
82
|
+
loadingBackground: '#1E293B',
|
|
83
|
+
loadingText: '#94A3B8'
|
|
84
|
+
},
|
|
85
|
+
spacing: {
|
|
86
|
+
xs: 4,
|
|
87
|
+
sm: 8,
|
|
88
|
+
md: 12,
|
|
89
|
+
lg: 16,
|
|
90
|
+
xl: 20,
|
|
91
|
+
xxl: 24
|
|
92
|
+
},
|
|
93
|
+
radius: {
|
|
94
|
+
sm: 6,
|
|
95
|
+
md: 8,
|
|
96
|
+
lg: 12,
|
|
97
|
+
xl: 16,
|
|
98
|
+
xxl: 20
|
|
99
|
+
},
|
|
100
|
+
bottomSheetHeight: 0.92 // 92% of screen height
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Usage in your component:
|
|
104
|
+
/*
|
|
105
|
+
import { MediaPopup, MediaApiService } from '@tradly/asset'
|
|
106
|
+
import { darkTheme } from './theme'
|
|
107
|
+
|
|
108
|
+
<MediaPopup
|
|
109
|
+
isOpen={isOpen}
|
|
110
|
+
onClose={() => setIsOpen(false)}
|
|
111
|
+
onSelect={handleSelect}
|
|
112
|
+
apiService={apiService}
|
|
113
|
+
picker={picker}
|
|
114
|
+
theme={darkTheme} // Pass your custom theme
|
|
115
|
+
bottomSheetHeight={0.9} // Or override height directly
|
|
116
|
+
/>
|
|
117
|
+
*/
|
|
@@ -10,6 +10,7 @@ var _reactNative = require("react-native");
|
|
|
10
10
|
var _FileUpload = _interopRequireDefault(require("./FileUpload.native"));
|
|
11
11
|
var _ImagesSkeleton = _interopRequireDefault(require("./ImagesSkeleton.native"));
|
|
12
12
|
var _Pagination = _interopRequireDefault(require("./Pagination.native"));
|
|
13
|
+
var _theme = require("./theme");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
@@ -41,6 +42,8 @@ var VideosGallery = function VideosGallery(_ref) {
|
|
|
41
42
|
onError = _ref.onError,
|
|
42
43
|
picker = _ref.picker,
|
|
43
44
|
pickerOptions = _ref.pickerOptions,
|
|
45
|
+
_ref$theme = _ref.theme,
|
|
46
|
+
theme = _ref$theme === void 0 ? _theme.defaultTheme : _ref$theme,
|
|
44
47
|
containerStyle = _ref.containerStyle,
|
|
45
48
|
gridStyle = _ref.gridStyle,
|
|
46
49
|
videoItemStyle = _ref.videoItemStyle,
|
|
@@ -139,7 +142,8 @@ var VideosGallery = function VideosGallery(_ref) {
|
|
|
139
142
|
apiService: apiService,
|
|
140
143
|
onUploadError: onError,
|
|
141
144
|
picker: picker,
|
|
142
|
-
pickerOptions: pickerOptions
|
|
145
|
+
pickerOptions: pickerOptions,
|
|
146
|
+
theme: theme
|
|
143
147
|
})
|
|
144
148
|
});
|
|
145
149
|
}
|
|
@@ -180,13 +184,19 @@ var VideosGallery = function VideosGallery(_ref) {
|
|
|
180
184
|
contentContainerStyle: [styles.grid, gridStyle],
|
|
181
185
|
showsVerticalScrollIndicator: false,
|
|
182
186
|
ListFooterComponent: total_count > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
183
|
-
style: [styles.paginationContainer,
|
|
187
|
+
style: [styles.paginationContainer, {
|
|
188
|
+
backgroundColor: theme.colors.paginationBackground,
|
|
189
|
+
paddingVertical: theme.spacing.lg,
|
|
190
|
+
paddingHorizontal: theme.spacing.sm,
|
|
191
|
+
marginTop: theme.spacing.sm
|
|
192
|
+
}, paginationContainerStyle],
|
|
184
193
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pagination.default, {
|
|
185
194
|
nextPage: function nextPage(value) {
|
|
186
195
|
return loadMedia(value);
|
|
187
196
|
},
|
|
188
197
|
pageCount: Math.ceil(total_count / 30),
|
|
189
|
-
current_page: currentPage
|
|
198
|
+
current_page: currentPage,
|
|
199
|
+
theme: theme
|
|
190
200
|
})
|
|
191
201
|
}) : null
|
|
192
202
|
})
|
|
@@ -232,10 +242,7 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
232
242
|
height: '100%'
|
|
233
243
|
},
|
|
234
244
|
paginationContainer: {
|
|
235
|
-
|
|
236
|
-
paddingHorizontal: 8,
|
|
237
|
-
backgroundColor: '#F5F5F5',
|
|
238
|
-
marginTop: 8
|
|
245
|
+
// Styles applied via theme
|
|
239
246
|
}
|
|
240
247
|
});
|
|
241
248
|
var _default = exports.default = VideosGallery;
|