Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

hide promocode entering button for ios

ammarahm-ed268882c9608d
diff --git a/apps/mobile/src/components/Premium/pricingplans.js b/apps/mobile/src/components/Premium/pricingplans.js
index 37f9f8417..fe56d7688 100644
--- a/apps/mobile/src/components/Premium/pricingplans.js
+++ b/apps/mobile/src/components/Premium/pricingplans.js
@@ -68,9 +68,11 @@ export const PricingPlans = ({
)
};
setOffers(offers);
+
if (promo?.promoCode) {
getPromo(promo?.promoCode);
}
+
setProducts(products);
}
setLoading(false);
@@ -247,47 +249,49 @@ export const PricingPlans = ({
/>
</View>
- <Button
- height={35}
- style={{
- marginTop: 10
- }}
- onPress={() => {
- presentDialog({
- context: 'local',
- input: true,
- inputPlaceholder: 'Enter code',
- positiveText: 'Apply',
- positivePress: async value => {
- if (!value) return;
- console.log(value);
- eSendEvent(eCloseSimpleDialog);
- setBuying(true);
- try {
- if (!(await getPromo(value)))
- throw new Error('Error applying promo code');
- ToastEvent.show({
- heading: 'Discount applied!',
- type: 'success',
- context: 'local'
- });
- setBuying(false);
- } catch (e) {
- setBuying(false);
- ToastEvent.show({
- heading: 'Promo code invalid or expired',
- message: e.message,
- type: 'error',
- context: 'local'
- });
- }
- },
- title: 'Have a promo code?',
- paragraph: 'Enter your promo code to get a special discount.'
- });
- }}
- title="I have a promo code"
- />
+ {Platform.OS !== 'ios' ? (
+ <Button
+ height={35}
+ style={{
+ marginTop: 10
+ }}
+ onPress={() => {
+ presentDialog({
+ context: 'local',
+ input: true,
+ inputPlaceholder: 'Enter code',
+ positiveText: 'Apply',
+ positivePress: async value => {
+ if (!value) return;
+ console.log(value);
+ eSendEvent(eCloseSimpleDialog);
+ setBuying(true);
+ try {
+ if (!(await getPromo(value)))
+ throw new Error('Error applying promo code');
+ ToastEvent.show({
+ heading: 'Discount applied!',
+ type: 'success',
+ context: 'local'
+ });
+ setBuying(false);
+ } catch (e) {
+ setBuying(false);
+ ToastEvent.show({
+ heading: 'Promo code invalid or expired',
+ message: e.message,
+ type: 'error',
+ context: 'local'
+ });
+ }
+ },
+ title: 'Have a promo code?',
+ paragraph: 'Enter your promo code to get a special discount.'
+ });
+ }}
+ title="I have a promo code"
+ />
+ ) : null}
</>
) : (
<View>