Профиль: блок истории игр с переключателями режима и подробности
В «Аккаунте» появился блок «История игр» с двумя тумблерами — «Только лучшая партия» и «Подробные карточки»; выбор уходит в профиль, поэтому переживает перезаход и другое устройство. Новый компонент MatchHistory: подробный режим переиспользует список партий группы (MatchListView со всеми участниками), компактный рисует строку с результатом самого игрока — место, фракция, дата и длительность. Публичный профиль показывает ту же историю в режиме владельца и без контролов: страница намеренно read-only. schema.d.ts пересобран с живого бэкенда (npm run gen:api). #1 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ export const qk = {
|
||||
factions: ["factions"] as const,
|
||||
myStats: ["myStats"] as const,
|
||||
publicProfile: (id: number) => ["publicProfile", id] as const,
|
||||
userMatches: (id: number) => ["userMatches", id] as const,
|
||||
userSearch: (q: string, limit: number) => ["userSearch", q, limit] as const,
|
||||
groups: ["groups"] as const,
|
||||
group: (id: number) => ["group", id] as const,
|
||||
|
||||
Vendored
+102
@@ -174,6 +174,26 @@ export interface paths {
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/users/{user_id}/matches": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
/**
|
||||
* User Matches
|
||||
* @description История партий игрока. Режим — витрина владельца профиля: её видят и гости.
|
||||
*/
|
||||
get: operations["user_matches_api_users__user_id__matches_get"];
|
||||
put?: never;
|
||||
post?: never;
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/users/me/stats": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
@@ -1599,6 +1619,30 @@ export interface components {
|
||||
/** Faction Id */
|
||||
faction_id?: number | null;
|
||||
};
|
||||
/**
|
||||
* MatchHistory
|
||||
* @description История партий игрока плюс настройки витрины его профиля.
|
||||
*
|
||||
* Настройки едут вместе со списком, чтобы гость отрисовал историю ровно так,
|
||||
* как выбрал её владелец, не делая второго запроса за профилем.
|
||||
*/
|
||||
MatchHistory: {
|
||||
/**
|
||||
* Items
|
||||
* @default []
|
||||
*/
|
||||
items: components["schemas"]["MatchListItem"][];
|
||||
/** Total */
|
||||
total: number;
|
||||
/** Limit */
|
||||
limit: number;
|
||||
/** Offset */
|
||||
offset: number;
|
||||
/** Mode */
|
||||
mode: string;
|
||||
/** Detail */
|
||||
detail: string;
|
||||
};
|
||||
/** MatchList */
|
||||
MatchList: {
|
||||
/**
|
||||
@@ -1765,6 +1809,16 @@ export interface components {
|
||||
avatar_url?: string | null;
|
||||
/** Favorite Faction Id */
|
||||
favorite_faction_id?: number | null;
|
||||
/**
|
||||
* History Mode
|
||||
* @default all
|
||||
*/
|
||||
history_mode: string;
|
||||
/**
|
||||
* History Detail
|
||||
* @default compact
|
||||
*/
|
||||
history_detail: string;
|
||||
/**
|
||||
* Groups
|
||||
* @default []
|
||||
@@ -1904,6 +1958,10 @@ export interface components {
|
||||
bio?: string | null;
|
||||
/** Favorite Faction Id */
|
||||
favorite_faction_id?: number | null;
|
||||
/** History Mode */
|
||||
history_mode?: string | null;
|
||||
/** History Detail */
|
||||
history_detail?: string | null;
|
||||
};
|
||||
/** PublicProfile */
|
||||
PublicProfile: {
|
||||
@@ -2012,6 +2070,16 @@ export interface components {
|
||||
avatar_url?: string | null;
|
||||
/** Favorite Faction Id */
|
||||
favorite_faction_id?: number | null;
|
||||
/**
|
||||
* History Mode
|
||||
* @default all
|
||||
*/
|
||||
history_mode: string;
|
||||
/**
|
||||
* History Detail
|
||||
* @default compact
|
||||
*/
|
||||
history_detail: string;
|
||||
};
|
||||
/**
|
||||
* UserSuggestion
|
||||
@@ -2354,6 +2422,40 @@ export interface operations {
|
||||
};
|
||||
};
|
||||
};
|
||||
user_matches_api_users__user_id__matches_get: {
|
||||
parameters: {
|
||||
query?: {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
header?: never;
|
||||
path: {
|
||||
user_id: number;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody?: never;
|
||||
responses: {
|
||||
/** @description Successful Response */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["MatchHistory"];
|
||||
};
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
my_stats_api_users_me_stats_get: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
|
||||
Reference in New Issue
Block a user