mirror of
https://github.com/StepanovPlaton/AboutMe.git
synced 2026-04-03 20:30:49 +04:00
fixes
This commit is contained in:
@@ -40,7 +40,7 @@ collections:
|
||||
- { label: "Image", name: "image", widget: "image", required: false }
|
||||
- { label: "Category", name: "category", widget: "select", options: ["actual","history","other"] }
|
||||
- { label: "Tech Stack", name: "techStack", widget: "list", default: [] }
|
||||
- { label: "Status", name: "status", widget: "select", options: ["completed","in-progress","planned"] }
|
||||
- { label: "Status", name: "status", widget: "select", options: ["completed","in-progress","planned","paused"] }
|
||||
- { label: "Live Demo", name: "liveDemo", widget: "string", required: false }
|
||||
- { label: "Source Code", name: "sourceCode", widget: "string", required: false }
|
||||
- { label: "Start Date", name: "startDate", widget: "datetime" }
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface Props {
|
||||
image?: string;
|
||||
category: string;
|
||||
techStack: string[];
|
||||
status: "completed" | "in-progress" | "planned";
|
||||
status: "completed" | "in-progress" | "planned" | "paused";
|
||||
demoUrl?: string;
|
||||
sourceUrl?: string;
|
||||
startDate: string;
|
||||
@@ -40,6 +40,8 @@ const getStatusStyle = (status: string) => {
|
||||
return "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400";
|
||||
case "planned":
|
||||
return "bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400";
|
||||
case "paused":
|
||||
return "bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400";
|
||||
default:
|
||||
return "bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400";
|
||||
}
|
||||
@@ -54,6 +56,8 @@ const getStatusText = (status: string) => {
|
||||
return i18n(I18nKey.projectsInProgress);
|
||||
case "planned":
|
||||
return i18n(I18nKey.projectsPlanned);
|
||||
case "paused":
|
||||
return i18n(I18nKey.projectsPaused);
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -81,12 +81,14 @@ enum I18nKey {
|
||||
projectStatusCompleted = "projectStatusCompleted",
|
||||
projectStatusInProgress = "projectStatusInProgress",
|
||||
projectStatusPlanned = "projectStatusPlanned",
|
||||
projectStatusPaused = "projectStatusPaused",
|
||||
projectsTotal = "projectsTotal",
|
||||
projectsCompleted = "projectsCompleted",
|
||||
projectsInProgress = "projectsInProgress",
|
||||
projectsTechStack = "projectsTechStack",
|
||||
projectsFeatured = "projectsFeatured",
|
||||
projectsPlanned = "projectsPlanned",
|
||||
projectsPaused = "projectsPaused",
|
||||
projectsDemo = "projectsDemo",
|
||||
projectsSource = "projectsSource",
|
||||
|
||||
|
||||
@@ -85,12 +85,14 @@ export const en: Translation = {
|
||||
[Key.projectStatusCompleted]: "Completed",
|
||||
[Key.projectStatusInProgress]: "In Progress",
|
||||
[Key.projectStatusPlanned]: "Planned",
|
||||
[Key.projectStatusPaused]: "Paused",
|
||||
[Key.projectsTotal]: "Total Projects",
|
||||
[Key.projectsCompleted]: "Completed",
|
||||
[Key.projectsInProgress]: "In Progress",
|
||||
[Key.projectsTechStack]: "Tech Stack Statistics",
|
||||
[Key.projectsFeatured]: "Featured Projects",
|
||||
[Key.projectsPlanned]: "Planned",
|
||||
[Key.projectsPaused]: "Paused",
|
||||
[Key.projectsDemo]: "Live Demo",
|
||||
[Key.projectsSource]: "Source Code",
|
||||
|
||||
|
||||
@@ -85,12 +85,14 @@ export const ja: Translation = {
|
||||
[Key.projectStatusCompleted]: "完了",
|
||||
[Key.projectStatusInProgress]: "進行中",
|
||||
[Key.projectStatusPlanned]: "予定",
|
||||
[Key.projectStatusPaused]: "一時停止",
|
||||
[Key.projectsTotal]: "プロジェクト合計",
|
||||
[Key.projectsCompleted]: "完了",
|
||||
[Key.projectsInProgress]: "進行中",
|
||||
[Key.projectsTechStack]: "技術スタック統計",
|
||||
[Key.projectsFeatured]: "注目プロジェクト",
|
||||
[Key.projectsPlanned]: "予定",
|
||||
[Key.projectsPaused]: "一時停止",
|
||||
[Key.projectsDemo]: "ライブデモ",
|
||||
[Key.projectsSource]: "ソースコード",
|
||||
|
||||
|
||||
@@ -84,12 +84,14 @@ export const ru: Translation = {
|
||||
[Key.projectStatusCompleted]: "Завершён",
|
||||
[Key.projectStatusInProgress]: "В разработке",
|
||||
[Key.projectStatusPlanned]: "Запланирован",
|
||||
[Key.projectStatusPaused]: "Приостановлен",
|
||||
[Key.projectsTotal]: "Всего проектов",
|
||||
[Key.projectsCompleted]: "Завершён",
|
||||
[Key.projectsInProgress]: "В разработке",
|
||||
[Key.projectsTechStack]: "Статистика технологий",
|
||||
[Key.projectsFeatured]: "Сейчас я работаю над этим",
|
||||
[Key.projectsPlanned]: "Запланированных",
|
||||
[Key.projectsPaused]: "Приостановлен",
|
||||
[Key.projectsDemo]: "Демо",
|
||||
[Key.projectsSource]: "Исходный код",
|
||||
|
||||
|
||||
@@ -85,12 +85,14 @@ export const zh: Translation = {
|
||||
[Key.projectStatusCompleted]: "已完成",
|
||||
[Key.projectStatusInProgress]: "进行中",
|
||||
[Key.projectStatusPlanned]: "计划中",
|
||||
[Key.projectStatusPaused]: "已暂停",
|
||||
[Key.projectsTotal]: "项目总数",
|
||||
[Key.projectsCompleted]: "已完成",
|
||||
[Key.projectsInProgress]: "进行中",
|
||||
[Key.projectsTechStack]: "技术栈统计",
|
||||
[Key.projectsFeatured]: "精选项目",
|
||||
[Key.projectsPlanned]: "计划中",
|
||||
[Key.projectsPaused]: "已暂停",
|
||||
[Key.projectsDemo]: "在线演示",
|
||||
[Key.projectsSource]: "源代码",
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ export interface Project {
|
||||
image: string;
|
||||
category: "actual" | "history" | "other";
|
||||
techStack: string[];
|
||||
status: "completed" | "in-progress" | "planned";
|
||||
status: "completed" | "in-progress" | "planned" | "paused";
|
||||
demoUrl?: string;
|
||||
sourceUrl?: string;
|
||||
startDate: string;
|
||||
@@ -38,12 +38,14 @@ export const getProjectStats = () => {
|
||||
(p) => p.status === "in-progress",
|
||||
).length;
|
||||
const planned = projectsData.filter((p) => p.status === "planned").length;
|
||||
const paused = projectsData.filter((p) => p.status === "paused").length;
|
||||
return {
|
||||
total,
|
||||
byStatus: {
|
||||
completed,
|
||||
inProgress,
|
||||
planned,
|
||||
paused,
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -71,9 +73,40 @@ export const getFeaturedProjects = () => {
|
||||
|
||||
// Get all tech stacks
|
||||
export const getAllTechStack = () => {
|
||||
const techSet = new Set<string>();
|
||||
// Создаем Map для хранения информации о каждой технологии
|
||||
const techMap = new Map<string, { count: number; latestProjectDate: number }>();
|
||||
|
||||
// Подсчитываем упоминания и находим самую свежую дату проекта для каждой технологии
|
||||
projectsData.forEach((project) => {
|
||||
project.techStack.forEach((tech) => techSet.add(tech));
|
||||
const projectDate = new Date(project.startDate).getTime();
|
||||
project.techStack.forEach((tech) => {
|
||||
const existing = techMap.get(tech);
|
||||
if (existing) {
|
||||
existing.count++;
|
||||
// Обновляем дату, если текущий проект свежее
|
||||
if (projectDate > existing.latestProjectDate) {
|
||||
existing.latestProjectDate = projectDate;
|
||||
}
|
||||
} else {
|
||||
techMap.set(tech, { count: 1, latestProjectDate: projectDate });
|
||||
}
|
||||
});
|
||||
return Array.from(techSet).sort();
|
||||
});
|
||||
|
||||
// Преобразуем Map в массив и сортируем
|
||||
// Сначала по количеству упоминаний (по убыванию), затем по дате самого свежего проекта (по убыванию)
|
||||
return Array.from(techMap.entries())
|
||||
.sort((a, b) => {
|
||||
const [techA, dataA] = a;
|
||||
const [techB, dataB] = b;
|
||||
|
||||
// Сначала сортируем по количеству упоминаний (по убыванию)
|
||||
if (dataB.count !== dataA.count) {
|
||||
return dataB.count - dataA.count;
|
||||
}
|
||||
|
||||
// Если количество одинаковое, сортируем по дате самого свежего проекта (по убыванию)
|
||||
return dataB.latestProjectDate - dataA.latestProjectDate;
|
||||
})
|
||||
.map(([tech]) => tech); // Возвращаем только названия технологий
|
||||
};
|
||||
Reference in New Issue
Block a user