@@ -17,12 +17,14 @@ import { LivePlayer } from "../../components/LivePlayer";
1717import DanmakuList from "../../components/DanmakuList" ;
1818import { formatCount } from "../../utils/format" ;
1919import { proxyImageUrl } from "../../utils/imageUrl" ;
20+ import { useTheme } from "../../utils/theme" ;
2021
2122type Tab = "intro" | "danmaku" ;
2223
2324export default function LiveDetailScreen ( ) {
2425 const { roomId } = useLocalSearchParams < { roomId : string } > ( ) ;
2526 const router = useRouter ( ) ;
27+ const theme = useTheme ( ) ;
2628 const id = parseInt ( roomId ?? "0" , 10 ) ;
2729 const { room, anchor, stream, loading, error, changeQuality } =
2830 useLiveDetail ( id ) ;
@@ -34,17 +36,17 @@ export default function LiveDetailScreen() {
3436 const qualities = stream ?. qualities ?? [ ] ;
3537 const currentQn = stream ?. qn ?? 0 ;
3638
37- // Use actual roomid from room detail (not the short/alias ID from the URL)
3839 const actualRoomId = room ?. roomid ?? id ;
3940 const { danmakus, giftCounts } = useLiveDanmaku ( isLive ? actualRoomId : 0 ) ;
41+
4042 return (
41- < SafeAreaView style = { styles . safe } >
43+ < SafeAreaView style = { [ styles . safe , { backgroundColor : theme . card } ] } >
4244 { /* TopBar */ }
43- < View style = { styles . topBar } >
45+ < View style = { [ styles . topBar , { borderBottomColor : theme . border } ] } >
4446 < TouchableOpacity onPress = { ( ) => router . back ( ) } style = { styles . backBtn } >
45- < Ionicons name = "chevron-back" size = { 24 } color = "#212121" />
47+ < Ionicons name = "chevron-back" size = { 24 } color = { theme . text } />
4648 </ TouchableOpacity >
47- < Text style = { styles . topTitle } numberOfLines = { 1 } >
49+ < Text style = { [ styles . topTitle , { color : theme . text } ] } numberOfLines = { 1 } >
4850 { room ?. title ?? "直播间" }
4951 </ Text >
5052 </ View >
@@ -60,12 +62,12 @@ export default function LiveDetailScreen() {
6062 />
6163
6264 { /* TabBar */ }
63- < View style = { styles . tabBar } >
65+ < View style = { [ styles . tabBar , { backgroundColor : theme . card , borderBottomColor : theme . border } ] } >
6466 < TouchableOpacity
6567 style = { styles . tabItem }
6668 onPress = { ( ) => setTab ( "intro" ) }
6769 >
68- < Text style = { [ styles . tabLabel , tab === "intro" && styles . tabActive ] } >
70+ < Text style = { [ styles . tabLabel , { color : theme . textSub } , tab === "intro" && styles . tabActive ] } >
6971 简介
7072 </ Text >
7173 { tab === "intro" && < View style = { styles . tabUnderline } /> }
@@ -75,15 +77,15 @@ export default function LiveDetailScreen() {
7577 onPress = { ( ) => setTab ( "danmaku" ) }
7678 >
7779 < Text
78- style = { [ styles . tabLabel , tab === "danmaku" && styles . tabActive ] }
80+ style = { [ styles . tabLabel , { color : theme . textSub } , tab === "danmaku" && styles . tabActive ] }
7981 >
8082 弹幕{ danmakus . length > 0 ? ` ${ danmakus . length } ` : "" }
8183 </ Text >
8284 { tab === "danmaku" && < View style = { styles . tabUnderline } /> }
8385 </ TouchableOpacity >
8486 </ View >
8587
86- { /* Content — 两个面板始终挂载,通过 display 切换,保留弹幕列表状态 */ }
88+ { /* Content */ }
8789 { loading ? (
8890 < ActivityIndicator style = { styles . loader } color = "#00AEEC" />
8991 ) : error ? (
@@ -95,7 +97,7 @@ export default function LiveDetailScreen() {
9597 showsVerticalScrollIndicator = { false }
9698 >
9799 < View style = { styles . titleSection } >
98- < Text style = { styles . title } > { room ?. title } </ Text >
100+ < Text style = { [ styles . title , { color : theme . text } ] } > { room ?. title } </ Text >
99101 < View style = { styles . metaRow } >
100102 { isLive ? (
101103 < View style = { styles . livePill } >
@@ -126,15 +128,15 @@ export default function LiveDetailScreen() {
126128 </ View >
127129 </ View >
128130
129- < View style = { styles . divider } />
131+ < View style = { [ styles . divider , { backgroundColor : theme . border } ] } />
130132
131133 { anchor && (
132134 < View style = { styles . anchorRow } >
133135 < Image
134136 source = { { uri : proxyImageUrl ( anchor . face ) } }
135137 style = { styles . avatar }
136138 />
137- < Text style = { styles . anchorName } > { anchor . uname } </ Text >
139+ < Text style = { [ styles . anchorName , { color : theme . text } ] } > { anchor . uname } </ Text >
138140 < TouchableOpacity style = { styles . followBtn } >
139141 < Text style = { styles . followTxt } > + 关注</ Text >
140142 </ TouchableOpacity >
@@ -143,7 +145,7 @@ export default function LiveDetailScreen() {
143145
144146 { ! ! room ?. description && (
145147 < View style = { styles . descBox } >
146- < Text style = { styles . descText } > { room . description } </ Text >
148+ < Text style = { [ styles . descText , { color : theme . text } ] } > { room . description } </ Text >
147149 </ View >
148150 ) }
149151 </ ScrollView >
@@ -166,38 +168,34 @@ export default function LiveDetailScreen() {
166168}
167169
168170const styles = StyleSheet . create ( {
169- safe : { flex : 1 , backgroundColor : "#fff" } ,
171+ safe : { flex : 1 } ,
170172 topBar : {
171173 flexDirection : "row" ,
172174 alignItems : "center" ,
173175 paddingHorizontal : 8 ,
174176 paddingVertical : 8 ,
175177 borderBottomWidth : StyleSheet . hairlineWidth ,
176- borderBottomColor : "#eee" ,
177178 } ,
178179 backBtn : { padding : 4 } ,
179180 topTitle : {
180181 flex : 1 ,
181182 fontSize : 15 ,
182183 fontWeight : "600" ,
183184 marginLeft : 4 ,
184- color : "#212121" ,
185185 } ,
186186 loader : { marginVertical : 30 } ,
187187 errorText : { textAlign : "center" , color : "#f00" , padding : 20 } ,
188188 tabBar : {
189189 flexDirection : "row" ,
190190 borderBottomWidth : StyleSheet . hairlineWidth ,
191- borderBottomColor : "#eee" ,
192- backgroundColor : "#fff" ,
193191 } ,
194192 tabItem : {
195193 paddingHorizontal : 20 ,
196194 paddingVertical : 10 ,
197195 alignItems : "center" ,
198196 position : "relative" ,
199197 } ,
200- tabLabel : { fontSize : 14 , color : "#999" , fontWeight : "500" } ,
198+ tabLabel : { fontSize : 14 , fontWeight : "500" } ,
201199 tabActive : { color : "#00AEEC" , fontWeight : "700" } ,
202200 tabUnderline : {
203201 position : "absolute" ,
@@ -212,7 +210,6 @@ const styles = StyleSheet.create({
212210 title : {
213211 fontSize : 16 ,
214212 fontWeight : "600" ,
215- color : "#212121" ,
216213 lineHeight : 22 ,
217214 marginBottom : 8 ,
218215 } ,
@@ -248,7 +245,6 @@ const styles = StyleSheet.create({
248245 } ,
249246 divider : {
250247 height : StyleSheet . hairlineWidth ,
251- backgroundColor : "#f0f0f0" ,
252248 marginHorizontal : 14 ,
253249 } ,
254250 anchorRow : {
@@ -258,7 +254,7 @@ const styles = StyleSheet.create({
258254 paddingVertical : 12 ,
259255 } ,
260256 avatar : { width : 40 , height : 40 , borderRadius : 20 , marginRight : 10 } ,
261- anchorName : { flex : 1 , fontSize : 14 , color : "#212121" , fontWeight : "500" } ,
257+ anchorName : { flex : 1 , fontSize : 14 , fontWeight : "500" } ,
262258 followBtn : {
263259 backgroundColor : "#00AEEC" ,
264260 paddingHorizontal : 14 ,
@@ -267,7 +263,7 @@ const styles = StyleSheet.create({
267263 } ,
268264 followTxt : { color : "#fff" , fontSize : 12 , fontWeight : "600" } ,
269265 descBox : { padding : 14 , paddingTop : 4 } ,
270- descText : { fontSize : 14 , color : "#555" , lineHeight : 22 } ,
266+ descText : { fontSize : 14 , lineHeight : 22 } ,
271267 danmakuFull : { flex : 1 } ,
272268 hidden : { display : "none" } ,
273269} ) ;
0 commit comments