mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
chore: bring back edit user playlist button
This commit is contained in:
parent
7d05c40dc0
commit
4511a0bd00
@ -63,26 +63,8 @@ class PlaybuttonCard extends HookWidget {
|
||||
others: 15,
|
||||
);
|
||||
|
||||
final textsHeight = useState(
|
||||
(textsKey.currentContext?.findRenderObject() as RenderBox?)
|
||||
?.size
|
||||
.height ??
|
||||
110.00,
|
||||
);
|
||||
|
||||
final cleanDescription = useDescription(description);
|
||||
|
||||
useEffect(() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
textsHeight.value =
|
||||
(textsKey.currentContext?.findRenderObject() as RenderBox?)
|
||||
?.size
|
||||
.height ??
|
||||
textsHeight.value;
|
||||
});
|
||||
return null;
|
||||
}, [textsKey]);
|
||||
|
||||
return Container(
|
||||
constraints: BoxConstraints(maxWidth: size),
|
||||
margin: margin,
|
||||
|
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:spotube/collections/spotube_icons.dart';
|
||||
import 'package:spotube/components/playlist/playlist_create_dialog.dart';
|
||||
import 'package:spotube/components/shared/heart_button.dart';
|
||||
import 'package:spotube/components/shared/tracks_view/sections/body/use_is_user_playlist.dart';
|
||||
import 'package:spotube/components/shared/tracks_view/track_view_props.dart';
|
||||
@ -76,6 +77,21 @@ class TrackViewHeaderActions extends HookConsumerWidget {
|
||||
}
|
||||
},
|
||||
),
|
||||
if (isUserPlaylist)
|
||||
IconButton(
|
||||
icon: const Icon(SpotubeIcons.edit),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return PlaylistCreateDialog(
|
||||
playlistId: props.collectionId,
|
||||
trackIds: props.tracks.map((e) => e.id!).toList(),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -131,10 +131,8 @@ class PlaylistMutations {
|
||||
);
|
||||
}
|
||||
},
|
||||
refreshQueries: [
|
||||
"playlist/$playlistId",
|
||||
],
|
||||
refreshInfiniteQueries: [
|
||||
"playlist/$playlistId",
|
||||
"current-user-playlists",
|
||||
],
|
||||
ref: ref,
|
||||
|
Loading…
Reference in New Issue
Block a user