From aabf1d146d81e56aa05d89f12cfb6dfa1f28ff91 Mon Sep 17 00:00:00 2001
From: Gorbachev Egor <7gorbachevm@gmail.com>
Date: Mon, 8 Jan 2024 20:20:46 +0700
Subject: [PATCH] Support chat link
---
.env | 1 -
src/screens/deck-form/deck-form.tsx | 10 +++----
.../deck-form/store/deck-form-store.test.ts | 2 +-
src/screens/deck-list/main-screen.tsx | 7 ++---
src/screens/folder-form/folder-form.tsx | 10 +++----
src/screens/folder-review/folder-preview.tsx | 6 ++--
.../share-deck/share-deck-settings.tsx | 14 ++++-----
src/screens/shared/links.ts | 4 +++
src/screens/shared/screen.tsx | 2 +-
.../user-settings/user-settings-main.tsx | 30 ++++++++++++++-----
.../settings-row.tsx => ui/card-row.tsx} | 4 +--
11 files changed, 53 insertions(+), 37 deletions(-)
create mode 100644 src/screens/shared/links.ts
rename src/{screens/user-settings/settings-row.tsx => ui/card-row.tsx} (85%)
diff --git a/.env b/.env
index aca37592..773f99c4 100644
--- a/.env
+++ b/.env
@@ -1,4 +1,3 @@
VITE_API_URL=/api
-VITE_CHANNEL_LINK=
VITE_BOT_APP_URL=
diff --git a/src/screens/deck-form/deck-form.tsx b/src/screens/deck-form/deck-form.tsx
index 5ae66223..2d9a6f47 100644
--- a/src/screens/deck-form/deck-form.tsx
+++ b/src/screens/deck-form/deck-form.tsx
@@ -10,7 +10,7 @@ import { useMount } from "../../lib/react/use-mount.ts";
import { useBackButton } from "../../lib/telegram/use-back-button.tsx";
import { useTelegramProgress } from "../../lib/telegram/use-telegram-progress.tsx";
import { assert } from "../../lib/typescript/assert.ts";
-import { SettingsRow } from "../user-settings/settings-row.tsx";
+import { CardRow } from "../../ui/card-row.tsx";
import { Button } from "../../ui/button.tsx";
import { HintTransparent } from "../../ui/hint-transparent.tsx";
import { RadioSwitcher } from "../../ui/radio-switcher.tsx";
@@ -90,23 +90,23 @@ export const DeckForm = observer(() => {
{deckFormStore.form.cards.length > 0 && (
- {
deckFormStore.goToCardList();
}}
>
{t("cards")}
{deckFormStore.form.cards.length}
-
+
)}
-
+
{t("speaking_cards")}
-
+
{deckFormStore.isSpeakingCardEnabled ? (
{
diff --git a/src/screens/deck-list/main-screen.tsx b/src/screens/deck-list/main-screen.tsx
index 85ca2d8b..bb200a9e 100644
--- a/src/screens/deck-list/main-screen.tsx
+++ b/src/screens/deck-list/main-screen.tsx
@@ -11,12 +11,12 @@ import { screenStore } from "../../store/screen-store.ts";
import { Button } from "../../ui/button.tsx";
import { DeckLoading } from "./deck-loading.tsx";
import WebApp from "@twa-dev/sdk";
-import { assert } from "../../lib/typescript/assert.ts";
import { ListHeader } from "../../ui/list-header.tsx";
import { range } from "../../lib/array/range.ts";
import { reset } from "../../ui/reset.ts";
import { ViewMoreDecksToggle } from "./view-more-decks-toggle.tsx";
import { t } from "../../translations/t.ts";
+import { links } from "../shared/links.ts";
export const MainScreen = observer(() => {
useMount(() => {
@@ -181,10 +181,7 @@ export const MainScreen = observer(() => {