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