fix message display and now using the API to get the correct melody url
This commit is contained in:
@@ -779,4 +779,8 @@ export default class API {
|
|||||||
public static getPartitionSvgUrl(songId: number): string {
|
public static getPartitionSvgUrl(songId: number): string {
|
||||||
return `${API.baseUrl}/song/${songId}/assets/partition`;
|
return `${API.baseUrl}/song/${songId}/assets/partition`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static getPartitionMelodyUrl(songId: number): string {
|
||||||
|
return `${API.baseUrl}/song/${songId}/assets/melody`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const PartitionMagic = ({
|
|||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!melodySound.current) {
|
if (!melodySound.current) {
|
||||||
Audio.Sound.createAsync({
|
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 }) => {
|
}).then(({ sound }) => {
|
||||||
melodySound.current = sound;
|
melodySound.current = sound;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { ColorSchemeType } from 'native-base/lib/typescript/components/types';
|
|||||||
export type ScoreMessage = {
|
export type ScoreMessage = {
|
||||||
content: string;
|
content: string;
|
||||||
color?: ColorSchemeType;
|
color?: ColorSchemeType;
|
||||||
id: number;
|
id: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PlayScoreProps = {
|
type PlayScoreProps = {
|
||||||
@@ -90,7 +90,7 @@ export const PlayScore = ({ score, streak, message }: PlayScoreProps) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text color={textColor[900]} fontSize={20}>
|
<Text color={textColor[900]} fontSize={20}>
|
||||||
{message}
|
{message.content}
|
||||||
</Text>
|
</Text>
|
||||||
{streak > 0 && (
|
{streak > 0 && (
|
||||||
<Text color={textColor[900]} fontSize={15} bold>
|
<Text color={textColor[900]} fontSize={15} bold>
|
||||||
|
|||||||
Reference in New Issue
Block a user