diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/models/Permission.kt b/app/src/main/java/com/greenart7c3/nostrsigner/models/Permission.kt index ba46ea29..1a1c8b3a 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/models/Permission.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/models/Permission.kt @@ -256,11 +256,6 @@ fun nipToLocalizedString(context: Context, permission: Permission, shouldReturnE data class KindNip(val kind: IntRange, val nip: String) -fun Int.kindToNipUrl(): String? = - kindsByNip.firstOrNull { it.kind.contains(this) }?.let { - return if (it.nip.startsWith("http")) it.nip else "https://github.com/nostr-protocol/nips/blob/master/${it.nip}.md" - } - fun Int.containsNip(): Boolean = kindsByNip.any { val nip = if (this < 10) { this.toString().padStart(2, '0') @@ -272,9 +267,6 @@ fun Int.containsNip(): Boolean = kindsByNip.any { fun Int.kindToNip(): String? = kindsByNip.firstOrNull { it.kind.contains(this) }?.nip -fun Int.nipToUrl(): String? = kindsByNip.firstOrNull { it.nip.toIntOrNull() == this } - ?.nip?.let { nip -> if (nip.startsWith("http")) nip else "https://github.com/nostr-protocol/nips/blob/master/$nip.md" } - val kindsByNip = listOf( KindNip(0..2, "01"), KindNip(3..3, "02"), diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptedBlobInterceptor.kt b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptedBlobInterceptor.kt index 91e59bf2..446f2fe9 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptedBlobInterceptor.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptedBlobInterceptor.kt @@ -28,7 +28,7 @@ import okhttp3.Response import okhttp3.ResponseBody.Companion.toResponseBody class EncryptedBlobInterceptor( - val cache: EncryptionKeyCache, + private val cache: EncryptionKeyCache, ) : Interceptor { fun Response.decrypt(cipher: NostrCipher): Response { val body = peekBody(Long.MAX_VALUE) @@ -37,7 +37,7 @@ class EncryptedBlobInterceptor( return newBuilder().body(newBody).build() } - fun Response.decryptOrNull(cipher: NostrCipher): Response? = + private fun Response.decryptOrNull(cipher: NostrCipher): Response? = try { decrypt(cipher) } catch (e: Exception) { diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptionKeyCache.kt b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptionKeyCache.kt index 5e61049b..2ba99f36 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptionKeyCache.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/EncryptionKeyCache.kt @@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.crypto.nip17.NostrCipher * This class serves as a key cache to decrypt the body of HTTP calls that need it. */ class EncryptionKeyCache { - val cache = LruCache(100) + private val cache = LruCache(100) fun add( url: String?, diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/HttpClientManager.kt b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/HttpClientManager.kt index 024dc925..ca6df8e9 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/HttpClientManager.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/HttpClientManager.kt @@ -21,8 +21,6 @@ package com.greenart7c3.nostrsigner.okhttp import android.util.Log -import com.vitorpamplona.amethyst.service.okhttp.LoggingInterceptor -import com.vitorpamplona.quartz.crypto.nip17.NostrCipher import java.net.InetSocketAddress import java.net.Proxy import java.time.Duration @@ -48,7 +46,7 @@ object HttpClientManager { private val cache = EncryptionKeyCache() - fun setDefaultProxy(proxy: Proxy?) { + private fun setDefaultProxy(proxy: Proxy?) { if (currentProxy != proxy) { Log.d("HttpClient", "Changing proxy to: ${proxy != null}") currentProxy = proxy @@ -58,8 +56,6 @@ object HttpClientManager { } } - fun getCurrentProxy(): Proxy? = currentProxy - fun setDefaultTimeout(timeout: Duration) { Log.d("HttpClient", "Changing timeout to: $timeout") if (defaultTimeout.seconds != timeout.seconds) { @@ -98,13 +94,6 @@ object HttpClientManager { .build() } - fun getCurrentProxyPort(useProxy: Boolean): Int? = - if (useProxy) { - (currentProxy?.address() as? InetSocketAddress)?.port - } else { - null - } - fun getHttpClient(useProxy: Boolean): OkHttpClient = if (useProxy) { if (defaultHttpClient == null) { @@ -121,9 +110,4 @@ object HttpClientManager { fun setDefaultProxyOnPort(port: Int) { setDefaultProxy(Proxy(Proxy.Type.SOCKS, InetSocketAddress("127.0.0.1", port))) } - - fun addCipherToCache( - url: String, - cipher: NostrCipher, - ) = cache.add(url, cipher) } diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/LoggingInterceptor.kt b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/LoggingInterceptor.kt index 5ba8ce7d..548e81c6 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/LoggingInterceptor.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/LoggingInterceptor.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.service.okhttp +package com.greenart7c3.nostrsigner.okhttp import android.util.Log import java.net.InetSocketAddress diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/OkHttpWebSocket.kt b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/OkHttpWebSocket.kt index 34b164d8..1ee7e432 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/OkHttpWebSocket.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/okhttp/OkHttpWebSocket.kt @@ -28,13 +28,13 @@ import okhttp3.Response class OkHttpWebSocket( val url: String, - val forceProxy: Boolean, + private val forceProxy: Boolean, val out: WebSocketListener, ) : WebSocket { private val listener = OkHttpWebsocketListener() private var socket: okhttp3.WebSocket? = null - fun buildRequest() = Request.Builder().url(url.trim()).build() + private fun buildRequest() = Request.Builder().url(url.trim()).build() override fun connect() { socket = HttpClientManager.getHttpClient(forceProxy).newWebSocket(buildRequest(), listener) @@ -46,7 +46,7 @@ class OkHttpWebSocket( response: Response, ) = out.onOpen( response.receivedResponseAtMillis - response.sentRequestAtMillis, - response.headers.get("Sec-WebSocket-Extensions")?.contains("permessage-deflate") ?: false, + response.headers["Sec-WebSocket-Extensions"]?.contains("permessage-deflate") ?: false, ) override fun onMessage( diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/service/Biometrics.kt b/app/src/main/java/com/greenart7c3/nostrsigner/service/Biometrics.kt index 5965241e..440475ec 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/service/Biometrics.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/service/Biometrics.kt @@ -14,13 +14,6 @@ import androidx.biometric.BiometricPrompt import com.greenart7c3.nostrsigner.R object Biometrics { - fun isFingerprintAvailable(context: Context): Boolean { - val fragmentContext = context.getAppCompatActivity()!! - val keyguardManager = - fragmentContext.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager - return keyguardManager.isDeviceSecure - } - fun authenticate( title: String, context: Context, diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/service/PackageUtils.kt b/app/src/main/java/com/greenart7c3/nostrsigner/service/PackageUtils.kt deleted file mode 100644 index 6359c4c7..00000000 --- a/app/src/main/java/com/greenart7c3/nostrsigner/service/PackageUtils.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) 2024 Vitor Pamplona - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -package com.greenart7c3.nostrsigner.service - -import android.annotation.SuppressLint -import android.content.Context - -object PackageUtils { - @SuppressLint("QueryPermissionsNeeded") - private fun isPackageInstalled( - context: Context, - ): Boolean { - return context.packageManager.getInstalledApplications(0).find { info -> - info.packageName == "org.torproject.android" - } != null - } - - fun isOrbotInstalled(context: Context): Boolean { - return isPackageInstalled(context) - } -} diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountScreen.kt index 0805da84..ec6fff43 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountScreen.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountScreen.kt @@ -24,7 +24,6 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountStateViewModel.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountStateViewModel.kt index 10d5f98d..196347d9 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountStateViewModel.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/AccountStateViewModel.kt @@ -270,7 +270,7 @@ class AccountStateViewModel(npub: String?) : ViewModel() { startUI(account, null) } - fun startUI( + private fun startUI( account: Account, route: String?, ) { diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LifeCycleUtils.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/LifeCycleUtils.kt deleted file mode 100644 index f79affd5..00000000 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/LifeCycleUtils.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.greenart7c3.nostrsigner.ui - -import androidx.compose.runtime.Composable -import androidx.compose.runtime.DisposableEffect -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.LifecycleEventObserver -import androidx.lifecycle.LifecycleOwner -import androidx.lifecycle.compose.LocalLifecycleOwner - -@Composable -fun rememberLifecycleEvent(lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current): Lifecycle.Event { - var state by remember { mutableStateOf(Lifecycle.Event.ON_ANY) } - DisposableEffect(lifecycleOwner) { - val observer = - LifecycleEventObserver { _, event -> - state = event - } - lifecycleOwner.lifecycle.addObserver(observer) - onDispose { - lifecycleOwner.lifecycle.removeObserver(observer) - } - } - return state -} diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt index 48df4881..d69fdebe 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/PermissionsScreen.kt @@ -12,8 +12,6 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt index e74ebc80..a693fb05 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/SeeDetailsScreen.kt @@ -1,7 +1,6 @@ package com.greenart7c3.nostrsigner.ui import androidx.compose.foundation.BorderStroke -import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ConnectOrbotDialog.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ConnectOrbotDialog.kt index cace414e..352840dc 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ConnectOrbotDialog.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/actions/ConnectOrbotDialog.kt @@ -33,10 +33,8 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.SpanStyle diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt index dac675aa..f1c0deb3 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/MultiEventHomeScreen.kt @@ -180,7 +180,7 @@ fun MultiEventHomeScreen( onRemoveIntentData(intents, IntentResultType.REMOVE) for (intentData in intents) { - val localAccount = + val thisAccount = if (intentData.currentAccount.isNotBlank()) { LocalPreferences.loadFromEncryptedStorage( context, @@ -190,25 +190,25 @@ fun MultiEventHomeScreen( accountParam } ?: continue - val key = intentData.bunkerRequest?.localKey ?: packageName ?: continue + val localKey = intentData.bunkerRequest?.localKey ?: packageName ?: continue - val database = NostrSigner.getInstance().getDatabase(localAccount.signer.keyPair.pubKey.toNpub()) - val savedApplication = database.applicationDao().getByKey(key) + val database = NostrSigner.getInstance().getDatabase(thisAccount.signer.keyPair.pubKey.toNpub()) + val savedApplication = database.applicationDao().getByKey(localKey) val application = savedApplication ?: ApplicationWithPermissions( application = ApplicationEntity( - key, + localKey, "", listOf(), "", "", "", - localAccount.signer.keyPair.pubKey.toHexKey(), + thisAccount.signer.keyPair.pubKey.toHexKey(), true, intentData.bunkerRequest?.secret ?: "", intentData.bunkerRequest?.secret != null, - localAccount.signPolicy, + thisAccount.signPolicy, intentData.bunkerRequest?.closeApplication ?: true, ), permissions = mutableListOf(), @@ -224,7 +224,7 @@ fun MultiEventHomeScreen( if (intentData.rememberMyChoice.value && intentData.checked.value) { AmberUtils.acceptOrRejectPermission( application, - key, + localKey, intentData, localEvent.kind, intentData.rememberMyChoice.value, @@ -237,7 +237,7 @@ fun MultiEventHomeScreen( database.applicationDao().addHistory( HistoryEntity( 0, - key, + localKey, intentData.type.toString(), localEvent.kind, TimeUtils.now(), @@ -252,7 +252,7 @@ fun MultiEventHomeScreen( if (intentData.checked.value) { BunkerRequestUtils.sendBunkerResponse( context, - localAccount, + thisAccount, intentData.bunkerRequest, BunkerResponse(intentData.bunkerRequest.id, localEvent.toJson(), null), application.application.relays, @@ -266,7 +266,7 @@ fun MultiEventHomeScreen( } else { AmberUtils.sendBunkerError( intentData, - localAccount, + thisAccount, intentData.bunkerRequest, relays = application.application.relays, context = context, @@ -307,7 +307,7 @@ fun MultiEventHomeScreen( if (intentData.rememberMyChoice.value && intentData.checked.value) { AmberUtils.acceptOrRejectPermission( application, - key, + localKey, intentData, null, intentData.rememberMyChoice.value, @@ -319,7 +319,7 @@ fun MultiEventHomeScreen( database.applicationDao().addHistory( HistoryEntity( 0, - key, + localKey, intentData.type.toString(), null, TimeUtils.now(), @@ -327,7 +327,7 @@ fun MultiEventHomeScreen( ), ) - val signedMessage = CryptoUtils.signString(intentData.data, localAccount.signer.keyPair.privKey!!).toHexKey() + val signedMessage = CryptoUtils.signString(intentData.data, thisAccount.signer.keyPair.privKey!!).toHexKey() if (intentData.bunkerRequest != null) { val localIntentData = intentData.copy() @@ -336,7 +336,7 @@ fun MultiEventHomeScreen( if (intentData.checked.value) { BunkerRequestUtils.sendBunkerResponse( context, - localAccount, + thisAccount, intentData.bunkerRequest, BunkerResponse(intentData.bunkerRequest.id, signedMessage, null), application.application.relays, @@ -350,7 +350,7 @@ fun MultiEventHomeScreen( } else { AmberUtils.sendBunkerError( intentData, - localAccount, + thisAccount, intentData.bunkerRequest, relays = application.application.relays, context = context, @@ -378,7 +378,7 @@ fun MultiEventHomeScreen( database.applicationDao().addHistory( HistoryEntity( 0, - key, + localKey, intentData.type.toString(), null, TimeUtils.now(), @@ -392,7 +392,7 @@ fun MultiEventHomeScreen( if (intentData.checked.value) { BunkerRequestUtils.sendBunkerResponse( context, - localAccount, + thisAccount, intentData.bunkerRequest, BunkerResponse(intentData.bunkerRequest.id, "", null), application.application.relays, @@ -406,7 +406,7 @@ fun MultiEventHomeScreen( } else { AmberUtils.sendBunkerError( intentData, - localAccount, + thisAccount, intentData.bunkerRequest, relays = application.application.relays, context = context, @@ -432,7 +432,7 @@ fun MultiEventHomeScreen( if (intentData.rememberMyChoice.value && intentData.checked.value) { AmberUtils.acceptOrRejectPermission( application, - key, + localKey, intentData, null, intentData.rememberMyChoice.value, @@ -445,7 +445,7 @@ fun MultiEventHomeScreen( database.applicationDao().addHistory( HistoryEntity( 0, - key, + localKey, intentData.type.toString(), null, TimeUtils.now(), @@ -461,7 +461,7 @@ fun MultiEventHomeScreen( if (intentData.checked.value) { BunkerRequestUtils.sendBunkerResponse( context, - localAccount, + thisAccount, intentData.bunkerRequest, BunkerResponse(intentData.bunkerRequest.id, signature, null), application.application.relays, @@ -475,7 +475,7 @@ fun MultiEventHomeScreen( } else { AmberUtils.sendBunkerError( intentData, - localAccount, + thisAccount, intentData.bunkerRequest, relays = application.application.relays, context = context, @@ -526,7 +526,7 @@ fun MultiEventHomeScreen( BunkerRequestUtils.clearRequests() onRemoveIntentData(intents, IntentResultType.REMOVE) for (intentData in intents) { - val localAccount = + val thisAccount = if (intentData.currentAccount.isNotBlank()) { LocalPreferences.loadFromEncryptedStorage( context, @@ -536,26 +536,26 @@ fun MultiEventHomeScreen( accountParam } ?: continue - val key = intentData.bunkerRequest?.localKey ?: packageName ?: continue + val localKey = intentData.bunkerRequest?.localKey ?: packageName ?: continue - val database = NostrSigner.getInstance().getDatabase(localAccount.signer.keyPair.pubKey.toNpub()) + val database = NostrSigner.getInstance().getDatabase(thisAccount.signer.keyPair.pubKey.toNpub()) val application = database .applicationDao() - .getByKey(key) ?: ApplicationWithPermissions( + .getByKey(localKey) ?: ApplicationWithPermissions( application = ApplicationEntity( - key, + localKey, "", listOf(), "", "", "", - localAccount.signer.keyPair.pubKey.toHexKey(), + thisAccount.signer.keyPair.pubKey.toHexKey(), true, intentData.bunkerRequest?.secret ?: "", intentData.bunkerRequest?.secret != null, - localAccount.signPolicy, + thisAccount.signPolicy, intentData.bunkerRequest?.closeApplication ?: true, ), permissions = mutableListOf(), @@ -564,7 +564,7 @@ fun MultiEventHomeScreen( if (intentData.rememberMyChoice.value && intentData.checked.value) { AmberUtils.acceptOrRejectPermission( application, - key, + localKey, intentData, null, false, diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/PostButton.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/PostButton.kt deleted file mode 100644 index 94432272..00000000 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/components/PostButton.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.greenart7c3.nostrsigner.ui.components - -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.material3.Button -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.dp -import com.greenart7c3.nostrsigner.R -import com.greenart7c3.nostrsigner.ui.theme.ButtonBorder - -@Composable -fun PostButton( - modifier: Modifier = Modifier, - isActive: Boolean, - onPost: () -> Unit = {}, -) { - Button( - enabled = isActive, - modifier = modifier, - onClick = { - if (isActive) { - onPost() - } - }, - shape = ButtonBorder, - contentPadding = PaddingValues(0.dp), - ) { - Text(text = stringResource(R.string.save), color = Color.White) - } -} diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/ui/theme/Theme.kt b/app/src/main/java/com/greenart7c3/nostrsigner/ui/theme/Theme.kt index d0bc9634..edaa7f40 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/ui/theme/Theme.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/ui/theme/Theme.kt @@ -36,7 +36,6 @@ val primaryColor = Color(0xFFFFCA62) val primaryVariant = Color(0xFFC8541A) val secondaryColor = Color(0xFFFFCA62) val orange = Color(0xFFFF6B00) -val defaultPadding = 35.dp val RichTextDefaults = RichTextStyle().resolveDefaults() private val DarkColorPalette =