feat(ui): refine club, packs, and download flows
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
export const COIN_PACK_SECTION_TITLE = 'Achat de crédits'
|
||||
|
||||
export const COIN_PACK_DETAILS = {
|
||||
starter: {
|
||||
label: 'Amateur',
|
||||
creditsDisplay: '30 crédits',
|
||||
priceDisplay: '4,99€',
|
||||
disclaimer: 'Téléchargement gratuit de tes créations',
|
||||
},
|
||||
pro: {
|
||||
label: 'Pro',
|
||||
creditsDisplay: '100 crédits',
|
||||
priceDisplay: '9,99€',
|
||||
popular: true,
|
||||
disclaimer: 'Téléchargement gratuit de tes créations',
|
||||
},
|
||||
premium: {
|
||||
label: 'Engagé',
|
||||
creditsDisplay: '150 crédits',
|
||||
priceDisplay: '14,99€',
|
||||
disclaimer: 'Téléchargement gratuit de tes créations',
|
||||
},
|
||||
}
|
||||
|
||||
export const getCoinPackKey = (pack) => {
|
||||
const directKey = (pack?.coinPackKey || '').toString().trim().toLowerCase()
|
||||
const name = (pack?.name || '').toString().trim().toLowerCase()
|
||||
|
||||
if (directKey === 'starter') {
|
||||
return 'starter'
|
||||
}
|
||||
|
||||
if (directKey === 'pro' || directKey === 'medium') {
|
||||
return 'pro'
|
||||
}
|
||||
|
||||
if (directKey === 'premium' || directKey === 'creator') {
|
||||
return 'premium'
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (name.includes('starter') || name.includes('amateur')) {
|
||||
return 'starter'
|
||||
}
|
||||
|
||||
if (name.includes('medium') || name.includes('pro')) {
|
||||
return 'pro'
|
||||
}
|
||||
|
||||
if (
|
||||
name.includes('premium') ||
|
||||
name.includes('prenium') ||
|
||||
name.includes('creator') ||
|
||||
name.includes('engage')
|
||||
) {
|
||||
return 'premium'
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user