fix message display and now using the API to get the correct melody url

This commit is contained in:
Clément Le Bihan
2024-01-07 16:59:22 +01:00
parent ddc97f0923
commit c79ae7c6e8
3 changed files with 7 additions and 3 deletions

View File

@@ -779,4 +779,8 @@ export default class API {
public static getPartitionSvgUrl(songId: number): string {
return `${API.baseUrl}/song/${songId}/assets/partition`;
}
public static getPartitionMelodyUrl(songId: number): string {
return `${API.baseUrl}/song/${songId}/assets/melody`;
}
}

View File

@@ -77,7 +77,7 @@ const PartitionMagic = ({
React.useEffect(() => {
if (!melodySound.current) {
Audio.Sound.createAsync({
uri: 'https://cdn.discordapp.com/attachments/717080637038788731/1192502931681984622/melody.mp3?ex=65a94fe6&is=6596dae6&hm=af0879593154fb54b78a9b49c77ae27da9f11d59e676f01fa9eb2a8d5a997708&',
uri: API.getPartitionMelodyUrl(songID),
}).then(({ sound }) => {
melodySound.current = sound;
});

View File

@@ -14,7 +14,7 @@ import { ColorSchemeType } from 'native-base/lib/typescript/components/types';
export type ScoreMessage = {
content: string;
color?: ColorSchemeType;
id: number;
id: number;
};
type PlayScoreProps = {
@@ -90,7 +90,7 @@ export const PlayScore = ({ score, streak, message }: PlayScoreProps) => {
}}
>
<Text color={textColor[900]} fontSize={20}>
{message}
{message.content}
</Text>
{streak > 0 && (
<Text color={textColor[900]} fontSize={15} bold>