From cfaf9e4080b53708db80a108d1a419108ed26153 Mon Sep 17 00:00:00 2001 From: Egor Gorbachev <7gorbachevm@gmail.com> Date: Wed, 15 Nov 2023 17:55:49 +0700 Subject: [PATCH] Telegram UI guidlines (#9) * Telegram UI kit guidlines - border radius and secondary button * List header --- package.json | 6 +- src/index.css | 3 +- src/screens/deck-form/deck-form.tsx | 2 +- src/screens/deck-list/deck-loading.tsx | 2 +- src/screens/deck-list/main-screen.tsx | 82 ++++++++++--------- src/screens/deck-list/my-deck.tsx | 2 +- src/screens/deck-list/public-deck.tsx | 2 +- src/screens/deck-review/deck-preview.tsx | 8 +- src/screens/deck-review/share-deck-button.tsx | 9 +- src/ui/button.tsx | 23 +++--- src/ui/list-header.tsx | 23 ++++++ src/ui/progress-bar.tsx | 2 +- src/ui/theme.tsx | 15 ++-- 13 files changed, 101 insertions(+), 78 deletions(-) create mode 100644 src/ui/list-header.tsx diff --git a/package.json b/package.json index 694bd42b..198ff02b 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "version": "0.0.0", "type": "module", "scripts": { - "build": "vite build", - "typecheck": "npx tsc", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "dev:frontend:start": "vite", "dev:api:start": "npx wrangler pages dev /functions --compatibility-date=2023-09-22", "dev:tunnel": "../ngrok http --domain=causal-magpie-closing.ngrok-free.app 5173", + "build": "vite build", + "typecheck": "npx tsc", + "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "test:api": "npx vitest --dir functions/", "test:api:coverage:": "npx vitest run --dir functions/ --coverage", "test:frontend": "npx vitest --dir src/", diff --git a/src/index.css b/src/index.css index f7832417..9d7ee5eb 100644 --- a/src/index.css +++ b/src/index.css @@ -1,5 +1,6 @@ :root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + font-family: -apple-system, Inter, system-ui, Avenir, Helvetica, Arial, + sans-serif; line-height: 1.5; font-weight: 400; font-synthesis: none; diff --git a/src/screens/deck-form/deck-form.tsx b/src/screens/deck-form/deck-form.tsx index 3558e247..401fea78 100644 --- a/src/screens/deck-form/deck-form.tsx +++ b/src/screens/deck-form/deck-form.tsx @@ -64,7 +64,7 @@ export const DeckForm = observer(() => { className={css({ cursor: "pointer", backgroundColor: theme.secondaryBgColor, - borderRadius: 8, + borderRadius: theme.borderRadius, padding: 12, })} > diff --git a/src/screens/deck-list/deck-loading.tsx b/src/screens/deck-list/deck-loading.tsx index cb3dca87..8f68607d 100644 --- a/src/screens/deck-list/deck-loading.tsx +++ b/src/screens/deck-list/deck-loading.tsx @@ -11,7 +11,7 @@ export const DeckLoading = () => { justifyContent: "space-between", cursor: "pointer", gap: 4, - borderRadius: 8, + borderRadius: theme.borderRadius, padding: "13px 12px", background: theme.secondaryBgColor, })} diff --git a/src/screens/deck-list/main-screen.tsx b/src/screens/deck-list/main-screen.tsx index f466d8b6..b7663157 100644 --- a/src/screens/deck-list/main-screen.tsx +++ b/src/screens/deck-list/main-screen.tsx @@ -12,6 +12,7 @@ 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"; export const MainScreen = observer(() => { useMount(() => { @@ -37,11 +38,8 @@ export const MainScreen = observer(() => { return (