style(settings): align updates section with app UI patterns
This commit is contained in:
@@ -395,12 +395,18 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
marginTop: theme.spacing[1],
|
marginTop: theme.spacing[1],
|
||||||
},
|
},
|
||||||
updateActions: {
|
updateActions: {
|
||||||
alignItems: "flex-end",
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
gap: theme.spacing[2],
|
gap: theme.spacing[2],
|
||||||
},
|
},
|
||||||
|
updateErrorText: {
|
||||||
|
color: theme.colors.palette.red[300],
|
||||||
|
fontSize: theme.fontSize.xs,
|
||||||
|
marginTop: theme.spacing[1],
|
||||||
|
},
|
||||||
updateWarningCard: {
|
updateWarningCard: {
|
||||||
marginTop: theme.spacing[3],
|
marginTop: theme.spacing[3],
|
||||||
borderRadius: theme.borderRadius.md,
|
borderRadius: theme.borderRadius.lg,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: theme.colors.palette.amber[500],
|
borderColor: theme.colors.palette.amber[500],
|
||||||
backgroundColor: "rgba(245, 158, 11, 0.12)",
|
backgroundColor: "rgba(245, 158, 11, 0.12)",
|
||||||
@@ -413,7 +419,7 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
},
|
},
|
||||||
updateDiagnosticsCard: {
|
updateDiagnosticsCard: {
|
||||||
marginTop: theme.spacing[3],
|
marginTop: theme.spacing[3],
|
||||||
borderRadius: theme.borderRadius.md,
|
borderRadius: theme.borderRadius.lg,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: theme.colors.border,
|
borderColor: theme.colors.border,
|
||||||
backgroundColor: theme.colors.surface1,
|
backgroundColor: theme.colors.surface1,
|
||||||
@@ -782,8 +788,7 @@ export default function SettingsScreen() {
|
|||||||
|
|
||||||
void confirmDialog({
|
void confirmDialog({
|
||||||
title: "Update local daemon",
|
title: "Update local daemon",
|
||||||
message:
|
message: "This updates the Paseo daemon on this computer. A restart is required afterwards.",
|
||||||
"This updates the Paseo daemon on this computer only. A daemon restart is required after the update.",
|
|
||||||
confirmLabel: "Update daemon",
|
confirmLabel: "Update daemon",
|
||||||
cancelLabel: "Cancel",
|
cancelLabel: "Cancel",
|
||||||
})
|
})
|
||||||
@@ -1188,7 +1193,7 @@ export default function SettingsScreen() {
|
|||||||
<Text style={styles.updateHintText}>
|
<Text style={styles.updateHintText}>
|
||||||
{localDaemonHost
|
{localDaemonHost
|
||||||
? `Connected host: ${localDaemonHost.label}`
|
? `Connected host: ${localDaemonHost.label}`
|
||||||
: "No local daemon detected in Settings yet."}
|
: "No local daemon detected yet."}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text style={styles.aboutValue}>{localDaemonVersionText}</Text>
|
<Text style={styles.aboutValue}>{localDaemonVersionText}</Text>
|
||||||
@@ -1203,7 +1208,7 @@ export default function SettingsScreen() {
|
|||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
{appUpdateError ? (
|
{appUpdateError ? (
|
||||||
<Text style={[styles.updateStatusText, { color: theme.colors.palette.red[300] }]}>
|
<Text style={styles.updateErrorText}>
|
||||||
{appUpdateError}
|
{appUpdateError}
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -1240,7 +1245,7 @@ export default function SettingsScreen() {
|
|||||||
<View style={styles.audioRowContent}>
|
<View style={styles.audioRowContent}>
|
||||||
<Text style={styles.audioRowTitle}>Update local daemon</Text>
|
<Text style={styles.audioRowTitle}>Update local daemon</Text>
|
||||||
<Text style={styles.updateHintText}>
|
<Text style={styles.updateHintText}>
|
||||||
This updates the daemon on THIS computer only and requires a restart.
|
Updates the daemon on this computer only. Requires a restart.
|
||||||
</Text>
|
</Text>
|
||||||
{localDaemonUpdateMessage ? (
|
{localDaemonUpdateMessage ? (
|
||||||
<Text style={styles.updateStatusText}>{localDaemonUpdateMessage}</Text>
|
<Text style={styles.updateStatusText}>{localDaemonUpdateMessage}</Text>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ describe('desktop-updates helpers', () => {
|
|||||||
|
|
||||||
expect(formatVersionWithPrefix('0.2.0')).toBe('v0.2.0')
|
expect(formatVersionWithPrefix('0.2.0')).toBe('v0.2.0')
|
||||||
expect(formatVersionWithPrefix('v0.2.0')).toBe('v0.2.0')
|
expect(formatVersionWithPrefix('v0.2.0')).toBe('v0.2.0')
|
||||||
expect(formatVersionWithPrefix(null)).toBe('Unavailable')
|
expect(formatVersionWithPrefix(null)).toBe('\u2014')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('prefers localhost direct host when selecting local daemon', async () => {
|
it('prefers localhost direct host when selecting local daemon', async () => {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export function isVersionMismatch(
|
|||||||
export function formatVersionWithPrefix(version: string | null | undefined): string {
|
export function formatVersionWithPrefix(version: string | null | undefined): string {
|
||||||
const value = version?.trim()
|
const value = version?.trim()
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return 'Unavailable'
|
return '\u2014'
|
||||||
}
|
}
|
||||||
|
|
||||||
return value.startsWith('v') ? value : `v${value}`
|
return value.startsWith('v') ? value : `v${value}`
|
||||||
|
|||||||
Reference in New Issue
Block a user