feat: add stock pages and ticker navigation

Add stock search and detail pages with charts, dividends and shared event rows.

Use verified ticker links for portfolio names and logos, numeric dates and refreshed account cards.

Update the generated API contract.
This commit is contained in:
2026-09-10 21:23:41 +03:00
parent 0306526d33
commit 561222e468
56 changed files with 5051 additions and 190 deletions
+14 -1
View File
@@ -1,7 +1,20 @@
import { describe, expect, it } from "vitest";
import { formatMoney, instrumentLogoUrl } from "./display";
import {
formatDate,
formatMoney,
formatSnapshotTime,
instrumentLogoUrl,
} from "./display";
describe("shared display helpers", () => {
it("uses padded Russian dates and preserves the UTC date of timestamps", () => {
expect(formatDate("2027-09-10")).toBe("10.09.2027");
expect(formatDate("2024-02-29")).toBe("29.02.2024");
expect(formatDate("2027-09-10T00:30:00+03:00")).toBe("09.09.2027");
expect(formatSnapshotTime("2027-09-10T00:30:00+03:00")).toBe(
"09.09.2027, 21:30",
);
});
it("formats decimal strings without financial arithmetic", () => {
expect(formatMoney({ value: "-1234567.89", currency: "RUB" })).toBe(
"-1 234 567,89 ₽",
+17 -2
View File
@@ -15,9 +15,18 @@ function formatMoney(money: Money | null): string {
return `${formatDecimal(money.value)} ${money.currency === "RUB" ? "₽" : money.currency}`;
}
function formatDate(value: string): string {
return new Intl.DateTimeFormat("ru-RU", {
day: "2-digit",
month: "2-digit",
year: "numeric",
timeZone: "UTC",
}).format(new Date(value));
}
function formatSnapshotTime(value: string): string {
return new Intl.DateTimeFormat("ru-RU", {
dateStyle: "medium",
dateStyle: "short",
timeStyle: "short",
timeZone: "UTC",
}).format(new Date(value));
@@ -32,4 +41,10 @@ function instrumentLogoUrl(logoName: string | null | undefined): string | null {
: null;
}
export { formatDecimal, formatMoney, formatSnapshotTime, instrumentLogoUrl };
export {
formatDate,
formatDecimal,
formatMoney,
formatSnapshotTime,
instrumentLogoUrl,
};
+1
View File
@@ -1,4 +1,5 @@
export {
formatDate,
formatDecimal,
formatMoney,
formatSnapshotTime,