<commit_before>import React from 'react';
import {
    PaymentMethodsSection,
    InvoicesSection,
    BillingSection,
    SettingsPropsShared,
    GiftCodeSection,
    CreditsSection,
} from 'react-components';
import { c } from 'ttag';
import { PERMISSIONS } from 'proton-shared/lib/constants';
import isTruthy from 'proton-shared/lib/helpers/isTruthy';

import PrivateMainSettingsAreaWithPermissions from '../../components/PrivateMainSettingsAreaWithPermissions';

const { UPGRADER, NOT_SUB_USER, PAID } = PERMISSIONS;

export const getPaymentPage = () => {
    return {
        text: c('Title').t`Payment`,
        to: '/payment',
        icon: 'payments-type-card',
        permissions: [UPGRADER, NOT_SUB_USER],
        subsections: [
            {
                text: c('Title').t`Billing details`,
                id: 'billing',
                permissions: [PAID],
            },
            {
                text: c('Title').t`Payment methods`,
                id: 'payment-methods',
            },
            {
                text: c('Title').t`Credits`,
                id: 'credits',
                permissions: [PAID],
            },
            {
                text: c('Title').t`Gift code`,
                id: 'gift-code',
                permissions: [PAID],
            },
            {
                text: c('Title').t`Invoices`,
                id: 'invoices',
            },
        ].filter(isTruthy),
    };
};

const AccountPaymentSettings = ({ location, setActiveSection }: SettingsPropsShared) => {
    return (
        <PrivateMainSettingsAreaWithPermissions
            location={location}
            config={getPaymentPage()}
            setActiveSection={setActiveSection}
        >
            <BillingSection />
            <PaymentMethodsSection />
            <CreditsSection />
            <GiftCodeSection />
            <InvoicesSection />
        </PrivateMainSettingsAreaWithPermissions>
    );
};

export default AccountPaymentSettings;<commit_msg>Remove permissions from GiftCode & Credits<commit_after>import React from 'react';
import {
    PaymentMethodsSection,
    InvoicesSection,
    BillingSection,
    SettingsPropsShared,
    GiftCodeSection,
    CreditsSection,
} from 'react-components';
import { c } from 'ttag';
import { PERMISSIONS } from 'proton-shared/lib/constants';
import isTruthy from 'proton-shared/lib/helpers/isTruthy';

import PrivateMainSettingsAreaWithPermissions from '../../components/PrivateMainSettingsAreaWithPermissions';

const { UPGRADER, NOT_SUB_USER, PAID } = PERMISSIONS;

export const getPaymentPage = () => {
    return {
        text: c('Title').t`Payment`,
        to: '/payment',
        icon: 'payments-type-card',
        permissions: [UPGRADER, NOT_SUB_USER],
        subsections: [
            {
                text: c('Title').t`Billing details`,
                id: 'billing',
                permissions: [PAID],
            },
            {
                text: c('Title').t`Payment methods`,
                id: 'payment-methods',
            },
            {
                text: c('Title').t`Credits`,
                id: 'credits',
            },
            {
                text: c('Title').t`Gift code`,
                id: 'gift-code',
            },
            {
                text: c('Title').t`Invoices`,
                id: 'invoices',
            },
        ].filter(isTruthy),
    };
};

const AccountPaymentSettings = ({ location, setActiveSection }: SettingsPropsShared) => {
    return (
        <PrivateMainSettingsAreaWithPermissions
            location={location}
            config={getPaymentPage()}
            setActiveSection={setActiveSection}
    >
            <BillingSection />
            <PaymentMethodsSection />
            <CreditsSection />
            <GiftCodeSection />
            <InvoicesSection />
        </PrivateMainSettingsAreaWithPermissions>
    );
};

export default AccountPaymentSettings;
{'fraction_non_alphanumeric': 0.11870412553783852, 'fraction_numerical': 0.0, 'mean_word_length': 1.8472622478386167, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2278837', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1064, 'n_words': 193}