diff --git a/app/src/main/java/org/mozilla/fenix/shopping/middleware/ReviewQualityCheckVendorsService.kt b/app/src/main/java/org/mozilla/fenix/shopping/middleware/ReviewQualityCheckVendorsService.kt index 947d850eb6..9f594d8584 100644 --- a/app/src/main/java/org/mozilla/fenix/shopping/middleware/ReviewQualityCheckVendorsService.kt +++ b/app/src/main/java/org/mozilla/fenix/shopping/middleware/ReviewQualityCheckVendorsService.kt @@ -25,11 +25,6 @@ interface ReviewQualityCheckVendorsService { * Returns the list of product vendors in order. */ fun productVendors(): List - - /** - * Returns the product's vendor. - */ - fun productVendor(): ProductVendor } /** @@ -59,8 +54,6 @@ class DefaultReviewQualityCheckVendorsService( } } - override fun productVendor(): ProductVendor = productVendors().first() - /** * Creates list of product vendors using the firstVendor param as the first item in the list. */ @@ -83,3 +76,9 @@ class DefaultReviewQualityCheckVendorsService( } } } + +/** + * Returns the first matching product vendor for the selected tab. + */ +fun ReviewQualityCheckVendorsService.productVendor(): ProductVendor = + productVendors().first() diff --git a/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityCheckContextualOnboarding.kt b/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityCheckContextualOnboarding.kt index 7d3aa49d07..41a10aad6d 100644 --- a/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityCheckContextualOnboarding.kt +++ b/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityCheckContextualOnboarding.kt @@ -26,9 +26,9 @@ import org.mozilla.fenix.compose.LinkText import org.mozilla.fenix.compose.LinkTextState import org.mozilla.fenix.compose.annotation.LightDarkPreview import org.mozilla.fenix.compose.button.PrimaryButton -import org.mozilla.fenix.shopping.ext.displayName import org.mozilla.fenix.shopping.store.ReviewQualityCheckState import org.mozilla.fenix.shopping.store.ReviewQualityCheckState.ProductVendor +import org.mozilla.fenix.shopping.ui.ext.displayName import org.mozilla.fenix.theme.FirefoxTheme const val PLACEHOLDER_URL = "www.fakespot.com" diff --git a/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityInfoCard.kt b/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityInfoCard.kt index d627081e8f..afbeb94739 100644 --- a/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityInfoCard.kt +++ b/app/src/main/java/org/mozilla/fenix/shopping/ui/ReviewQualityInfoCard.kt @@ -27,8 +27,8 @@ import org.mozilla.fenix.compose.LinkText import org.mozilla.fenix.compose.LinkTextState import org.mozilla.fenix.compose.annotation.LightDarkPreview import org.mozilla.fenix.compose.parseHtml -import org.mozilla.fenix.shopping.ext.displayName import org.mozilla.fenix.shopping.store.ReviewQualityCheckState +import org.mozilla.fenix.shopping.ui.ext.displayName import org.mozilla.fenix.theme.FirefoxTheme /** diff --git a/app/src/main/java/org/mozilla/fenix/shopping/ext/ProductVendor.kt b/app/src/main/java/org/mozilla/fenix/shopping/ui/ext/ProductVendor.kt similarity index 95% rename from app/src/main/java/org/mozilla/fenix/shopping/ext/ProductVendor.kt rename to app/src/main/java/org/mozilla/fenix/shopping/ui/ext/ProductVendor.kt index d7787c88d2..f2890f3b52 100644 --- a/app/src/main/java/org/mozilla/fenix/shopping/ext/ProductVendor.kt +++ b/app/src/main/java/org/mozilla/fenix/shopping/ui/ext/ProductVendor.kt @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.mozilla.fenix.shopping.ext +package org.mozilla.fenix.shopping.ui.ext import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource diff --git a/app/src/test/java/org/mozilla/fenix/shopping/fake/FakeReviewQualityCheckVendorsService.kt b/app/src/test/java/org/mozilla/fenix/shopping/fake/FakeReviewQualityCheckVendorsService.kt index fe978fe407..9d1caaa349 100644 --- a/app/src/test/java/org/mozilla/fenix/shopping/fake/FakeReviewQualityCheckVendorsService.kt +++ b/app/src/test/java/org/mozilla/fenix/shopping/fake/FakeReviewQualityCheckVendorsService.kt @@ -15,6 +15,4 @@ class FakeReviewQualityCheckVendorsService( ), ) : ReviewQualityCheckVendorsService { override fun productVendors(): List = productVendors - - override fun productVendor(): ProductVendor = productVendors().first() }