Add changelog display to Last.fm plugin settings

This commit is contained in:
kmmiio99o 2025-09-13 23:23:38 +02:00
parent 6d7d27b3c5
commit fb720a4170
4 changed files with 121 additions and 2 deletions

View file

@ -5,7 +5,7 @@
"id": "492949202121261067"
},
{
"name": "forked by kmmiio99o",
"name": "kmmiio99o",
"id": "879393496627306587"
}
],

View file

@ -0,0 +1,35 @@
interface ChangelogEntry {
version: string;
date: string;
changes: string[];
}
export const changelog: ChangelogEntry[] = [
{
version: "2.1.0",
date: "2024-01-15",
changes: ["Add changelog display to Last.fm plugin settings"],
},
{
version: "2.0.0",
date: "2025-09-12",
changes: ["Fix settings scrolling"],
},
{
version: "1.3.0",
date: "2025-09-12",
changes: ["fix reanimated"],
},
{
version: "1.2.0",
date: "2025-09-12",
changes: ["test"],
},
{
version: "1.1.0",
date: "2025-09-12",
changes: ["fixed reanimated issue??"],
},
];
export const currentVersion = "2.0.0";

View file

@ -0,0 +1,49 @@
import { clipboard } from "@vendetta/metro/common";
import { getAssetIDByName } from "@vendetta/ui/assets";
import { ErrorBoundary, Forms, General } from "@vendetta/ui/components";
import { showToast } from "@vendetta/ui/toasts";
import { changelog, currentVersion } from "../changelog";
import { React } from "@vendetta/metro/common";
const { FormRow, FormSection } = Forms;
const { View, ScrollView, Text, TouchableOpacity } = General;
export default function ChangelogView() {
return (
<ErrorBoundary>
<ScrollView style={{ flex: 1 }}>
<FormSection title="CURRENT VERSION">
<FormRow
label={currentVersion}
trailing={
<TouchableOpacity
onPress={() => {
clipboard.setString(currentVersion);
showToast("Version copied to clipboard", getAssetIDByName("toast_copy_link"));
}}
>
<Text style={{ color: "#72767d", fontSize: 16 }}>Copy</Text>
</TouchableOpacity>
}
/>
</FormSection>
<FormSection title="CHANGELOG">
{changelog.map((entry, index) => (
<View key={index} style={{ padding: 16, borderBottomWidth: index === changelog.length - 1 ? 0 : 0.5, borderBottomColor: "#292929" }}>
<View style={{ flexDirection: "row", justifyContent: "space-between", marginBottom: 8 }}>
<Text style={{ color: "#fff", fontWeight: "bold" }}>Version {entry.version}</Text>
<Text style={{ color: "#72767d" }}>{entry.date}</Text>
</View>
{entry.changes.map((change, changeIndex) => (
<Text key={changeIndex} style={{ color: "#dcddde", marginLeft: 16, marginTop: 4 }}>
• {change}
</Text>
))}
</View>
))}
</FormSection>
</ScrollView>
</ErrorBoundary>
);
}

View file

@ -5,6 +5,7 @@ import { getAssetIDByName } from "@vendetta/ui/assets";
import { showToast } from "@vendetta/ui/toasts";
import { React } from "@vendetta/metro/common";
import { ScrollView, View } from "react-native";
import { changelog, currentVersion } from "../../changelog";
import { currentSettings, pluginState } from "../..";
import Constants from "../../constants";
@ -191,6 +192,40 @@ export default function Settings() {
</View>
</FormSection>
<FormSection title="CHANGELOG">
{changelog.map((entry, index) => (
<View
key={index}
style={{
padding: 10,
borderBottomWidth: index === changelog.length - 1 ? 0 : 0.5,
borderBottomColor: "#292929",
}}
>
<View
style={{
flexDirection: "row",
justifyContent: "space-between",
marginBottom: 8,
}}
>
<FormText style={{ fontWeight: "bold" }}>
Version {entry.version}
</FormText>
<FormText style={{ opacity: 0.5 }}>{entry.date}</FormText>
</View>
{entry.changes.map((change, changeIndex) => (
<FormText
key={changeIndex}
style={{ marginLeft: 16, marginTop: 4, opacity: 0.8 }}
>
• {change}
</FormText>
))}
</View>
))}
</FormSection>
<FormText
style={{
padding: 16,
@ -200,7 +235,7 @@ export default function Settings() {
marginBottom: 8,
}}
>
Version 2.0.0
Version {currentVersion}
</FormText>
</ScrollView>
);