From e6888d25492833265efbc1c3690faf56762390c4 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 6 May 2024 23:45:54 +0300 Subject: [PATCH 01/34] hotifx-dx --- .github/workflows/node-ci.yml | 22 +++++++++---------- package.json | 4 ++-- .../EditorFloatingMenu/EditorFloatingMenu.tsx | 1 - src/components/Nav/HeaderAuth.tsx | 12 +--------- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 4449f6c9..3063d95d 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -13,7 +13,7 @@ jobs: run: npm ci - name: Check types - run: npm run check:types + run: npm run typecheck - name: Lint with Biome run: npm run check:code @@ -29,14 +29,14 @@ jobs: runs-on: ubuntu-latest if: github.event.deployment_status.state == 'success' steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 - - name: Install dependencies - run: npm ci - - name: Install Playwright - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test - env: - BASE_URL: ${{ github.event.deployment_status.target_url }} + - name: Install dependencies + run: npm ci + - name: Install Playwright + run: npx playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + env: + BASE_URL: ${{ github.event.deployment_status.target_url }} diff --git a/package.json b/package.json index 86ed0acd..76af1218 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "lint:styles:fix": "stylelint **/*.{scss,css} --fix", "preview": "vite preview", "start": "vite", - "check:types": "tsc --noEmit", - "check:types:watch": "tsc --noEmit --watch" + "typecheck": "tsc --noEmit", + "typecheck:watch": "tsc --noEmit --watch" }, "dependencies": { "form-data": "4.0.0", diff --git a/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx b/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx index 95c3dfcb..5e3bcfdc 100644 --- a/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx +++ b/src/components/Editor/EditorFloatingMenu/EditorFloatingMenu.tsx @@ -28,7 +28,6 @@ const embedData = (data) => { const result: { src: string; width?: string; height?: string } = { src: '' } - // biome-ignore lint/style/useForOf: for (let i = 0; i < attributes.length; i++) { const attribute = attributes.item(i) if (attribute) { diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx index a0c273fc..0d30a76a 100644 --- a/src/components/Nav/HeaderAuth.tsx +++ b/src/components/Nav/HeaderAuth.tsx @@ -34,7 +34,7 @@ export const HeaderAuth = (props: Props) => { const { page } = useRouter() const { session, author, isSessionLoaded } = useSession() const { unreadNotificationsCount, showNotificationsPanel } = useNotifications() - const { form, toggleEditorPanel, saveShout, saveDraft, publishShout } = useEditorContext() + const { form, toggleEditorPanel, publishShout } = useEditorContext() const handleBellIconClick = (event: Event) => { event.preventDefault() @@ -57,16 +57,6 @@ export const HeaderAuth = (props: Props) => { toggleEditorPanel() } - // FIXME: use or remove - const handleSaveClick = () => { - const hasTopics = form.selectedTopics?.length > 0 - if (hasTopics) { - saveShout(form) - } else { - saveDraft(form) - } - } - const [width, setWidth] = createSignal(0) const [editorMode, setEditorMode] = createSignal(t('Editing')) From 52ef17dc6de163bbda4d9cf7413a1d7a448f2031 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 7 May 2024 00:51:07 +0300 Subject: [PATCH 02/34] hotfix-onecard-swiper --- .../_shared/SolidSwiper/ArticleCardSwiper.tsx | 24 +++++++++++++++++-- .../_shared/SolidSwiper/Swiper.module.scss | 14 ++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx b/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx index e8f76d6a..35105dca 100644 --- a/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx +++ b/src/components/_shared/SolidSwiper/ArticleCardSwiper.tsx @@ -28,12 +28,32 @@ export const ArticleCardSwiper = (props: Props) => { return ( -
+
1, + [styles.articleMode]: true, + [styles.ArticleCardSwiper]: props.slides.length > 1, + [styles.unswiped]: props.slides.length === 1, + })} + >

{props.title}

- 0}> + 1} + fallback={ + + } + >
(mainSwipeRef.current = el)} diff --git a/src/components/_shared/SolidSwiper/Swiper.module.scss b/src/components/_shared/SolidSwiper/Swiper.module.scss index f3f182e8..78d205e2 100644 --- a/src/components/_shared/SolidSwiper/Swiper.module.scss +++ b/src/components/_shared/SolidSwiper/Swiper.module.scss @@ -8,6 +8,18 @@ } } +.unswiped { + width: 100%; + margin: 2rem 0; + margin-bottom: 6rem; + padding-bottom: 2rem; + display: block; + + h2 { + text-align: center; + } +} + .Swiper { display: block; margin: 2rem 0; @@ -57,7 +69,7 @@ margin: 0; position: relative; - & > swiper-container { + &>swiper-container { display: flex; flex-direction: row; gap: 10px; From ce86896c1d4a09324131698ed139e7252cbac69b Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Tue, 7 May 2024 01:01:20 +0300 Subject: [PATCH 03/34] Unified popups style --- public/icons/logout.svg | 4 + public/icons/profile.svg | 4 + .../Feed/ArticleCard/ArticleCard.module.scss | 1 + .../FeedArticlePopup.module.scss | 3 - src/components/Nav/ProfilePopup.tsx | 33 ++++++-- src/components/_shared/DropDown/DropDown.tsx | 25 +++--- .../_shared/Popup/Popup.module.scss | 84 ++++++++++++------- src/components/_shared/Popup/Popup.tsx | 3 +- .../_shared/ShareLinks/ShareLinks.module.scss | 5 +- .../_shared/ShareLinks/ShareLinks.tsx | 23 ++--- 10 files changed, 117 insertions(+), 68 deletions(-) create mode 100644 public/icons/logout.svg create mode 100644 public/icons/profile.svg diff --git a/public/icons/logout.svg b/public/icons/logout.svg new file mode 100644 index 00000000..a28a25c8 --- /dev/null +++ b/public/icons/logout.svg @@ -0,0 +1,4 @@ + + + diff --git a/public/icons/profile.svg b/public/icons/profile.svg new file mode 100644 index 00000000..23c7e580 --- /dev/null +++ b/public/icons/profile.svg @@ -0,0 +1,4 @@ + + + diff --git a/src/components/Feed/ArticleCard/ArticleCard.module.scss b/src/components/Feed/ArticleCard/ArticleCard.module.scss index 336d82c8..d19865b1 100644 --- a/src/components/Feed/ArticleCard/ArticleCard.module.scss +++ b/src/components/Feed/ArticleCard/ArticleCard.module.scss @@ -603,6 +603,7 @@ .shoutCardDetailsItem { align-items: center; display: flex; + font-size: 1.4rem; margin-right: 1.2rem; white-space: nowrap; diff --git a/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss b/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss index 54b1df3a..d9141883 100644 --- a/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss +++ b/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss @@ -1,7 +1,4 @@ .feedArticlePopup { - box-shadow: none !important; - border: 1px solid rgb(0 0 0 / 15%); - border-radius: 1.6rem; padding: 0 !important; text-align: left; overflow: hidden; diff --git a/src/components/Nav/ProfilePopup.tsx b/src/components/Nav/ProfilePopup.tsx index ce645d6d..bdaa9f60 100644 --- a/src/components/Nav/ProfilePopup.tsx +++ b/src/components/Nav/ProfilePopup.tsx @@ -6,8 +6,10 @@ import { useLocalize } from '../../context/localize' import { useSession } from '../../context/session' import { router } from '../../stores/router' import { Popup } from '../_shared/Popup' +import { Icon } from '../_shared/Icon' import styles from '../_shared/Popup/Popup.module.scss' +import {clsx} from 'clsx'; type ProfilePopupProps = Omit @@ -19,27 +21,44 @@ export const ProfilePopup = (props: ProfilePopupProps) => {