mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-04 21:48:56 +08:00
新增黑色皮肤“黑灯瞎火”
This commit is contained in:
parent
c9cab468e7
commit
946fe7d027
@ -3,6 +3,7 @@
|
|||||||
- 为搜索、歌单、排行榜的歌曲菜单添加分享“分享歌曲”按钮
|
- 为搜索、歌单、排行榜的歌曲菜单添加分享“分享歌曲”按钮
|
||||||
- 新增设置-基本设置-分享设置,它用于控制歌曲菜单的分享行为,默认使用系统分享
|
- 新增设置-基本设置-分享设置,它用于控制歌曲菜单的分享行为,默认使用系统分享
|
||||||
- 新增是否在通知栏显示歌曲图片设置,默认开启(原来的行为)
|
- 新增是否在通知栏显示歌曲图片设置,默认开启(原来的行为)
|
||||||
|
- 新增黑色皮肤“黑灯瞎火”
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ const Title = ({ musicInfo, isMove }) => {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
musicInfo
|
musicInfo
|
||||||
? <Text style={styles.title}>{t(isMove ? 'list_add_title_first_move' : 'list_add_title_first_add')} <Text style={{ color: theme.secondary }} >{musicInfo.name}</Text> {t('list_add_title_last')}</Text>
|
? <Text style={{ ...styles.title, color: theme.normal }}>{t(isMove ? 'list_add_title_first_move' : 'list_add_title_first_add')} <Text style={{ color: theme.secondary }} >{musicInfo.name}</Text> {t('list_add_title_last')}</Text>
|
||||||
: null
|
: null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ const Title = ({ list, isMove }) => {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
list.length
|
list.length
|
||||||
? <Text style={styles.title}>{t(isMove ? 'list_multi_add_title_first_move' : 'list_multi_add_title_first_add')} <Text style={{ color: theme.secondary }} >{list.length}</Text> {t('list_multi_add_title_last')}</Text>
|
? <Text style={{ ...styles.title, color: theme.normal }}>{t(isMove ? 'list_multi_add_title_first_move' : 'list_multi_add_title_first_add')} <Text style={{ color: theme.secondary }} >{list.length}</Text> {t('list_multi_add_title_last')}</Text>
|
||||||
: null
|
: null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ export default ({
|
|||||||
return (
|
return (
|
||||||
<Modal visible={visible} hideModal={hideDialog} keyHide={keyHide} bgHide={bgHide} bgColor="rgba(0,0,0,0.2)">
|
<Modal visible={visible} hideModal={hideDialog} keyHide={keyHide} bgHide={bgHide} bgColor="rgba(0,0,0,0.2)">
|
||||||
<View style={{ ...styles.centeredView, paddingBottom: keyboardShown ? keyboardHeight : 0 }}>
|
<View style={{ ...styles.centeredView, paddingBottom: keyboardShown ? keyboardHeight : 0 }}>
|
||||||
<View style={styles.modalView} onStartShouldSetResponder={() => true}>
|
<View style={{ ...styles.modalView, backgroundColor: theme.primary }} onStartShouldSetResponder={() => true}>
|
||||||
<View style={{ ...styles.header, backgroundColor: theme.secondary }}>
|
<View style={{ ...styles.header, backgroundColor: theme.secondary }}>
|
||||||
<Text style={{ ...styles.title, color: theme.primary }} numberOfLines={1}>{title}</Text>
|
<Text style={{ ...styles.title, color: theme.primary }} numberOfLines={1}>{title}</Text>
|
||||||
{closeBtnComponent}
|
{closeBtnComponent}
|
||||||
|
@ -92,7 +92,7 @@ const Menu = ({
|
|||||||
|
|
||||||
// console.log(menuStyle)
|
// console.log(menuStyle)
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.menu, ...menuStyle }} onStartShouldSetResponder={() => true}>
|
<View style={{ ...styles.menu, ...menuStyle, backgroundColor: theme.primary }} onStartShouldSetResponder={() => true}>
|
||||||
<Animated.ScrollView keyboardShouldPersistTaps={'always'}>
|
<Animated.ScrollView keyboardShouldPersistTaps={'always'}>
|
||||||
{
|
{
|
||||||
menus.map((menu, index) => (
|
menus.map((menu, index) => (
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import { StyleSheet, View, Text, TouchableOpacity, StatusBar } from 'react-native'
|
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'
|
||||||
|
|
||||||
import Modal from './Modal'
|
import Modal from './Modal'
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { useGetter } from '@/store'
|
import { useGetter } from '@/store'
|
||||||
import { useKeyboard } from '@/utils/hooks'
|
import { useKeyboard } from '@/utils/hooks'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
centeredView: {
|
centeredView: {
|
||||||
@ -114,7 +115,7 @@ export default ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal visible={visible} hideModal={hide} keyHide={keyHide} bgHide={bgHide} bgColor="rgba(0,0,0,0.2)">
|
<Modal visible={visible} hideModal={hide} keyHide={keyHide} bgHide={bgHide} bgColor="rgba(0,0,0,0.2)">
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={{ ...styles.centeredView, ...centeredViewStyle, paddingBottom: keyboardShown ? keyboardHeight : 0 }}>
|
<View style={{ ...styles.centeredView, ...centeredViewStyle, paddingBottom: keyboardShown ? keyboardHeight : 0 }}>
|
||||||
<View style={{ ...styles.modalView, ...modalViewStyle, backgroundColor: theme.primary }} onStartShouldSetResponder={() => true}>
|
<View style={{ ...styles.modalView, ...modalViewStyle, backgroundColor: theme.primary }} onStartShouldSetResponder={() => true}>
|
||||||
<View style={styles.header}>
|
<View style={styles.header}>
|
||||||
|
12
src/components/common/StatusBar.js
Normal file
12
src/components/common/StatusBar.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { StatusBar as RNStatusBar } from 'react-native'
|
||||||
|
import { useGetter } from '@/store'
|
||||||
|
|
||||||
|
const StatusBar = function() {
|
||||||
|
const statusBarStyle = useGetter('common', 'statusBarStyle')
|
||||||
|
return <RNStatusBar backgroundColor="rgba(0,0,0,0)" barStyle={statusBarStyle} translucent={true} />
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusBar.currentHeight = RNStatusBar.currentHeight ?? 0
|
||||||
|
|
||||||
|
export default StatusBar
|
@ -1,10 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { View, Text, StyleSheet, SafeAreaView, StatusBar } from 'react-native'
|
import { View, Text, StyleSheet, SafeAreaView } from 'react-native'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
const Header = state => {
|
const Header = state => {
|
||||||
return (
|
return (
|
||||||
<View style={style.header}>
|
<View style={style.header}>
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<SafeAreaView style={style.container}>
|
<SafeAreaView style={style.container}>
|
||||||
{state.menu.map((item, index) => <View style={style.btn} key={item.id}><Text style={style.btnText} onPress={() => this.handlePress(item, index)}>{item.name}</Text></View>)}
|
{state.menu.map((item, index) => <View style={style.btn} key={item.id}><Text style={style.btnText} onPress={() => this.handlePress(item, index)}>{item.name}</Text></View>)}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
@ -22,5 +22,3 @@ export const storageDataPrefix = {
|
|||||||
syncHostHistory: '@sync_host_history',
|
syncHostHistory: '@sync_host_history',
|
||||||
notificationTipEnable: '@notification_tip_enable',
|
notificationTipEnable: '@notification_tip_enable',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ITEM_HEIGHT = 60
|
|
||||||
|
@ -222,6 +222,7 @@
|
|||||||
"storage_permission_tip_disagree_ask_again": "This feature cannot be used because you have permanently denied LX access to the phone storage.\nIf you want to continue, you need to go to System Permission Management Set Luo Xue’s storage permission to allow.",
|
"storage_permission_tip_disagree_ask_again": "This feature cannot be used because you have permanently denied LX access to the phone storage.\nIf you want to continue, you need to go to System Permission Management Set Luo Xue’s storage permission to allow.",
|
||||||
"storage_permission_tip_request": "To use this function, you need to allow LX to access the phone storage. Do you agree and continue?",
|
"storage_permission_tip_request": "To use this function, you need to allow LX to access the phone storage. Do you agree and continue?",
|
||||||
"sync_status_disabled": "Not connected",
|
"sync_status_disabled": "Not connected",
|
||||||
|
"theme_black": "Black",
|
||||||
"theme_blue": "Blue",
|
"theme_blue": "Blue",
|
||||||
"theme_blue2": "Purple Blue",
|
"theme_blue2": "Purple Blue",
|
||||||
"theme_green": "Green",
|
"theme_green": "Green",
|
||||||
|
@ -224,6 +224,7 @@
|
|||||||
"storage_permission_tip_disagree_ask_again": "此功能无法使用,因为你已经永久拒绝洛雪访问手机存储😫。\n若想继续,你需要去👉系统权限管理👈将洛雪的存储权限设置为允许",
|
"storage_permission_tip_disagree_ask_again": "此功能无法使用,因为你已经永久拒绝洛雪访问手机存储😫。\n若想继续,你需要去👉系统权限管理👈将洛雪的存储权限设置为允许",
|
||||||
"storage_permission_tip_request": "使用此功能需要允许洛雪访问手机存储,是否同意并继续?",
|
"storage_permission_tip_request": "使用此功能需要允许洛雪访问手机存储,是否同意并继续?",
|
||||||
"sync_status_disabled": "未连接",
|
"sync_status_disabled": "未连接",
|
||||||
|
"theme_black": "黑灯瞎火",
|
||||||
"theme_blue": "蓝田生玉",
|
"theme_blue": "蓝田生玉",
|
||||||
"theme_blue2": "清热版蓝",
|
"theme_blue2": "清热版蓝",
|
||||||
"theme_green": "绿意盎然",
|
"theme_green": "绿意盎然",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useMemo, useState, useEffect } from 'react'
|
import React, { useMemo, useState, useEffect } from 'react'
|
||||||
import { StyleSheet, View, Text, ScrollView, TouchableOpacity } from 'react-native'
|
import { StyleSheet, View, Text, ScrollView } from 'react-native'
|
||||||
import { Navigation } from 'react-native-navigation'
|
import { Navigation } from 'react-native-navigation'
|
||||||
|
|
||||||
import Button from '@/components/common/Button'
|
import Button from '@/components/common/Button'
|
||||||
@ -70,7 +70,7 @@ const VersionModal = ({ componentId }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.centeredView }}>
|
<View style={{ ...styles.centeredView }}>
|
||||||
<View style={styles.modalView}>
|
<View style={{ ...styles.modalView, backgroundColor: theme.primary }}>
|
||||||
<View style={{ ...styles.header, backgroundColor: theme.secondary }}></View>
|
<View style={{ ...styles.header, backgroundColor: theme.secondary }}></View>
|
||||||
<View style={styles.main}>
|
<View style={styles.main}>
|
||||||
<Text style={{ ...styles.title, color: theme.normal }}>许可协议</Text>
|
<Text style={{ ...styles.title, color: theme.normal }}>许可协议</Text>
|
||||||
|
@ -169,7 +169,7 @@ const VersionModal = ({ componentId }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.centeredView }}>
|
<View style={{ ...styles.centeredView }}>
|
||||||
<View style={styles.modalView}>
|
<View style={{ ...styles.modalView, backgroundColor: theme.primary }}>
|
||||||
<View style={{ ...styles.header, backgroundColor: theme.secondary }}></View>
|
<View style={{ ...styles.header, backgroundColor: theme.secondary }}></View>
|
||||||
<View style={styles.main}>
|
<View style={styles.main}>
|
||||||
<Text style={{ ...styles.title, color: theme.normal }}>{title}</Text>
|
<Text style={{ ...styles.title, color: theme.normal }}>{title}</Text>
|
||||||
|
@ -9,6 +9,11 @@ import {
|
|||||||
// SETTING_SCREEN,
|
// SETTING_SCREEN,
|
||||||
} from './screenNames'
|
} from './screenNames'
|
||||||
|
|
||||||
|
import { getter, getStore } from '@/store'
|
||||||
|
|
||||||
|
const store = getStore()
|
||||||
|
const getTheme = () => getter('common', 'theme')(store.getState())
|
||||||
|
const getStatusBarStyle = () => getter('common', 'isDarkTheme')(store.getState()) ? 'light' : 'dark'
|
||||||
|
|
||||||
export function pushHomeScreen() {
|
export function pushHomeScreen() {
|
||||||
/*
|
/*
|
||||||
@ -44,6 +49,7 @@ export function pushHomeScreen() {
|
|||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const theme = getTheme()
|
||||||
return Navigation.setRoot({
|
return Navigation.setRoot({
|
||||||
root: {
|
root: {
|
||||||
stack: {
|
stack: {
|
||||||
@ -59,15 +65,15 @@ export function pushHomeScreen() {
|
|||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
style: 'dark',
|
style: getStatusBarStyle(),
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
},
|
},
|
||||||
navigationBar: {
|
navigationBar: {
|
||||||
// visible: false,
|
// visible: false,
|
||||||
backgroundColor: 'white',
|
backgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
componentBackgroundColor: '#fff',
|
componentBackgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -110,6 +116,9 @@ export function pushPlayDetailScreen(componentId, id) {
|
|||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
InteractionManager.runAfterInteractions(() => {
|
InteractionManager.runAfterInteractions(() => {
|
||||||
|
const theme = getTheme()
|
||||||
|
console.log(getStatusBarStyle((store.getState())))
|
||||||
|
|
||||||
Navigation.push(componentId, {
|
Navigation.push(componentId, {
|
||||||
component: {
|
component: {
|
||||||
name: PLAY_DETAIL_SCREEN,
|
name: PLAY_DETAIL_SCREEN,
|
||||||
@ -122,15 +131,15 @@ export function pushPlayDetailScreen(componentId, id) {
|
|||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
style: 'dark',
|
style: getStatusBarStyle(),
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
},
|
},
|
||||||
navigationBar: {
|
navigationBar: {
|
||||||
// visible: false,
|
// visible: false,
|
||||||
backgroundColor: 'white',
|
backgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
componentBackgroundColor: '#fff',
|
componentBackgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
animations: {
|
animations: {
|
||||||
push: {
|
push: {
|
||||||
@ -200,6 +209,7 @@ export function pushPlayDetailScreen(componentId, id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function pushSonglistDetailScreen(componentId, id) {
|
export function pushSonglistDetailScreen(componentId, id) {
|
||||||
|
const theme = getTheme()
|
||||||
InteractionManager.runAfterInteractions(() => {
|
InteractionManager.runAfterInteractions(() => {
|
||||||
Navigation.push(componentId, {
|
Navigation.push(componentId, {
|
||||||
component: {
|
component: {
|
||||||
@ -213,15 +223,15 @@ export function pushSonglistDetailScreen(componentId, id) {
|
|||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
style: 'dark',
|
style: getStatusBarStyle(),
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
},
|
},
|
||||||
navigationBar: {
|
navigationBar: {
|
||||||
// visible: false,
|
// visible: false,
|
||||||
backgroundColor: 'white',
|
backgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
componentBackgroundColor: '#fff',
|
componentBackgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
animations: {
|
animations: {
|
||||||
push: {
|
push: {
|
||||||
@ -332,6 +342,7 @@ export function pushCommentScreen(componentId) {
|
|||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
InteractionManager.runAfterInteractions(() => {
|
InteractionManager.runAfterInteractions(() => {
|
||||||
|
const theme = getTheme()
|
||||||
Navigation.push(componentId, {
|
Navigation.push(componentId, {
|
||||||
component: {
|
component: {
|
||||||
name: COMMENT_SCREEN,
|
name: COMMENT_SCREEN,
|
||||||
@ -344,15 +355,15 @@ export function pushCommentScreen(componentId) {
|
|||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
style: 'dark',
|
style: getStatusBarStyle(),
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
},
|
},
|
||||||
navigationBar: {
|
navigationBar: {
|
||||||
// visible: false,
|
// visible: false,
|
||||||
backgroundColor: 'white',
|
backgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
componentBackgroundColor: '#fff',
|
componentBackgroundColor: theme.primary,
|
||||||
},
|
},
|
||||||
animations: {
|
animations: {
|
||||||
push: {
|
push: {
|
||||||
@ -426,7 +437,7 @@ export function pushCommentScreen(componentId) {
|
|||||||
// statusBar: {
|
// statusBar: {
|
||||||
// drawBehind: true,
|
// drawBehind: true,
|
||||||
// visible: true,
|
// visible: true,
|
||||||
// style: 'dark',
|
// style: getStatusBarStyle(),
|
||||||
// backgroundColor: 'transparent',
|
// backgroundColor: 'transparent',
|
||||||
// },
|
// },
|
||||||
// animations: {
|
// animations: {
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import { Navigation } from 'react-native-navigation'
|
import { Navigation } from 'react-native-navigation'
|
||||||
import { VERSION_MODAL, PACT_MODAL } from './screenNames'
|
import { VERSION_MODAL, PACT_MODAL } from './screenNames'
|
||||||
|
|
||||||
|
import { getter, getStore } from '@/store'
|
||||||
|
|
||||||
|
const store = getStore()
|
||||||
|
const getStatusBarStyle = () => getter('common', 'isDarkTheme')(store.getState()) ? 'light' : getStatusBarStyle()
|
||||||
|
|
||||||
export const dismissOverlay = compId => Navigation.dismissOverlay(compId)
|
export const dismissOverlay = compId => Navigation.dismissOverlay(compId)
|
||||||
|
|
||||||
export const pop = compId => Navigation.pop(compId)
|
export const pop = compId => Navigation.pop(compId)
|
||||||
@ -21,7 +26,7 @@ export const showPactModal = () => {
|
|||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
style: 'dark',
|
style: getStatusBarStyle(),
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
animate: true,
|
animate: true,
|
||||||
},
|
},
|
||||||
@ -65,7 +70,7 @@ export const showVersionModal = () => {
|
|||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
style: 'dark',
|
style: getStatusBarStyle(),
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
animate: true,
|
animate: true,
|
||||||
},
|
},
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import React, { memo } from 'react'
|
import React, { memo } from 'react'
|
||||||
|
|
||||||
import { View, StyleSheet, StatusBar, TouchableOpacity, Text } from 'react-native'
|
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native'
|
||||||
|
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
import { pop } from '@/navigation'
|
import { pop } from '@/navigation'
|
||||||
import { useTranslation } from '@/plugins/i18n'
|
import { useTranslation } from '@/plugins/i18n'
|
||||||
// import { AppColors } from '@/theme'
|
// import { AppColors } from '@/theme'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
|
|
||||||
export default memo(({ musicInfo }) => {
|
export default memo(({ musicInfo }) => {
|
||||||
@ -20,7 +21,7 @@ export default memo(({ musicInfo }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.header, backgroundColor: theme.primary }} nativeID="header">
|
<View style={{ ...styles.header, backgroundColor: theme.primary }} nativeID="header">
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={{ ...styles.container }}>
|
<View style={{ ...styles.container }}>
|
||||||
<TouchableOpacity onPress={back} style={{ ...styles.button }}>
|
<TouchableOpacity onPress={back} style={{ ...styles.button }}>
|
||||||
<Icon name="chevron-left" style={{ color: theme.normal }} size={24} />
|
<Icon name="chevron-left" style={{ color: theme.normal }} size={24} />
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { memo } from 'react'
|
import React, { memo } from 'react'
|
||||||
import { View, Text, Image, StyleSheet, Platform, TouchableOpacity } from 'react-native'
|
import { View, Text, Image, StyleSheet, Platform, TouchableOpacity } from 'react-native'
|
||||||
import { AppColors } from '@/theme'
|
import { useGetter } from '@/store'
|
||||||
|
|
||||||
export default memo(({ data: { index, item }, width, onPress = () => {} }) => {
|
export default memo(({ data: { index, item }, width, onPress = () => {} }) => {
|
||||||
|
const theme = useGetter('common', 'theme')
|
||||||
const handlePress = () => {
|
const handlePress = () => {
|
||||||
onPress(item, index)
|
onPress(item, index)
|
||||||
}
|
}
|
||||||
@ -10,13 +11,13 @@ export default memo(({ data: { index, item }, width, onPress = () => {} }) => {
|
|||||||
item.source
|
item.source
|
||||||
? (
|
? (
|
||||||
<View style={{ ...styles.listItem, width: width - 20 }}>
|
<View style={{ ...styles.listItem, width: width - 20 }}>
|
||||||
<View style={{ ...styles.listItemImg, backgroundColor: AppColors.primary }}>
|
<View style={{ ...styles.listItemImg, backgroundColor: theme.primary }}>
|
||||||
<TouchableOpacity activeOpacity={0.5} onPress={handlePress}>
|
<TouchableOpacity activeOpacity={0.5} onPress={handlePress}>
|
||||||
<Image source={{ uri: item.img }} nativeID={`pic${item.id}`} style={{ width: width - 20, height: width - 20 }} borderRadius={4} />
|
<Image source={{ uri: item.img }} nativeID={`pic${item.id}`} style={{ width: width - 20, height: width - 20 }} borderRadius={4} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<TouchableOpacity activeOpacity={0.5} onPress={handlePress}>
|
<TouchableOpacity activeOpacity={0.5} onPress={handlePress}>
|
||||||
<Text style={{ ...styles.listItemTitle, color: AppColors.normal }} nativeID={`title${item.id}`} numberOfLines={ 2 }>{item.name}</Text>
|
<Text style={{ ...styles.listItemTitle, color: theme.normal }} nativeID={`title${item.id}`} numberOfLines={ 2 }>{item.name}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{/* <Text>{JSON.stringify(item)}</Text> */}
|
{/* <Text>{JSON.stringify(item)}</Text> */}
|
||||||
</View>
|
</View>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import { View, Text, StyleSheet, StatusBar, TouchableOpacity } from 'react-native'
|
import { View, StyleSheet, TouchableOpacity } from 'react-native'
|
||||||
// import Button from '@/components/common/Button'
|
// import Button from '@/components/common/Button'
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
// import { navigations } from '@/navigation'
|
// import { navigations } from '@/navigation'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
const useActive = index => {
|
const useActive = index => {
|
||||||
const activeIndex = useGetter('common', 'navActiveIndex')
|
const activeIndex = useGetter('common', 'navActiveIndex')
|
||||||
@ -34,7 +35,7 @@ const Header = ({ componentId }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.header, backgroundColor: theme.primary }}>
|
<View style={{ ...styles.header, backgroundColor: theme.primary }}>
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{/* <View style={styles.left}> */}
|
{/* <View style={styles.left}> */}
|
||||||
{menus.map((item, index) => <HeaderItem info={item} index={index} key={item.id} onPress={setNavActiveIndex} />)}
|
{menus.map((item, index) => <HeaderItem info={item} index={index} key={item.id} onPress={setNavActiveIndex} />)}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { View, ScrollView, Text, StyleSheet, Image, TouchableOpacity } from 'react-native'
|
import { View, ScrollView, Text, StyleSheet, Image, TouchableOpacity, useGetter } from 'react-native'
|
||||||
import Button from '@/components/common/Button'
|
import Button from '@/components/common/Button'
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { AppColors } from '@/theme'
|
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
asideWidth, targetMusic, toggleNextPlayMode,
|
asideWidth, targetMusic, toggleNextPlayMode,
|
||||||
togglePlay, playIcon, playModeIcon, actions,
|
togglePlay, playIcon, playModeIcon, actions,
|
||||||
menu, homeViewPageIndex, onLayout = () => {}, navPress = () => {},
|
menu, homeViewPageIndex, onLayout = () => {}, navPress = () => {},
|
||||||
}) => {
|
}) => {
|
||||||
|
const theme = useGetter('common', 'theme')
|
||||||
const navBtnWidth = asideWidth * 0.5 - 0.1
|
const navBtnWidth = asideWidth * 0.5 - 0.1
|
||||||
const imgWidth = asideWidth * 0.3
|
const imgWidth = asideWidth * 0.3
|
||||||
const paddingBottom = asideWidth * 0.05
|
const paddingBottom = asideWidth * 0.05
|
||||||
@ -20,13 +20,13 @@ export default ({
|
|||||||
const navIconSize = asideWidth * 0.15
|
const navIconSize = asideWidth * 0.15
|
||||||
const iconSize = asideWidth * 0.15
|
const iconSize = asideWidth * 0.15
|
||||||
|
|
||||||
return <View style={{ ...styles.header, backgroundColor: AppColors.primary }} onLayout={onLayout}>
|
return <View style={{ ...styles.header, backgroundColor: theme.primary }} onLayout={onLayout}>
|
||||||
<ScrollView style={{ ...styles.navBtnContainer }}>
|
<ScrollView style={{ ...styles.navBtnContainer }}>
|
||||||
<View style={{ width: '100%', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between' }}>
|
<View style={{ width: '100%', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between' }}>
|
||||||
{
|
{
|
||||||
menu.map((item, index) =>
|
menu.map((item, index) =>
|
||||||
<Button style={{ ...styles.btn, width: navBtnWidth, height: navBtnWidth }} key={index} onPress={() => navPress(item, index)}>
|
<Button style={{ ...styles.btn, width: navBtnWidth, height: navBtnWidth }} key={index} onPress={() => navPress(item, index)}>
|
||||||
<Icon name={item.icon} style={{ color: homeViewPageIndex == index ? AppColors.secondary : AppColors.normal10 }} size={navIconSize} />
|
<Icon name={item.icon} style={{ color: homeViewPageIndex == index ? theme.secondary : theme.normal10 }} size={navIconSize} />
|
||||||
</Button>)
|
</Button>)
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
@ -36,24 +36,24 @@ export default ({
|
|||||||
<View style={{ flexShrink: 0, width: '100%', flexDirection: 'row', flexWrap: 'wrap' }}>
|
<View style={{ flexShrink: 0, width: '100%', flexDirection: 'row', flexWrap: 'wrap' }}>
|
||||||
<TouchableOpacity activeOpacity={0.5} onPress={toggleNextPlayMode}>
|
<TouchableOpacity activeOpacity={0.5} onPress={toggleNextPlayMode}>
|
||||||
<Text style={{ ...styles.cotrolBtn, ...btnStyle }}>
|
<Text style={{ ...styles.cotrolBtn, ...btnStyle }}>
|
||||||
<Icon name={playModeIcon} style={{ color: AppColors.secondary10 }} size={iconSize} />
|
<Icon name={playModeIcon} style={{ color: theme.secondary10 }} size={iconSize} />
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexShrink: 0, width: '100%', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-evenly' }}>
|
<View style={{ flexShrink: 0, width: '100%', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-evenly' }}>
|
||||||
<TouchableOpacity activeOpacity={0.5} onPress={actions.playPrev}>
|
<TouchableOpacity activeOpacity={0.5} onPress={actions.playPrev}>
|
||||||
<Text style={{ ...styles.cotrolBtn, ...btnStyle, transform: [{ rotate: '180deg' }] }}>
|
<Text style={{ ...styles.cotrolBtn, ...btnStyle, transform: [{ rotate: '180deg' }] }}>
|
||||||
<Icon name='nextMusic' style={{ color: AppColors.secondary10 }} size={iconSize} />
|
<Icon name='nextMusic' style={{ color: theme.secondary10 }} size={iconSize} />
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity activeOpacity={0.5} onPress={togglePlay}>
|
<TouchableOpacity activeOpacity={0.5} onPress={togglePlay}>
|
||||||
<Text style={{ ...styles.cotrolBtn, ...btnStyle }}>
|
<Text style={{ ...styles.cotrolBtn, ...btnStyle }}>
|
||||||
<Icon name={playIcon} style={{ color: AppColors.secondary10 }} size={iconSize} />
|
<Icon name={playIcon} style={{ color: theme.secondary10 }} size={iconSize} />
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity activeOpacity={0.5} onPress={actions.playNext}>
|
<TouchableOpacity activeOpacity={0.5} onPress={actions.playNext}>
|
||||||
<Text style={{ ...styles.cotrolBtn, ...btnStyle }}>
|
<Text style={{ ...styles.cotrolBtn, ...btnStyle }}>
|
||||||
<Icon name='nextMusic' style={{ color: AppColors.secondary10 }} size={iconSize} />
|
<Icon name='nextMusic' style={{ color: theme.secondary10 }} size={iconSize} />
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
@ -61,7 +61,7 @@ export default ({
|
|||||||
<View style={{ borderRadius: 4, marginTop: paddingBottom / 2 }} elevation={1}>
|
<View style={{ borderRadius: 4, marginTop: paddingBottom / 2 }} elevation={1}>
|
||||||
<Image source={{ uri: targetMusic.img }} borderRadius={4} style={{
|
<Image source={{ uri: targetMusic.img }} borderRadius={4} style={{
|
||||||
...styles.playInfoImg,
|
...styles.playInfoImg,
|
||||||
backgroundColor: AppColors.primary,
|
backgroundColor: theme.primary,
|
||||||
width: imgWidth,
|
width: imgWidth,
|
||||||
height: imgWidth,
|
height: imgWidth,
|
||||||
}} />
|
}} />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
|
|
||||||
import { View, StatusBar, StyleSheet } from 'react-native'
|
import { View, StyleSheet } from 'react-native'
|
||||||
import Header from './components/Header'
|
import Header from './components/Header'
|
||||||
import HeaderLandscape from './components/HeaderLandscape'
|
import HeaderLandscape from './components/HeaderLandscape'
|
||||||
// import Aside from './components/Aside'
|
// import Aside from './components/Aside'
|
||||||
@ -8,6 +8,7 @@ import Main from './components/Main'
|
|||||||
import FooterPlayer from './components/FooterPlayer'
|
import FooterPlayer from './components/FooterPlayer'
|
||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
import { useDimensions } from '@/utils/hooks'
|
import { useDimensions } from '@/utils/hooks'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
@ -20,7 +21,7 @@ const styles = StyleSheet.create({
|
|||||||
const Landscape = (props) => {
|
const Landscape = (props) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={{ ...styles.container, backgroundColor: props.theme.primary }}>
|
<View style={{ ...styles.container, backgroundColor: props.theme.primary }}>
|
||||||
<HeaderLandscape componentId={props.componentId} />
|
<HeaderLandscape componentId={props.componentId} />
|
||||||
<View style={{ flex: 1, flexDirection: 'column', height: '100%', overflow: 'hidden' }}>
|
<View style={{ flex: 1, flexDirection: 'column', height: '100%', overflow: 'hidden' }}>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { memo, useEffect, useCallback, useMemo } from 'react'
|
import React, { memo, useEffect, useCallback, useMemo } from 'react'
|
||||||
import { View, Text, StyleSheet, StatusBar } from 'react-native'
|
import { View, Text, StyleSheet } from 'react-native'
|
||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
import { screenkeepAwake, screenUnkeepAwake } from '@/utils/utils'
|
import { screenkeepAwake, screenUnkeepAwake } from '@/utils/utils'
|
||||||
import { onNavigationComponentDidDisappearEvent } from '@/navigation'
|
import { onNavigationComponentDidDisappearEvent } from '@/navigation'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
import Header from './components/Header'
|
import Header from './components/Header'
|
||||||
import Pic from './Pic'
|
import Pic from './Pic'
|
||||||
@ -37,7 +38,7 @@ export default memo(({ componentId, animated }) => {
|
|||||||
const component = useMemo(() => {
|
const component = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={{ ...styles.container, backgroundColor: theme.primary }}>
|
<View style={{ ...styles.container, backgroundColor: theme.primary }}>
|
||||||
<View style={styles.left}>
|
<View style={styles.left}>
|
||||||
<Header />
|
<Header />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { memo, useState, useCallback } from 'react'
|
import React, { memo, useState, useCallback } from 'react'
|
||||||
|
|
||||||
import { View, StyleSheet, StatusBar, TouchableOpacity, Text } from 'react-native'
|
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native'
|
||||||
|
|
||||||
import { Icon } from '@/components/common/Icon'
|
import { Icon } from '@/components/common/Icon'
|
||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
@ -9,6 +9,7 @@ import Popup from '@/components/common/Popup'
|
|||||||
import Slider from '@/components/common/Slider'
|
import Slider from '@/components/common/Slider'
|
||||||
import { useTranslation } from '@/plugins/i18n'
|
import { useTranslation } from '@/plugins/i18n'
|
||||||
// import { AppColors } from '@/theme'
|
// import { AppColors } from '@/theme'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
const LrcFontSizeStyles = StyleSheet.create({
|
const LrcFontSizeStyles = StyleSheet.create({
|
||||||
content: {
|
content: {
|
||||||
@ -85,7 +86,7 @@ export default memo(() => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.header, backgroundColor: theme.primary }} nativeID="header">
|
<View style={{ ...styles.header, backgroundColor: theme.primary }} nativeID="header">
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={{ ...styles.container }}>
|
<View style={{ ...styles.container }}>
|
||||||
<TouchableOpacity onPress={back} style={styles.button}>
|
<TouchableOpacity onPress={back} style={styles.button}>
|
||||||
<Icon name="chevron-left" style={{ color: theme.normal }} size={24} />
|
<Icon name="chevron-left" style={{ color: theme.normal }} size={24} />
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
import React, { memo, useMemo } from 'react'
|
import React, { memo } from 'react'
|
||||||
import { View, Text, StyleSheet, Image } from 'react-native'
|
import { View, Text, StyleSheet, Image } from 'react-native'
|
||||||
import { AppColors, BorderWidths } from '@/theme'
|
import { BorderWidths } from '@/theme'
|
||||||
import { useGetter } from '@/store'
|
import { useGetter } from '@/store'
|
||||||
import ButtonBar from './ActionBar'
|
import ButtonBar from './ActionBar'
|
||||||
|
|
||||||
const Header = memo(({ animatePlayed }) => {
|
const Header = memo(({ animatePlayed }) => {
|
||||||
|
const theme = useGetter('common', 'theme')
|
||||||
const selectListInfo = useGetter('songList', 'selectListInfo')
|
const selectListInfo = useGetter('songList', 'selectListInfo')
|
||||||
const { info: listDetailDataInfo = {} } = useGetter('songList', 'listDetailData')
|
const { info: listDetailDataInfo = {} } = useGetter('songList', 'listDetailData')
|
||||||
const playCount = selectListInfo.play_count || listDetailDataInfo.play_count
|
const playCount = selectListInfo.play_count || listDetailDataInfo.play_count
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ ...styles.container, borderBottomColor: AppColors.borderColor }}>
|
<View style={{ ...styles.container, borderBottomColor: theme.borderColor }}>
|
||||||
<View style={{ flexDirection: 'row', flexGrow: 0, flexShrink: 0, padding: 10 }}>
|
<View style={{ flexDirection: 'row', flexGrow: 0, flexShrink: 0, padding: 10 }}>
|
||||||
<View style={{ ...styles.listItemImg, backgroundColor: AppColors.primary }}>
|
<View style={{ ...styles.listItemImg, backgroundColor: theme.primary }}>
|
||||||
<Image nativeID={`pic${selectListInfo.id}Dest`} source={{ uri: selectListInfo.img || listDetailDataInfo.img || null }} borderRadius={4} style={{ flex: 1, resizeMode: 'cover', justifyContent: 'flex-end' }} />
|
<Image nativeID={`pic${selectListInfo.id}Dest`} source={{ uri: selectListInfo.img || listDetailDataInfo.img || null }} borderRadius={4} style={{ flex: 1, resizeMode: 'cover', justifyContent: 'flex-end' }} />
|
||||||
{
|
{
|
||||||
playCount && animatePlayed
|
playCount && animatePlayed
|
||||||
@ -21,9 +22,9 @@ const Header = memo(({ animatePlayed }) => {
|
|||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'column', flexGrow: 1, flexShrink: 1, paddingLeft: 5 }} nativeID="title">
|
<View style={{ flexDirection: 'column', flexGrow: 1, flexShrink: 1, paddingLeft: 5 }} nativeID="title">
|
||||||
<Text style={{ fontSize: 13, color: AppColors.normal }} numberOfLines={ 1 }>{selectListInfo.name || listDetailDataInfo.name}</Text>
|
<Text style={{ fontSize: 13, color: theme.normal }} numberOfLines={ 1 }>{selectListInfo.name || listDetailDataInfo.name}</Text>
|
||||||
<View style={{ flexGrow: 0, flexShrink: 1 }}>
|
<View style={{ flexGrow: 0, flexShrink: 1 }}>
|
||||||
<Text style={{ fontSize: 10, color: AppColors.normal40 }} numberOfLines={ 4 }>{selectListInfo.desc || listDetailDataInfo.desc}</Text>
|
<Text style={{ fontSize: 10, color: theme.normal40 }} numberOfLines={ 4 }>{selectListInfo.desc || listDetailDataInfo.desc}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react'
|
import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react'
|
||||||
import { View, StatusBar } from 'react-native'
|
import { View } from 'react-native'
|
||||||
import List from './List'
|
import List from './List'
|
||||||
import { useGetter, useDispatch } from '@/store'
|
import { useGetter, useDispatch } from '@/store'
|
||||||
import PlayerPortrait from './PlayerPortrait'
|
import PlayerPortrait from './PlayerPortrait'
|
||||||
import { useNavigationComponentDidAppear } from '@/navigation'
|
import { useNavigationComponentDidAppear } from '@/navigation'
|
||||||
|
import StatusBar from '@/components/common/StatusBar'
|
||||||
|
|
||||||
|
|
||||||
export default ({ componentId }) => {
|
export default ({ componentId }) => {
|
||||||
@ -27,7 +28,7 @@ export default ({ componentId }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, backgroundColor: theme.primary, paddingTop: StatusBar.currentHeight }}>
|
<View style={{ flex: 1, backgroundColor: theme.primary, paddingTop: StatusBar.currentHeight }}>
|
||||||
<StatusBar backgroundColor="rgba(0,0,0,0)" barStyle="dark-content" translucent={true} />
|
<StatusBar />
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<List animatePlayed={animatePlayed} />
|
<List animatePlayed={animatePlayed} />
|
||||||
</View>
|
</View>
|
||||||
|
@ -5,19 +5,26 @@ import * as modules from './modules'
|
|||||||
// console.log(modules)
|
// console.log(modules)
|
||||||
const defaultGetter = state => state
|
const defaultGetter = state => state
|
||||||
|
|
||||||
|
const getter = (moduleName, key) => {
|
||||||
|
const getters = modules[moduleName].getter
|
||||||
|
if (getters && getters[key]) return getters[key]
|
||||||
|
console.warn('getter not found:', moduleName, key)
|
||||||
|
return defaultGetter
|
||||||
|
}
|
||||||
|
|
||||||
const useGetter = (moduleName, key, props) => {
|
const useGetter = (moduleName, key, props) => {
|
||||||
const getter = useMemo(() => {
|
const memoGetter = useMemo(() => {
|
||||||
const getters = modules[moduleName].getter
|
return getter(moduleName, key)
|
||||||
if (getters && getters[key]) return getters[key]
|
|
||||||
console.warn('getter not found:', moduleName, key)
|
|
||||||
return defaultGetter
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
const selecteor = useCallback(state => getter(state, props), [props])
|
const selecteor = useCallback(state => memoGetter(state, props), [props])
|
||||||
|
|
||||||
// console.log(selector)
|
// console.log(selector)
|
||||||
// console.log(moduleName, key)
|
// console.log(moduleName, key)
|
||||||
return useSelector(selecteor)
|
return useSelector(selecteor)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useGetter
|
export {
|
||||||
|
getter,
|
||||||
|
useGetter,
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
export { Provider } from './Provider'
|
export { Provider } from './Provider'
|
||||||
export { reducers } from './reducer'
|
export { reducers } from './reducer'
|
||||||
export { default as useGetter } from './useGetter'
|
export * from './getter'
|
||||||
export { default as useDispatch } from './useDispatch'
|
export { default as useDispatch } from './useDispatch'
|
||||||
export { default as connect } from './connect'
|
export { default as connect } from './connect'
|
||||||
export { default as getStore } from './store'
|
export { default as getStore } from './store'
|
||||||
|
@ -23,12 +23,17 @@ export const isPlayHighQuality = state => state.common.setting.player.highQualit
|
|||||||
export const isHandleAudioFocus = state => state.common.setting.player.isHandleAudioFocus
|
export const isHandleAudioFocus = state => state.common.setting.player.isHandleAudioFocus
|
||||||
export const playerCacheSize = state => state.common.setting.player.cacheSize
|
export const playerCacheSize = state => state.common.setting.player.cacheSize
|
||||||
|
|
||||||
export const themes = state => state.common.themes
|
export const themeList = state => state.common.themes
|
||||||
export const activeThemeId = state => state.common.setting.themeId
|
export const activeThemeId = state => state.common.setting.themeId
|
||||||
export const theme = createSelector(
|
export const theme = createSelector(
|
||||||
[themes, activeThemeId],
|
[themeList, activeThemeId],
|
||||||
(themes, activeThemeId) => (themes[activeThemeId] || themes.green).colors)
|
(themeList, activeThemeId) => (themeList.find(theme => theme.id === activeThemeId) || themeList[0]).colors)
|
||||||
export const themeList = createSelector(themes, themes => Object.values(themes))
|
export const isDarkTheme = createSelector(
|
||||||
|
[themeList, activeThemeId],
|
||||||
|
(themeList, activeThemeId) => (themeList.find(theme => theme.id === activeThemeId) || themeList[0]).isDark)
|
||||||
|
export const statusBarStyle = createSelector(
|
||||||
|
isDarkTheme,
|
||||||
|
isDarkTheme => isDarkTheme ? 'light-content' : 'dark-content')
|
||||||
|
|
||||||
export const versionInfo = state => state.common.versionInfo
|
export const versionInfo = state => state.common.versionInfo
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { AppColors, MaterialColors } from './Colors'
|
import { AppColors, MaterialColors } from './Colors'
|
||||||
import * as Themes from './themes'
|
|
||||||
import {
|
import {
|
||||||
FontWeights,
|
FontWeights,
|
||||||
FontSizes,
|
FontSizes,
|
||||||
@ -7,6 +6,7 @@ import {
|
|||||||
BorderRadius,
|
BorderRadius,
|
||||||
} from './Typography'
|
} from './Typography'
|
||||||
|
|
||||||
|
export { default as Themes } from './themes'
|
||||||
export {
|
export {
|
||||||
AppColors,
|
AppColors,
|
||||||
MaterialColors,
|
MaterialColors,
|
||||||
@ -14,5 +14,4 @@ export {
|
|||||||
FontSizes,
|
FontSizes,
|
||||||
BorderWidths,
|
BorderWidths,
|
||||||
BorderRadius,
|
BorderRadius,
|
||||||
Themes,
|
|
||||||
}
|
}
|
||||||
|
40
src/theme/themes/black.js
Normal file
40
src/theme/themes/black.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
export default {
|
||||||
|
id: 'black',
|
||||||
|
isDark: true,
|
||||||
|
colors: {
|
||||||
|
primary: '#1f1f1f',
|
||||||
|
|
||||||
|
normal: '#bfbfbf',
|
||||||
|
normal10: '#b5b5b5',
|
||||||
|
normal20: '#ababab',
|
||||||
|
normal30: '#a1a1a1',
|
||||||
|
normal35: '#9c9c9c',
|
||||||
|
normal40: '#919191',
|
||||||
|
normal50: '#878787',
|
||||||
|
normal60: '#7d7d7d',
|
||||||
|
normal70: '#737373',
|
||||||
|
normal75: '#6e6e6e',
|
||||||
|
|
||||||
|
secondary_5: '#7a7a7a',
|
||||||
|
secondary: '#707070',
|
||||||
|
secondary10: '#5c5c5c',
|
||||||
|
secondary20: '#474747',
|
||||||
|
secondary30: '#333',
|
||||||
|
secondary40: '#2e2e2e',
|
||||||
|
secondary45: '#292929',
|
||||||
|
|
||||||
|
tertiary_5: '#9b7e83',
|
||||||
|
tertiary: '#a68c91',
|
||||||
|
tertiary10: '#b19b9f',
|
||||||
|
tertiary20: '#bca9ac',
|
||||||
|
tertiary30: '#c7b7ba',
|
||||||
|
tertiary40: '#d2c6c8',
|
||||||
|
tertiary45: '#ddd4d6',
|
||||||
|
|
||||||
|
borderColor: '#0f0f0f',
|
||||||
|
borderColor2: '#1b1b1b',
|
||||||
|
borderColor3: '#292929',
|
||||||
|
borderColor4: '#363636',
|
||||||
|
borderColor5: '#424242',
|
||||||
|
},
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
id: 'blue',
|
id: 'blue',
|
||||||
|
isDark: false,
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#fff',
|
primary: '#fff',
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
id: 'green',
|
id: 'green',
|
||||||
|
isDark: false,
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#fff',
|
primary: '#fff',
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
id: 'grey',
|
id: 'grey',
|
||||||
|
isDark: false,
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#fff',
|
primary: '#fff',
|
||||||
|
|
||||||
|
@ -1,6 +1,23 @@
|
|||||||
|
import green from './green'
|
||||||
|
import blue from './blue'
|
||||||
|
import orange from './orange'
|
||||||
|
import red from './red'
|
||||||
|
import grey from './grey'
|
||||||
|
import black from './black'
|
||||||
|
|
||||||
|
export default [
|
||||||
|
green,
|
||||||
|
blue,
|
||||||
|
orange,
|
||||||
|
red,
|
||||||
|
grey,
|
||||||
|
black,
|
||||||
|
]
|
||||||
|
|
||||||
export { default as green } from './green'
|
export { default as green } from './green'
|
||||||
export { default as blue } from './blue'
|
export { default as blue } from './blue'
|
||||||
export { default as orange } from './orange'
|
export { default as orange } from './orange'
|
||||||
export { default as red } from './red'
|
export { default as red } from './red'
|
||||||
export { default as pink } from './pink'
|
export { default as pink } from './pink'
|
||||||
export { default as grey } from './grey'
|
export { default as grey } from './grey'
|
||||||
|
export { default as black } from './black'
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
id: 'orange',
|
id: 'orange',
|
||||||
|
isDark: false,
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#fff',
|
primary: '#fff',
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
id: 'pink',
|
id: 'pink',
|
||||||
|
isDark: false,
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#fff',
|
primary: '#fff',
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
id: 'red',
|
id: 'red',
|
||||||
|
isDark: false,
|
||||||
colors: {
|
colors: {
|
||||||
primary: '#fff',
|
primary: '#fff',
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user