1import React, {useEffect} from 'react'; 2import {StyleSheet} from 'react-native'; 3import rpx from '@/utils/rpx'; 4import {SafeAreaView} from 'react-native-safe-area-context'; 5import StatusBar from '@/components/base/statusBar'; 6import MusicBar from '@/components/musicBar'; 7import SimpleAppBar from '@/components/base/simpleAppBar'; 8import Header from './components/header'; 9import Body from './components/body'; 10import {useSetAtom} from 'jotai'; 11import {initQueryResult, queryResultAtom, scrollToTopAtom} from './store/atoms'; 12 13interface IArtistDetailProps {} 14export default function ArtistDetail(props: IArtistDetailProps) { 15 const setQueryResult = useSetAtom(queryResultAtom); 16 const setScrollToTopState = useSetAtom(scrollToTopAtom); 17 18 useEffect(() => { 19 return () => { 20 setQueryResult(initQueryResult); 21 setScrollToTopState(true); 22 }; 23 }, []); 24 25 return ( 26 <SafeAreaView style={style.wrapper}> 27 <StatusBar></StatusBar> 28 <SimpleAppBar title="作者"></SimpleAppBar> 29 <Header></Header> 30 <Body></Body> 31 <MusicBar></MusicBar> 32 </SafeAreaView> 33 ); 34} 35 36const style = StyleSheet.create({ 37 wrapper: { 38 width: rpx(750), 39 flex: 1, 40 }, 41 body: { 42 flex: 1, 43 }, 44}); 45