react-native-expo-video-player 0.1.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/LICENSE +21 -0
- package/README.md +229 -0
- package/lib/ExpoVideoPlayer.d.ts +16 -0
- package/lib/ExpoVideoPlayer.js +39 -0
- package/lib/PlayerIcon.d.ts +10 -0
- package/lib/PlayerIcon.js +30 -0
- package/lib/VideoControls.d.ts +3 -0
- package/lib/VideoControls.js +429 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +6 -0
- package/lib/types.d.ts +97 -0
- package/lib/types.js +1 -0
- package/lib/useFullscreen.d.ts +11 -0
- package/lib/useFullscreen.js +63 -0
- package/package.json +47 -0
- package/src/ExpoVideoPlayer.tsx +91 -0
- package/src/PlayerIcon.tsx +45 -0
- package/src/VideoControls.tsx +654 -0
- package/src/assets/slider-thumb.png +0 -0
- package/src/index.ts +23 -0
- package/src/types.ts +89 -0
- package/src/useFullscreen.ts +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 xiaocheng
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# react-native-expo-video-player
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/react-native-expo-video-player)
|
|
4
|
+
[](https://github.com/xiaocheng121380/react-native-expo-video-player/blob/main/LICENSE)
|
|
5
|
+
[](https://reactnative.dev/)
|
|
6
|
+
[](https://expo.dev/)
|
|
7
|
+
[](https://expo.dev/)
|
|
8
|
+
[](https://github.com/xiaocheng121380/react-native-expo-video-player/pulls)
|
|
9
|
+
[](https://github.com/xiaocheng121380/react-native-expo-video-player/stargazers)
|
|
10
|
+
|
|
11
|
+
基于 [`expo-video`](https://docs.expo.dev/versions/latest/sdk/video/) 构建的功能丰富的 React Native 视频播放器组件,开箱即用的自定义控制栏、全屏手势和倍速切换。
|
|
12
|
+
|
|
13
|
+
## 功能特性
|
|
14
|
+
|
|
15
|
+
- 🎬 自定义浮层控制栏(播放/暂停、进度条、倍速切换、全屏)
|
|
16
|
+
- 🖐️ 全屏手势:左侧上下滑 = 音量,右侧上下滑 = 亮度,水平滑 = 快进快退
|
|
17
|
+
- ⏩ 倍速选择器(0.5x – 2x)
|
|
18
|
+
- 🎞️ 画质选择器(通过不同 URL 切换画质,自动保持播放进度)
|
|
19
|
+
- 📱 控制栏自动隐藏,超时可配置
|
|
20
|
+
- 🔄 全屏管理 Hook(屏幕方向锁定 & 状态栏隐藏)
|
|
21
|
+
- 🎨 支持主题色自定义
|
|
22
|
+
- 🍎 iOS 滑块缩略图优化(内置 14px 小圆点图片)
|
|
23
|
+
- 🤖 Android 返回键自动退出全屏
|
|
24
|
+
- 🔀 完整透传 `VideoView` 原生属性(`contentFit`、`allowsPictureInPicture` 等)
|
|
25
|
+
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx expo install react-native-expo-video-player expo-video expo-brightness expo-screen-orientation react-native-safe-area-context @react-native-community/slider
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 快速开始
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { useVideoPlayer } from 'expo-video';
|
|
36
|
+
import { ExpoVideoPlayer, useFullscreen } from 'react-native-expo-video-player';
|
|
37
|
+
|
|
38
|
+
export default function Player() {
|
|
39
|
+
const player = useVideoPlayer(null);
|
|
40
|
+
const { isFullscreen, toggleFullscreen } = useFullscreen();
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
player.replaceAsync('https://example.com/video.mp4').then(() => player.play());
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<ExpoVideoPlayer
|
|
48
|
+
player={player}
|
|
49
|
+
isFullscreen={isFullscreen}
|
|
50
|
+
onToggleFullscreen={toggleFullscreen}
|
|
51
|
+
onBack={() => navigation.goBack()}
|
|
52
|
+
theme={{ primary: '#FF6B00' }}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 组件
|
|
59
|
+
|
|
60
|
+
### `<ExpoVideoPlayer>`
|
|
61
|
+
|
|
62
|
+
主组件,渲染 expo-video 的 `VideoView` 并叠加自定义控制栏。
|
|
63
|
+
|
|
64
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
65
|
+
|------|------|--------|------|
|
|
66
|
+
| `player` | `VideoPlayer` | **必填** | expo-video 播放器实例 |
|
|
67
|
+
| `theme` | `VideoPlayerTheme` | `{ primary: '#2979FF' }` | 主题色配置 |
|
|
68
|
+
| `isFullscreen` | `boolean` | `false` | 当前是否全屏 |
|
|
69
|
+
| `onToggleFullscreen` | `() => void` | `() => {}` | 全屏切换回调 |
|
|
70
|
+
| `onBack` | `() => void` | `() => {}` | 返回按钮回调 |
|
|
71
|
+
| `speedOptions` | `number[]` | `[0.5, 0.75, 1, 1.25, 1.5, 2]` | 可选倍速 |
|
|
72
|
+
| `speedLabel` | `string` | `'倍速'` | 1x 速度时显示的文字 |
|
|
73
|
+
| `autoHideTimeout` | `number` | `3000` | 控制栏自动隐藏时间(毫秒) |
|
|
74
|
+
| `enableGestures` | `boolean` | `true` | 是否启用全屏手势 |
|
|
75
|
+
| `showSpeedPicker` | `boolean` | `true` | 是否显示倍速按钮 |
|
|
76
|
+
| `showFullscreenButton` | `boolean` | `true` | 是否显示全屏按钮 |
|
|
77
|
+
| `showQualityPicker` | `boolean` | `false` | 是否显示画质选择按钮 |
|
|
78
|
+
| `qualityLabel` | `string` | `'画质'` | "自动"画质时按钮上显示的文字 |
|
|
79
|
+
| `qualityOptions` | `Array<{ label, url }>` | `[]` | 画质选项列表,如 `[{ label: '1080p', url: '...' }]` |
|
|
80
|
+
| `onQualityChange` | `(quality \| null) => void` | `() => {}` | 画质切换回调,`null` 表示选了"自动" |
|
|
81
|
+
| `thumbImage` | `ImageSource` | 内置 14px 圆点 | 自定义滑块拇指图片 |
|
|
82
|
+
| `width` | `number` | 窗口宽度 | 视频容器宽度 |
|
|
83
|
+
| `height` | `number` | width × 9/16 | 视频容器高度 |
|
|
84
|
+
| `...videoViewProps` | `VideoViewProps` | - | **所有原生 `VideoView` 属性均会透传** |
|
|
85
|
+
|
|
86
|
+
#### 透传的 VideoView 属性
|
|
87
|
+
|
|
88
|
+
所有 expo-video 的 `VideoView` 原生属性均会透传到底层组件,包括但不限于:
|
|
89
|
+
|
|
90
|
+
| 属性 | 说明 |
|
|
91
|
+
|------|------|
|
|
92
|
+
| `contentFit` | `'contain'` / `'cover'` / `'fill'` — 视频缩放模式 |
|
|
93
|
+
| `contentPosition` | `{ dx, dy }` — 视频位置偏移(iOS) |
|
|
94
|
+
| `allowsPictureInPicture` | 启用画中画模式 |
|
|
95
|
+
| `startsPictureInPictureAutomatically` | 后台自动进入画中画 |
|
|
96
|
+
| `allowsVideoFrameAnalysis` | 视频中的实况文本(iOS 16+) |
|
|
97
|
+
| `requiresLinearPlayback` | 禁止用户拖拽进度 |
|
|
98
|
+
| `showsTimecodes` | 显示/隐藏时间码(iOS) |
|
|
99
|
+
| `surfaceType` | `'surfaceView'` / `'textureView'`(Android) |
|
|
100
|
+
| `useExoShutter` | ExoPlayer 快门(Android) |
|
|
101
|
+
| `onFirstFrameRender` | 首帧渲染回调 |
|
|
102
|
+
| `onPictureInPictureStart` | 画中画开始回调 |
|
|
103
|
+
| `onPictureInPictureStop` | 画中画结束回调 |
|
|
104
|
+
|
|
105
|
+
### `<VideoControls>`
|
|
106
|
+
|
|
107
|
+
控制栏浮层组件,如果你想配合自己的 `VideoView` 单独使用。
|
|
108
|
+
|
|
109
|
+
### `<PlayerIcon>`
|
|
110
|
+
|
|
111
|
+
基于 Unicode 的轻量级图标组件,内部使用。可用图标:`play`、`pause`、`arrow-left`、`fullscreen`、`fullscreen-exit`、`fast-forward`、`rewind`、`volume-off`、`volume-medium`、`volume-high`、`brightness-6`。
|
|
112
|
+
|
|
113
|
+
## Hooks
|
|
114
|
+
|
|
115
|
+
### `useFullscreen(initialFullscreen?: boolean)`
|
|
116
|
+
|
|
117
|
+
管理全屏状态,包括屏幕方向锁定、状态栏显隐和 Android 返回键处理。
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
const { isFullscreen, enterFullscreen, exitFullscreen, toggleFullscreen } = useFullscreen();
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 全屏手势
|
|
124
|
+
|
|
125
|
+
全屏模式下且 `enableGestures` 开启时:
|
|
126
|
+
|
|
127
|
+
| 手势 | 操作 |
|
|
128
|
+
|------|------|
|
|
129
|
+
| 左侧上下滑动 | 调节音量 |
|
|
130
|
+
| 右侧上下滑动 | 调节亮度 |
|
|
131
|
+
| 水平滑动 | 快进/快退 |
|
|
132
|
+
| 单击 | 显示/隐藏控制栏 |
|
|
133
|
+
| 双击 | 播放/暂停 |
|
|
134
|
+
|
|
135
|
+
## 主题定制
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<ExpoVideoPlayer
|
|
139
|
+
player={player}
|
|
140
|
+
theme={{
|
|
141
|
+
primary: '#FF6B00', // 滑块颜色、选中状态
|
|
142
|
+
text: '#ffffff', // (预留)
|
|
143
|
+
textSecondary: '#aaa', // (预留)
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 画质切换
|
|
149
|
+
|
|
150
|
+
画质切换通过不同 URL 实现,适配国内大部分视频平台的分发方式:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
<ExpoVideoPlayer
|
|
154
|
+
player={player}
|
|
155
|
+
showQualityPicker
|
|
156
|
+
qualityOptions={[
|
|
157
|
+
{ label: '1080p', url: 'https://cdn.example.com/video_1080p.mp4' },
|
|
158
|
+
{ label: '720p', url: 'https://cdn.example.com/video_720p.mp4' },
|
|
159
|
+
{ label: '480p', url: 'https://cdn.example.com/video_480p.mp4' },
|
|
160
|
+
]}
|
|
161
|
+
onQualityChange={(quality) => {
|
|
162
|
+
console.log('切换画质:', quality?.label ?? '自动');
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
切换时会自动记住当前播放进度,通过 `replaceAsync` 加载新 URL 后恢复到之前的位置继续播放。选择"自动"时使用列表中第一个 URL。
|
|
168
|
+
|
|
169
|
+
## 从 expo-video 重新导出
|
|
170
|
+
|
|
171
|
+
为方便使用,以下常用符号从 `expo-video` 重新导出:
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
// 组件和 hooks
|
|
175
|
+
import { useVideoPlayer, VideoView, createVideoPlayer, isPictureInPictureSupported } from 'react-native-expo-video-player';
|
|
176
|
+
|
|
177
|
+
// 类型
|
|
178
|
+
import type { VideoSource, VideoPlayer, VideoPlayerStatus, VideoContentFit, DRMOptions, BufferOptions, VideoMetadata } from 'react-native-expo-video-player';
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Peer Dependencies
|
|
182
|
+
|
|
183
|
+
| 依赖 | 最低版本 |
|
|
184
|
+
|------|----------|
|
|
185
|
+
| `expo` | >= 51 |
|
|
186
|
+
| `expo-video` | >= 2 |
|
|
187
|
+
| `expo-brightness` | >= 12 |
|
|
188
|
+
| `expo-screen-orientation` | >= 7 |
|
|
189
|
+
| `react` | >= 18 |
|
|
190
|
+
| `react-native` | >= 0.75 |
|
|
191
|
+
| `react-native-safe-area-context` | >= 4 |
|
|
192
|
+
| `@react-native-community/slider` | >= 4 |
|
|
193
|
+
|
|
194
|
+
> 所有 expo 相关依赖均声明为 `peerDependencies`,不会与宿主项目的版本冲突。
|
|
195
|
+
|
|
196
|
+
## 兼容性
|
|
197
|
+
|
|
198
|
+
| 平台 | 支持情况 |
|
|
199
|
+
|------|----------|
|
|
200
|
+
| iOS | ✅ |
|
|
201
|
+
| Android | ✅ |
|
|
202
|
+
| Web | ❌(expo-video 暂不支持 Web) |
|
|
203
|
+
|
|
204
|
+
## 参与贡献
|
|
205
|
+
|
|
206
|
+
欢迎提交 Issue 和 Pull Request!
|
|
207
|
+
|
|
208
|
+
1. Fork 本仓库
|
|
209
|
+
2. 创建特性分支 (`git checkout -b feature/amazing-feature`)
|
|
210
|
+
3. 提交更改 (`git commit -m 'feat: 添加新功能'`)
|
|
211
|
+
4. 推送到分支 (`git push origin feature/amazing-feature`)
|
|
212
|
+
5. 提交 Pull Request
|
|
213
|
+
|
|
214
|
+
## 致谢
|
|
215
|
+
|
|
216
|
+
- [expo-video](https://docs.expo.dev/versions/latest/sdk/video/) — Expo 官方视频播放模块
|
|
217
|
+
- [expo-brightness](https://docs.expo.dev/versions/latest/sdk/brightness/) — 亮度调节
|
|
218
|
+
- [expo-screen-orientation](https://docs.expo.dev/versions/latest/sdk/screen-orientation/) — 屏幕方向控制
|
|
219
|
+
- [@react-native-community/slider](https://github.com/callstack/react-native-slider) — 进度条滑块组件
|
|
220
|
+
|
|
221
|
+
## 技术交流
|
|
222
|
+
|
|
223
|
+
[](https://qm.qq.com/q/1048378204)
|
|
224
|
+
|
|
225
|
+
欢迎加入 QQ 技术交流群:**1048378204**,一起讨论 React Native、Expo 和移动端开发。
|
|
226
|
+
|
|
227
|
+
## 开源协议
|
|
228
|
+
|
|
229
|
+
[MIT](./LICENSE) © [xiaocheng](https://github.com/xiaocheng121380)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExpoVideoPlayerProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 开箱即用的视频播放器组件,基于 `expo-video` 构建。
|
|
5
|
+
*
|
|
6
|
+
* 提供自定义浮层控制栏:播放/暂停、进度条、倍速切换、
|
|
7
|
+
* 全屏切换、全屏手势(音量/亮度/快进快退)。
|
|
8
|
+
*
|
|
9
|
+
* 所有原生 `VideoView` 属性(如 `contentFit`、`allowsPictureInPicture`、
|
|
10
|
+
* `surfaceType`、`onFirstFrameRender`、`onPictureInPictureStart` 等)
|
|
11
|
+
* 均会透传给底层 `VideoView` 组件。
|
|
12
|
+
*
|
|
13
|
+
* 可使用本包的 `useFullscreen()` hook 管理全屏状态,
|
|
14
|
+
* 也可自行提供 `isFullscreen` / `onToggleFullscreen`。
|
|
15
|
+
*/
|
|
16
|
+
export declare const ExpoVideoPlayer: React.FC<ExpoVideoPlayerProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View, StyleSheet, useWindowDimensions } from 'react-native';
|
|
3
|
+
import { VideoView } from 'expo-video';
|
|
4
|
+
import { VideoControls } from './VideoControls';
|
|
5
|
+
const DEFAULT_THEME = { primary: '#2979FF' };
|
|
6
|
+
const DEFAULT_SPEED_OPTIONS = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
7
|
+
/**
|
|
8
|
+
* 开箱即用的视频播放器组件,基于 `expo-video` 构建。
|
|
9
|
+
*
|
|
10
|
+
* 提供自定义浮层控制栏:播放/暂停、进度条、倍速切换、
|
|
11
|
+
* 全屏切换、全屏手势(音量/亮度/快进快退)。
|
|
12
|
+
*
|
|
13
|
+
* 所有原生 `VideoView` 属性(如 `contentFit`、`allowsPictureInPicture`、
|
|
14
|
+
* `surfaceType`、`onFirstFrameRender`、`onPictureInPictureStart` 等)
|
|
15
|
+
* 均会透传给底层 `VideoView` 组件。
|
|
16
|
+
*
|
|
17
|
+
* 可使用本包的 `useFullscreen()` hook 管理全屏状态,
|
|
18
|
+
* 也可自行提供 `isFullscreen` / `onToggleFullscreen`。
|
|
19
|
+
*/
|
|
20
|
+
export const ExpoVideoPlayer = ({ player, theme, isFullscreen = false, onToggleFullscreen = () => { }, onBack = () => { }, speedOptions = DEFAULT_SPEED_OPTIONS, speedLabel = '倍速', autoHideTimeout = 3000, enableGestures = true, showSpeedPicker = true, showFullscreenButton = true, showQualityPicker = false, qualityLabel = '画质', qualityOptions = [], onQualityChange = () => { }, thumbImage, width: propWidth, height: propHeight,
|
|
21
|
+
// --- 剩余属性全部透传给 VideoView ---
|
|
22
|
+
...videoViewProps }) => {
|
|
23
|
+
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
|
|
24
|
+
const resolvedTheme = { ...DEFAULT_THEME, ...theme };
|
|
25
|
+
const videoWidth = isFullscreen ? windowWidth : (propWidth ?? windowWidth);
|
|
26
|
+
const videoHeight = isFullscreen ? windowHeight : (propHeight ?? videoWidth * 9 / 16);
|
|
27
|
+
return (_jsxs(View, { style: isFullscreen ? styles.fullscreenContainer : { width: videoWidth, height: videoHeight }, children: [_jsx(VideoView, { player: player, style: styles.video, nativeControls: false, ...videoViewProps }), _jsx(VideoControls, { player: player, theme: resolvedTheme, isFullscreen: isFullscreen, onToggleFullscreen: onToggleFullscreen, onBack: onBack, speedOptions: speedOptions, speedLabel: speedLabel, autoHideTimeout: autoHideTimeout, enableGestures: enableGestures, showSpeedPicker: showSpeedPicker, showFullscreenButton: showFullscreenButton, showQualityPicker: showQualityPicker, qualityLabel: qualityLabel, qualityOptions: qualityOptions, onQualityChange: onQualityChange, thumbImage: thumbImage })] }));
|
|
28
|
+
};
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
fullscreenContainer: {
|
|
31
|
+
...StyleSheet.absoluteFillObject,
|
|
32
|
+
backgroundColor: '#000',
|
|
33
|
+
zIndex: 999,
|
|
34
|
+
},
|
|
35
|
+
video: {
|
|
36
|
+
width: '100%',
|
|
37
|
+
height: '100%',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, StyleSheet } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* 基于 Unicode 符号的轻量级图标组件,无需引入外部图标库。
|
|
5
|
+
* 如需替换图标,使用者可通过 render props 自行覆盖。
|
|
6
|
+
*/
|
|
7
|
+
const ICONS = {
|
|
8
|
+
play: '▶',
|
|
9
|
+
pause: '❚❚',
|
|
10
|
+
'arrow-left': '←',
|
|
11
|
+
fullscreen: '⛶',
|
|
12
|
+
'fullscreen-exit': '⛶',
|
|
13
|
+
'fast-forward': '⏩',
|
|
14
|
+
rewind: '⏪',
|
|
15
|
+
'volume-off': '🔇',
|
|
16
|
+
'volume-medium': '🔉',
|
|
17
|
+
'volume-high': '🔊',
|
|
18
|
+
'brightness-4': '☀',
|
|
19
|
+
'brightness-6': '☀',
|
|
20
|
+
'brightness-7': '☀',
|
|
21
|
+
};
|
|
22
|
+
export const PlayerIcon = ({ name, size = 22, color = '#fff', style }) => {
|
|
23
|
+
const icon = ICONS[name] || '?';
|
|
24
|
+
return (_jsx(Text, { style: [styles.icon, { fontSize: size * 0.75, color, lineHeight: size }, style], children: icon }));
|
|
25
|
+
};
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
icon: {
|
|
28
|
+
textAlign: 'center',
|
|
29
|
+
},
|
|
30
|
+
});
|