xref: /MusicFree/src/pages/sheetDetail/components/navBar.tsx (revision 03f1f70c590b8e2956c23bfa7bd5f64ca87e9e83)
1bf6e62f2S猫头猫import React from 'react';
2bf6e62f2S猫头猫import {Appbar} from 'react-native-paper';
31c06c799S猫头猫import {StyleSheet, View} from 'react-native';
4bf6e62f2S猫头猫import rpx from '@/utils/rpx';
5*03f1f70cS猫头猫import {useNavigation, useRoute} from '@react-navigation/native';
6bf6e62f2S猫头猫import usePrimaryColor from '@/hooks/usePrimaryColor';
7*03f1f70cS猫头猫import AppBarWithSearch from '@/components/base/appBarWithSearch';
8*03f1f70cS猫头猫import MusicSheet from '@/common/musicSheetManager';
9*03f1f70cS猫头猫import {ROUTE_PATH} from '@/entry/router';
10bf6e62f2S猫头猫
11bf6e62f2S猫头猫interface IProps {}
12bf6e62f2S猫头猫export default function (props: IProps) {
13*03f1f70cS猫头猫  const navigation = useNavigation<any>();
14*03f1f70cS猫头猫  const route = useRoute<any>();
15*03f1f70cS猫头猫  const id = route.params?.id ?? 'favorite';
16*03f1f70cS猫头猫  const musicSheet = MusicSheet.useSheets(id);
17bf6e62f2S猫头猫
18bf6e62f2S猫头猫  return (
19*03f1f70cS猫头猫    <AppBarWithSearch
20*03f1f70cS猫头猫      title="歌单"
21*03f1f70cS猫头猫      onSearchPress={() => {
22*03f1f70cS猫头猫        navigation.navigate(ROUTE_PATH.SEARCH_MUSIC_LIST, {
23*03f1f70cS猫头猫          musicList: musicSheet.musicList,
24*03f1f70cS猫头猫        });
25*03f1f70cS猫头猫      }}></AppBarWithSearch>
26bf6e62f2S猫头猫  );
27bf6e62f2S猫头猫}
28bf6e62f2S猫头猫
29bf6e62f2S猫头猫const style = StyleSheet.create({
30bf6e62f2S猫头猫  appbar: {
31bf6e62f2S猫头猫    shadowColor: 'transparent',
32bf6e62f2S猫头猫    flexDirection: 'row',
33bf6e62f2S猫头猫    width: rpx(750),
34bf6e62f2S猫头猫  },
35bf6e62f2S猫头猫});
36