mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 01:07:46 +00:00
feat: make NIP-05 and image hash-verify symbols follow the accent
The NIP-05 identifier colour and its verified badge were a fixed purple, and the image hash-verification "passed" seal was a fixed purple drawable — none followed the selected accent. Redefine the nip05 token to the theme primary (covering the identifier text, badge and the other nip05 call sites) and tint the nip_05 and original drawables with the accent at render. Also switch the hash-verification "failed" icon from a raw Color.Red to colorScheme.error, matching the themed error red used everywhere else. Removes the now-unused Nip05EmailColor light/dark constants. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D1F9jXNwRGTP8qmsV3Wd69
This commit is contained in:
+2
-2
@@ -1254,7 +1254,7 @@ private fun HashVerificationSymbol(verifiedHash: Boolean) {
|
||||
painter = painterRes(R.drawable.original, 1),
|
||||
contentDescription = stringRes(id = R.string.hash_verification_passed),
|
||||
modifier = Size30Modifier,
|
||||
tint = Color.Unspecified,
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
@@ -1268,7 +1268,7 @@ private fun HashVerificationSymbol(verifiedHash: Boolean) {
|
||||
symbol = MaterialSymbols.Report,
|
||||
contentDescription = stringRes(id = R.string.hash_verification_failed),
|
||||
modifier = Size30Modifier,
|
||||
tint = Color.Red,
|
||||
tint = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -36,7 +36,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
@@ -481,7 +480,7 @@ fun RenderNIP05VerifiedSymbol(
|
||||
painter = painterRes(R.drawable.nip_05, compositionSizeReference),
|
||||
contentDescription = stringRes(id = R.string.nip05_verified),
|
||||
modifier = modifier,
|
||||
tint = Color.Unspecified,
|
||||
tint = MaterialTheme.colorScheme.nip05,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,6 @@ val BitcoinLight = Color(0xFFB66605)
|
||||
|
||||
val Following = Color(0xFF03DAC5)
|
||||
|
||||
val Nip05EmailColorDark = Color(0xFF765AA2)
|
||||
val Nip05EmailColorLight = Color(0xFFa770f3)
|
||||
|
||||
val LightRedColor = Color(0xFFC62828)
|
||||
|
||||
val RelayIconFilter = ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0.5f) })
|
||||
|
||||
@@ -546,8 +546,9 @@ val ColorScheme.mediumImportanceLink: Color
|
||||
val ColorScheme.placeholderText: Color
|
||||
get() = if (isLight) LightPlaceholderText else DarkPlaceholderText
|
||||
|
||||
// NIP-05 identifiers were a fixed purple; follow the selected accent instead.
|
||||
val ColorScheme.nip05: Color
|
||||
get() = if (isLight) Nip05EmailColorLight else Nip05EmailColorDark
|
||||
get() = primary
|
||||
|
||||
val ColorScheme.onBackgroundColorFilter: ColorFilter
|
||||
get() = if (isLight) LightOnBackgroundColorFilter else DarkOnBackgroundColorFilter
|
||||
|
||||
Reference in New Issue
Block a user