Skip to content

Commit

Permalink
Chore: Display server url in settings (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelberMartin authored Nov 19, 2024
1 parent 1e24253 commit ea12b02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ private fun SettingsScreen(
AboutSection(
modifier = Modifier.fillMaxWidth(),
hasUserSelectedInstance = hasUserSelectedInstance,
serverUrl = serverUrl,
onOpenPrivacyPolicy = {
val link = URLBuilder(serverUrl).appendPathSegments("privacy").buildString()

Expand Down Expand Up @@ -334,6 +335,7 @@ private fun NotificationSection(modifier: Modifier, onOpenNotificationSettings:
private fun AboutSection(
modifier: Modifier,
hasUserSelectedInstance: Boolean,
serverUrl: String,
onRequestSelectServerInstance: () -> Unit,
onOpenPrivacyPolicy: () -> Unit,
onOpenImprint: () -> Unit,
Expand All @@ -352,6 +354,12 @@ private fun AboutSection(
}

if (hasUserSelectedInstance) {
PreferenceEntry(
modifier = Modifier.fillMaxWidth(),
text = stringResource(R.string.settings_server_url, serverUrl),
onClick = {}
)

PreferenceEntry(
modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.settings_about_privacy_policy),
Expand Down
1 change: 1 addition & 0 deletions feature/settings/src/main/res/values/settings_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<string name="settings_about_section">About</string>
<string name="settings_server_specifics_information">Imprint and privacy policy depend on the server you have currently selected.</string>
<string name="settings_server_url">Server URL: %1$s</string>
<string name="settings_server_specifics_unavailable">Imprint and privacy policy are unavailable as you have not yet selected a server instance. Please select a server instance to view their privacy policy and imprint.</string>
<string name="settings_server_specifics_unavailable_select_instance_button">Select instance</string>
<string name="settings_about_privacy_policy">Privacy policy</string>
Expand Down

0 comments on commit ea12b02

Please sign in to comment.