Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/assets/lang/de/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,20 @@
{
"name": "Kommt bald",
"features": [
{
"id": "upload_empty_files",
"name": "Leere Dateien hochladen",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "Papierkorb-Limits",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "Dateiversionierung",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
Expand Down
16 changes: 13 additions & 3 deletions src/assets/lang/en/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
},
{
"id": "Dark_Web_Monitor",
"name": "File Versioning",
"avalability": { "Essential": false, "Premium": false, "Ultimate": true }
"name": "Dark Web Monitor",
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "cli_webdav_support",
Expand All @@ -213,10 +213,20 @@
{
"name": "Comming soon",
"features": [
{
"id": "upload_empty_files",
"name": "Upload empty files",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "Trash limits",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "File Versioning",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
Expand Down
14 changes: 12 additions & 2 deletions src/assets/lang/es/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,20 @@
"name": "Próximamente",
"features": [
{
"id": "file_versioning",
"name": "Control de versiones ",
"id": "upload_empty_files",
"name": "Subir archivos vacíos",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "Límites de la papelera",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "Control de versiones",
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
"name": "Mail",
Expand Down
14 changes: 12 additions & 2 deletions src/assets/lang/fr/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,20 @@
"name": "Bientôt disponible",
"features": [
{
"id": "file_versioning",
"name": "Gestion des versions de fichiers",
"id": "upload_empty_files",
"name": "Télécharger des fichiers vides",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "Limites de la corbeille",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "Versionnage de fichiers",
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
"name": "Mail",
Expand Down
14 changes: 12 additions & 2 deletions src/assets/lang/it/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,20 @@
"name": "Prossimamente",
"features": [
{
"id": "file_versioning",
"name": "Versionamento dei file",
"id": "upload_empty_files",
"name": "Carica file vuoti",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "Limiti del cestino",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "Versionamento file",
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
"name": "Mail",
Expand Down
14 changes: 12 additions & 2 deletions src/assets/lang/ru/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,20 @@
"name": "Скоро",
"features": [
{
"id": "file_versioning",
"name": "Управление версиями файлов",
"id": "upload_empty_files",
"name": "Загрузка пустых файлов",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "Лимиты корзины",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "Версионность файлов",
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
"name": "Mail",
Expand Down
12 changes: 11 additions & 1 deletion src/assets/lang/zh-tw/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,20 @@
{
"name": "即將推出",
"features": [
{
"id": "upload_empty_files",
"name": "上傳空檔案",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "回收筒限制",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "檔案版本控制",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
Expand Down
12 changes: 11 additions & 1 deletion src/assets/lang/zh/pricing.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,20 @@
{
"name": "即将推出",
"features": [
{
"id": "upload_empty_files",
"name": "上传空文件",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "trash_limits",
"name": "回收站限制",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
},
{
"id": "file_versioning",
"name": "文件版本控制",
"avalability": { "Essential": true, "Premium": true, "Ultimate": true }
"avalability": { "Essential": false, "Premium": true, "Ultimate": true }
},
{
"id": "mail",
Expand Down
18 changes: 10 additions & 8 deletions src/components/pricing/ComparisonTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { PricingText } from '@/assets/types/pricing';
import { CheckCircle, XCircle } from '@phosphor-icons/react';
import { Interval, ProductsDataProps } from '@/services/stripe.service';
Expand Down Expand Up @@ -86,30 +88,30 @@ export default function ComparisonTableSection({
return category.features.every((feature: any) => Object.values(feature.avalability).filter(Boolean).length === 1);
};

const isLastColumn = (index: number) => index === textContent.plans.length - 1;
const isRecommendedPlan = (index: number) => index === textContent.plans.length - 2;
const isSecondToLastColumn = (index: number) => index === textContent.plans.length - 2;
const isLastCategory = (index: number) => index === textContent.categories.length - 1;
const isLastFeature = (categoryFeatures: any[], featureIndex: number) => featureIndex === categoryFeatures.length - 1;

const getHeaderStyles = (planIndex: number) => {
return `items-start p-6 text-start ${
isLastColumn(planIndex)
isRecommendedPlan(planIndex)
? 'flex rounded-t-2xl ring-[1px] ring-neutral-25 bg-neutral-17'
: 'bg-neutral-16 ring-[1px] ring-neutral-25'
}`;
};

const getButtonStyles = (planIndex: number) => {
return `${
isLastColumn(planIndex)
isRecommendedPlan(planIndex)
? 'bg-primary text-white hover:bg-primary-dark'
: 'border-primary bg-transparent text-primary hover:bg-gray-1'
} flex h-[48px] w-[270px] items-center justify-center rounded-md border-[1.5px] lg:w-[340px]`;
};

const getCategoryRowStyles = (planIndex: number, categoryIndex: number) => {
const getCategoryRowStyles = (planIndex: number) => {
return `h-[72px] ${
isLastColumn(planIndex)
isRecommendedPlan(planIndex)
? `border-[1px] border-neutral-25 bg-neutral-17 shadow-lg`
: 'border-y-[1px] border-neutral-25 p-6 text-xl font-medium text-gray-95'
}`;
Expand All @@ -118,7 +120,7 @@ export default function ComparisonTableSection({
const getSpecialFeatureStyles = (planIndex: number, categoryIndex: number) => {
let baseStyles = 'px-6 py-4';

if (isLastColumn(planIndex)) {
if (isRecommendedPlan(planIndex)) {
baseStyles += ' bg-neutral-17 outline outline-1 outline-neutral-25';
if (isLastCategory(categoryIndex)) {
baseStyles += 'outline outline-1 outline-neutral-25 rounded-br-16';
Expand All @@ -133,7 +135,7 @@ export default function ComparisonTableSection({
const getRegularFeatureStyles = (planIndex: number, categoryIndex: number, category: any, featureIndex: number) => {
let baseStyles = 'px-6 py-4';

if (isLastColumn(planIndex)) {
if (isRecommendedPlan(planIndex)) {
baseStyles += 'ring-[1px] ring-neutral-25 bg-neutral-17 shadow-lg outline outline-1 outline-neutral-25';
if (isLastCategory(categoryIndex) && isLastFeature(category.features, featureIndex)) {
baseStyles += ' rounded-b-16 outline outline-1 outline-neutral-25';
Expand Down Expand Up @@ -256,7 +258,7 @@ export default function ComparisonTableSection({
<>
<tr key={`category-${categoryIndex}`}>
{textContent.plans.map((plan, planIndex) => (
<td key={`category-${plan.id}`} className={getCategoryRowStyles(planIndex, categoryIndex)}>
<td key={`category-${plan.id}`} className={getCategoryRowStyles(planIndex)}>
{planIndex === 0 ? category.name : undefined}
</td>
))}
Expand Down
Loading