mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
Merge pull request #159 from cake-tech/CAKE-344-add-moonpay-contact-to-the-support-screen
CAKE-344 | fixed MoonPay icon color on support and dashboard pages
This commit is contained in:
commit
96ea969519
9 changed files with 23 additions and 28 deletions
|
@ -2,15 +2,12 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/buy/buy_provider_description.dart';
|
import 'package:cake_wallet/buy/buy_provider_description.dart';
|
||||||
|
|
||||||
Image getBuyProviderIcon(BuyProviderDescription providerDescription,
|
Image getBuyProviderIcon(BuyProviderDescription providerDescription,
|
||||||
{bool isWhiteIconColor = false}) {
|
{Color iconColor = Colors.black}) {
|
||||||
|
|
||||||
final _wyreIcon =
|
final _wyreIcon =
|
||||||
Image.asset('assets/images/wyre-icon.png', width: 36, height: 36);
|
Image.asset('assets/images/wyre-icon.png', width: 36, height: 36);
|
||||||
final _moonPayWhiteIcon =
|
final _moonPayIcon =
|
||||||
Image.asset('assets/images/moonpay-icon.png', color: Colors.white,
|
Image.asset('assets/images/moonpay-icon.png', color: iconColor,
|
||||||
width: 36, height: 34);
|
|
||||||
final _moonPayBlackIcon =
|
|
||||||
Image.asset('assets/images/moonpay-icon.png', color: Colors.black,
|
|
||||||
width: 36, height: 34);
|
width: 36, height: 34);
|
||||||
|
|
||||||
if (providerDescription != null) {
|
if (providerDescription != null) {
|
||||||
|
@ -18,7 +15,7 @@ Image getBuyProviderIcon(BuyProviderDescription providerDescription,
|
||||||
case BuyProviderDescription.wyre:
|
case BuyProviderDescription.wyre:
|
||||||
return _wyreIcon;
|
return _wyreIcon;
|
||||||
case BuyProviderDescription.moonPay:
|
case BuyProviderDescription.moonPay:
|
||||||
return isWhiteIconColor ? _moonPayWhiteIcon : _moonPayBlackIcon;
|
return _moonPayIcon;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,10 @@ class BuyListItem extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final isSelected = selectedProvider?.description == provider.description;
|
final isSelected = selectedProvider?.description == provider.description;
|
||||||
|
final iconColor = isSelected ? Colors.white : Colors.black;
|
||||||
|
|
||||||
final providerIcon = getBuyProviderIcon(provider.description,
|
final providerIcon = getBuyProviderIcon(provider.description,
|
||||||
isWhiteIconColor: isSelected);
|
iconColor: iconColor);
|
||||||
|
|
||||||
final backgroundColor = isSelected
|
final backgroundColor = isSelected
|
||||||
? Palette.greyBlueCraiola
|
? Palette.greyBlueCraiola
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import 'package:cake_wallet/buy/buy_provider_description.dart';
|
import 'package:cake_wallet/buy/buy_provider_description.dart';
|
||||||
import 'package:cake_wallet/buy/get_buy_provider_icon.dart';
|
import 'package:cake_wallet/buy/get_buy_provider_icon.dart';
|
||||||
import 'package:cake_wallet/themes/theme_base.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/di.dart';
|
|
||||||
import 'package:cake_wallet/store/settings_store.dart';
|
|
||||||
|
|
||||||
class OrderRow extends StatelessWidget {
|
class OrderRow extends StatelessWidget {
|
||||||
OrderRow({
|
OrderRow({
|
||||||
|
@ -22,11 +19,10 @@ class OrderRow extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final currentTheme = getIt.get<SettingsStore>().currentTheme;
|
final iconColor =
|
||||||
final isWhiteIconColor = currentTheme.type != ThemeType.light;
|
Theme.of(context).primaryTextTheme.display4.backgroundColor;
|
||||||
|
|
||||||
final providerIcon = getBuyProviderIcon(provider,
|
final providerIcon = getBuyProviderIcon(provider, iconColor: iconColor);
|
||||||
isWhiteIconColor: isWhiteIconColor);
|
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
|
|
|
@ -19,6 +19,9 @@ class SupportPage extends BasePage {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
|
final iconColor =
|
||||||
|
Theme.of(context).accentTextTheme.display4.backgroundColor;
|
||||||
|
|
||||||
return SectionStandardList(
|
return SectionStandardList(
|
||||||
sectionCount: 1,
|
sectionCount: 1,
|
||||||
itemCounter: (int _) => supportViewModel.items.length,
|
itemCounter: (int _) => supportViewModel.items.length,
|
||||||
|
@ -34,7 +37,7 @@ class SupportPage extends BasePage {
|
||||||
return SettingsLinkProviderCell(
|
return SettingsLinkProviderCell(
|
||||||
title: item.title,
|
title: item.title,
|
||||||
icon: item.icon,
|
icon: item.icon,
|
||||||
iconColor: item.iconColor,
|
iconColor: item.hasIconColor ? iconColor : null,
|
||||||
link: item.link,
|
link: item.link,
|
||||||
linkTitle: item.linkTitle);
|
linkTitle: item.linkTitle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,7 @@ class BrightTheme extends ThemeBase {
|
||||||
),
|
),
|
||||||
display4: TextStyle(
|
display4: TextStyle(
|
||||||
color: Palette.darkBlueCraiola, // template title (send page)
|
color: Palette.darkBlueCraiola, // template title (send page)
|
||||||
|
backgroundColor: Colors.white, // icon color on order row (moonpay)
|
||||||
decorationColor: Palette.niagara // receive amount text (exchange page)
|
decorationColor: Palette.niagara // receive amount text (exchange page)
|
||||||
),
|
),
|
||||||
subtitle: TextStyle(
|
subtitle: TextStyle(
|
||||||
|
@ -179,6 +180,7 @@ class BrightTheme extends ThemeBase {
|
||||||
),
|
),
|
||||||
display4: TextStyle(
|
display4: TextStyle(
|
||||||
color: Palette.darkGray, // switch background (settings page)
|
color: Palette.darkGray, // switch background (settings page)
|
||||||
|
backgroundColor: Colors.black, // icon color on support page (moonpay, github)
|
||||||
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
|
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
|
||||||
),
|
),
|
||||||
body1: TextStyle(
|
body1: TextStyle(
|
||||||
|
|
|
@ -112,6 +112,7 @@ class DarkTheme extends ThemeBase {
|
||||||
),
|
),
|
||||||
display4: TextStyle(
|
display4: TextStyle(
|
||||||
color: PaletteDark.cyanBlue, // template title (send page)
|
color: PaletteDark.cyanBlue, // template title (send page)
|
||||||
|
backgroundColor: Colors.white, // icon color on order row (moonpay)
|
||||||
decorationColor: PaletteDark.darkCyanBlue // receive amount text (exchange page)
|
decorationColor: PaletteDark.darkCyanBlue // receive amount text (exchange page)
|
||||||
),
|
),
|
||||||
subtitle: TextStyle(
|
subtitle: TextStyle(
|
||||||
|
@ -178,6 +179,7 @@ class DarkTheme extends ThemeBase {
|
||||||
),
|
),
|
||||||
display4: TextStyle(
|
display4: TextStyle(
|
||||||
color: PaletteDark.deepVioletBlue, // switch background (settings page)
|
color: PaletteDark.deepVioletBlue, // switch background (settings page)
|
||||||
|
backgroundColor: Colors.white, // icon color on support page (moonpay, github)
|
||||||
decorationColor: PaletteDark.lightBlueGrey // hint text (exchange page)
|
decorationColor: PaletteDark.lightBlueGrey // hint text (exchange page)
|
||||||
),
|
),
|
||||||
body1: TextStyle(
|
body1: TextStyle(
|
||||||
|
|
|
@ -113,6 +113,7 @@ class LightTheme extends ThemeBase {
|
||||||
),
|
),
|
||||||
display4: TextStyle(
|
display4: TextStyle(
|
||||||
color: Palette.darkBlueCraiola, // template title (send page)
|
color: Palette.darkBlueCraiola, // template title (send page)
|
||||||
|
backgroundColor: Colors.black, // icon color on order row (moonpay)
|
||||||
decorationColor: Palette.niagara // receive amount text (exchange page)
|
decorationColor: Palette.niagara // receive amount text (exchange page)
|
||||||
),
|
),
|
||||||
subtitle: TextStyle(
|
subtitle: TextStyle(
|
||||||
|
@ -178,6 +179,7 @@ class LightTheme extends ThemeBase {
|
||||||
),
|
),
|
||||||
display4: TextStyle(
|
display4: TextStyle(
|
||||||
color: Palette.darkGray, // switch background (settings page)
|
color: Palette.darkGray, // switch background (settings page)
|
||||||
|
backgroundColor: Colors.black, // icon color on support page (moonpay, github)
|
||||||
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
|
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
|
||||||
),
|
),
|
||||||
body1: TextStyle(
|
body1: TextStyle(
|
||||||
|
|
|
@ -8,11 +8,11 @@ class LinkListItem extends SettingsListItem {
|
||||||
@required this.link,
|
@required this.link,
|
||||||
@required this.linkTitle,
|
@required this.linkTitle,
|
||||||
this.icon,
|
this.icon,
|
||||||
this.iconColor})
|
this.hasIconColor = false})
|
||||||
: super(title);
|
: super(title);
|
||||||
|
|
||||||
final String icon;
|
final String icon;
|
||||||
final String link;
|
final String link;
|
||||||
final String linkTitle;
|
final String linkTitle;
|
||||||
final Color iconColor;
|
final bool hasIconColor;
|
||||||
}
|
}
|
|
@ -6,9 +6,6 @@ import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:cake_wallet/di.dart';
|
|
||||||
import 'package:cake_wallet/store/settings_store.dart';
|
|
||||||
import 'package:cake_wallet/themes/theme_base.dart';
|
|
||||||
|
|
||||||
part 'support_view_model.g.dart';
|
part 'support_view_model.g.dart';
|
||||||
|
|
||||||
|
@ -16,11 +13,6 @@ class SupportViewModel = SupportViewModelBase with _$SupportViewModel;
|
||||||
|
|
||||||
abstract class SupportViewModelBase with Store {
|
abstract class SupportViewModelBase with Store {
|
||||||
SupportViewModelBase() {
|
SupportViewModelBase() {
|
||||||
final currentTheme = getIt.get<SettingsStore>().currentTheme;
|
|
||||||
final iconColor = currentTheme.type == ThemeType.dark
|
|
||||||
? Colors.white
|
|
||||||
: Colors.black;
|
|
||||||
|
|
||||||
items = [
|
items = [
|
||||||
RegularListItem(
|
RegularListItem(
|
||||||
title: S.current.faq,
|
title: S.current.faq,
|
||||||
|
@ -39,7 +31,7 @@ abstract class SupportViewModelBase with Store {
|
||||||
LinkListItem(
|
LinkListItem(
|
||||||
title: 'GitHub',
|
title: 'GitHub',
|
||||||
icon: 'assets/images/github.png',
|
icon: 'assets/images/github.png',
|
||||||
iconColor: iconColor,
|
hasIconColor: true,
|
||||||
linkTitle: S.current.apk_update,
|
linkTitle: S.current.apk_update,
|
||||||
link: 'https://github.com/cake-tech/cake_wallet/releases'),
|
link: 'https://github.com/cake-tech/cake_wallet/releases'),
|
||||||
LinkListItem(
|
LinkListItem(
|
||||||
|
@ -65,7 +57,7 @@ abstract class SupportViewModelBase with Store {
|
||||||
LinkListItem(
|
LinkListItem(
|
||||||
title: 'MoonPay',
|
title: 'MoonPay',
|
||||||
icon: 'assets/images/moonpay.png',
|
icon: 'assets/images/moonpay.png',
|
||||||
iconColor: iconColor,
|
hasIconColor: true,
|
||||||
linkTitle: S.current.submit_request,
|
linkTitle: S.current.submit_request,
|
||||||
link: 'https://support.moonpay.com/hc/en-gb/requests/new')
|
link: 'https://support.moonpay.com/hc/en-gb/requests/new')
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue