Skip to content

Commit 993fa14

Browse files
authored
Merge pull request #22 from teacoder-team/dev
Dev
2 parents ef3f0a0 + 77691d7 commit 993fa14

6 files changed

Lines changed: 95 additions & 72 deletions

File tree

src/app/(public)/premium/page.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Metadata } from 'next'
2-
import { headers } from 'next/headers'
32

43
import { Premium } from '@/src/components/premium/premium'
54

@@ -8,10 +7,5 @@ export const metadata: Metadata = {
87
}
98

109
export default async function PremiumPage() {
11-
const headersStore = await headers()
12-
13-
const allHeaders = Object.fromEntries(headersStore.entries())
14-
console.log(allHeaders)
15-
1610
return <Premium />
1711
}

src/components/icons/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './sbp-icon'
2+
export * from './yoomoney-icon'

src/components/premium/faq.tsx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,36 @@ import {
1212
const faqs = [
1313
{
1414
question: 'Как можно оплатить подписку?',
15-
answer: 'Оплата возможна при помощи банковских карт РФ и СБП.'
15+
answer: 'Оплата возможна при помощи банковских карт, СБП или криптовалюты.'
1616
},
1717
{
1818
question: 'Можно ли оплатить подписку за пределами РФ?',
19-
answer: 'Пока оплатить подписку за пределами России нельзя.'
19+
answer: (
20+
<>
21+
<p>
22+
Да, вы можете оплатить подписку за пределами России с
23+
помощью криптовалюты (BTC, USDT, TON), кошелька ЮMoney и
24+
банковскими картами. Ниже подробности для разных вариантов:
25+
</p>
26+
<ul className='mt-2 list-inside list-disc space-y-1'>
27+
<li>
28+
Принимаются карты МИР, выпущенные в следующих странах:
29+
Беларусь, Казахстан, Армения, Южная Осетия, Таджикистан,
30+
Азербайджан, Абхазия.
31+
</li>
32+
<li>
33+
Карты таких платёжных систем: Белкарт (Беларусь), АПРА
34+
(Абхазия), Express Pay и Корти Милли (Таджикистан).
35+
</li>
36+
<li>
37+
Платежи с карт Visa, MasterCard, UnionPay, American
38+
Express принимаются только если карта была выпущена
39+
российским банком; оплата по иностранной карте не
40+
пройдет.
41+
</li>
42+
</ul>
43+
</>
44+
)
2045
},
2146
{
2247
question: 'Как и когда можно отменить подписку?',

src/components/premium/payment-methods.tsx

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,12 @@
1-
import { BitcoinIcon, CreditCardIcon, StarIcon } from 'lucide-react'
2-
import { ComponentType, SVGProps } from 'react'
31
import { Control } from 'react-hook-form'
42

5-
import { SbpIcon } from '../icons/sbp-icon'
6-
import { YoomoneyIcon } from '../icons/yoomoney-icon'
7-
83
import type { PaymentFormValues } from './premium'
9-
import { InitPaymentRequestMethod } from '@/src/api/generated'
104
import { FormControl, FormField, FormItem } from '@/src/components/ui/form'
115
import { Label } from '@/src/components/ui/label'
126
import { RadioGroup, RadioGroupItem } from '@/src/components/ui/radio-group'
7+
import { paymentMethods } from '@/src/constants'
138
import { cn } from '@/src/lib/utils'
149

15-
interface PaymentMethod {
16-
id: InitPaymentRequestMethod
17-
name: string
18-
description: string
19-
icon: ComponentType<SVGProps<SVGSVGElement>>
20-
textColor: string
21-
bgColor: string
22-
isAllowed?: boolean
23-
}
24-
25-
const paymentMethods: PaymentMethod[] = [
26-
{
27-
id: InitPaymentRequestMethod.BANK_CARD,
28-
name: 'Банковская карта',
29-
description: 'Оплата кредитной или дебетовой картой',
30-
icon: CreditCardIcon,
31-
textColor: 'text-blue-600',
32-
bgColor: 'bg-blue-100',
33-
isAllowed: true
34-
},
35-
{
36-
id: InitPaymentRequestMethod.SBP,
37-
name: 'СБП',
38-
description: 'Оплата через Систему быстрых платежей',
39-
icon: SbpIcon,
40-
textColor: 'text-blue-600',
41-
bgColor: 'bg-blue-100',
42-
isAllowed: true
43-
},
44-
// {
45-
// id: InitPaymentRequestMethod.YOOMONEY,
46-
// name: 'ЮMoney',
47-
// description: 'Оплата через кошелек ЮMoney',
48-
// icon: YoomoneyIcon,
49-
// textColor: 'text-blue-600',
50-
// bgColor: 'bg-blue-100',
51-
// isAllowed: false
52-
// },
53-
// {
54-
// id: InitPaymentRequestMethod.STARS,
55-
// name: 'Telegram Stars',
56-
// description: 'Оплата подписки через звёзды Telegram',
57-
// icon: StarIcon,
58-
// textColor: 'text-blue-600',
59-
// bgColor: 'bg-blue-100',
60-
// isAllowed: true
61-
// }
62-
{
63-
id: 'CRYPTO',
64-
name: 'Криптовалюта',
65-
description: 'Оплата с помощью BTC, USDT, TON',
66-
icon: BitcoinIcon,
67-
textColor: 'text-blue-600',
68-
bgColor: 'bg-blue-100',
69-
isAllowed: false
70-
}
71-
]
72-
7310
interface PaymentMethodsProps {
7411
control: Control<PaymentFormValues>
7512
}

src/constants/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './app'
2+
export * from './payment-methods'
23
export * from './seo'
34
export * from './routes'

src/constants/payment-methods.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { BitcoinIcon, CreditCardIcon } from 'lucide-react'
2+
import { ComponentType, SVGProps } from 'react'
3+
4+
import { SbpIcon } from '../components/icons'
5+
6+
import { InitPaymentRequestMethod } from '@/src/api/generated'
7+
8+
interface PaymentMethod {
9+
id: InitPaymentRequestMethod
10+
name: string
11+
description: string
12+
icon: ComponentType<SVGProps<SVGSVGElement>>
13+
textColor: string
14+
bgColor: string
15+
isAllowed?: boolean
16+
}
17+
18+
export const paymentMethods: PaymentMethod[] = [
19+
{
20+
id: InitPaymentRequestMethod.BANK_CARD,
21+
name: 'Банковская карта',
22+
description: 'Оплата кредитной или дебетовой картой',
23+
icon: CreditCardIcon,
24+
textColor: 'text-blue-600',
25+
bgColor: 'bg-blue-100',
26+
isAllowed: true
27+
},
28+
{
29+
id: InitPaymentRequestMethod.SBP,
30+
name: 'СБП',
31+
description: 'Оплата через Систему быстрых платежей',
32+
icon: SbpIcon,
33+
textColor: 'text-blue-600',
34+
bgColor: 'bg-blue-100',
35+
isAllowed: true
36+
},
37+
// {
38+
// id: InitPaymentRequestMethod.YOOMONEY,
39+
// name: 'ЮMoney',
40+
// description: 'Оплата через кошелек ЮMoney',
41+
// icon: YoomoneyIcon,
42+
// textColor: 'text-blue-600',
43+
// bgColor: 'bg-blue-100',
44+
// isAllowed: false
45+
// },
46+
// {
47+
// id: InitPaymentRequestMethod.STARS,
48+
// name: 'Telegram Stars',
49+
// description: 'Оплата подписки через звёзды Telegram',
50+
// icon: StarIcon,
51+
// textColor: 'text-blue-600',
52+
// bgColor: 'bg-blue-100',
53+
// isAllowed: true
54+
// }
55+
{
56+
id: 'CRYPTO',
57+
name: 'Криптовалюта',
58+
description: 'Оплата с помощью BTC, USDT, TON',
59+
icon: BitcoinIcon,
60+
textColor: 'text-blue-600',
61+
bgColor: 'bg-blue-100',
62+
isAllowed: true
63+
}
64+
]

0 commit comments

Comments
 (0)