UI improvements

This commit is contained in:
Ali 2022-04-05 20:04:43 +04:00
parent c462b92952
commit fb0c10e29f
7 changed files with 16 additions and 2 deletions

View File

@ -18,5 +18,6 @@ typedef NS_ENUM(NSInteger, STPCardBrand) {
STPCardBrandDiscover,
STPCardBrandJCB,
STPCardBrandDinersClub,
STPCardBrandOther,
STPCardBrandUnknown,
};

View File

@ -19,6 +19,7 @@
case STPCardBrandMasterCard: return @"MasterCard";
case STPCardBrandUnknown: return @"Unknown";
case STPCardBrandVisa: return @"Visa";
case STPCardBrandOther: return @"Other";
}
}

View File

@ -66,7 +66,7 @@
@[@"492937", @"492937", @13, @(STPCardBrandVisa)],
@[@"492939", @"492939", @13, @(STPCardBrandVisa)],
@[@"492960", @"492960", @13, @(STPCardBrandVisa)],
@[@"2", @"2", @16, @(STPCardBrandVisa)],
@[@"2", @"2", @16, @(STPCardBrandOther)],
];
NSMutableArray *binRanges = [NSMutableArray array];
for (NSArray *range in ranges) {

View File

@ -64,6 +64,8 @@
return STPCardBrandJCB;
} else if ([brand isEqualToString:@"diners club"]) {
return STPCardBrandDinersClub;
} else if ([brand isEqualToString:@"other"]) {
return STPCardBrandOther;
} else {
return STPCardBrandUnknown;
}
@ -114,6 +116,8 @@
return @"MasterCard";
case STPCardBrandVisa:
return @"Visa";
case STPCardBrandOther:
return @"Other";
default:
return @"Unknown";
}

View File

@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
* An icon representing Visa.
*/
+ (UIImage *)visaCardImage;
+ (UIImage *)otherCardImage;
/**
* An icon to use when the type of the card is unknown.

View File

@ -48,6 +48,10 @@
return [self brandImageForCardBrand:STPCardBrandUnknown];
}
+ (UIImage *)otherCardCardImage {
return [self brandImageForCardBrand:STPCardBrandUnknown];
}
+ (UIImage *)brandImageForCardBrand:(STPCardBrand)brand {
return [self brandImageForCardBrand:brand template:NO];
}
@ -140,6 +144,9 @@
break;
case STPCardBrandVisa:
imageName = shouldUseTemplate ? @"stp_card_visa_template" : @"stp_card_visa";
case STPCardBrandOther:
shouldUseTemplate = YES;
imageName = @"stp_card_placeholder_template";
break;
}
UIImage *image = [self safeImageNamed:imageName

View File

@ -377,7 +377,7 @@ final class ChatPinnedMessageTitlePanelNode: ChatTitleAccessoryPanelNode {
self.listButton.layer.animateScale(from: 1.0, to: 0.01, duration: 0.2, removeOnCompletion: false)
}
} else {
self.listButton.isHidden = !displayCloseButton
self.listButton.isHidden = !displayListButton
self.listButton.layer.removeAllAnimations()
}
}