From b3c1ee664a11f319897acb70f0332f26c9aeb2da Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 23 Nov 2022 12:45:52 +0100 Subject: [PATCH 1/9] npm run start:local fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7da9869..720b571e 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "preview": "astro preview", "server": "node server/server.mjs", "start": "astro dev", - "start:local": "cross-env PUBLIC_API_URL=http://localhost:8080 astro dev", + "start:local": "cross-env PUBLIC_API_URL=http://127.0.0.1:8080 astro dev", "typecheck": "astro check && tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", "vercel-build": "astro build" From ffc0b7abf9185eda18bbce08a7dca9dc9c25c89e Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 23 Nov 2022 13:31:13 +0100 Subject: [PATCH 2/9] lint --- .eslintrc.js | 1 + src/components/_shared/StatMetrics.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0459a05c..448e589e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -73,6 +73,7 @@ module.exports = { 'unicorn/import-style': 'off', 'unicorn/numeric-separators-style': 'off', 'unicorn/prefer-node-protocol': 'off', + 'unicorn/consistent-function-scoping': 'warn', 'promise/always-return': 'off', diff --git a/src/components/_shared/StatMetrics.tsx b/src/components/_shared/StatMetrics.tsx index fd60946c..9d4bdcbd 100644 --- a/src/components/_shared/StatMetrics.tsx +++ b/src/components/_shared/StatMetrics.tsx @@ -15,7 +15,7 @@ const pseudonames = { comments: 'discussions' } -const nos = (s) => s.slice(0, s.length - 1) +const nos = (s) => s.slice(-1) export const StatMetrics = (props: StatMetricsProps) => { return ( From 6b6602a9c9c107ad5988dffa4fd5e8f7b24947b5 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 23 Nov 2022 14:53:48 +0100 Subject: [PATCH 3/9] npm run start:staging --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c7da9869..b559979e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "server": "node server/server.mjs", "start": "astro dev", "start:local": "cross-env PUBLIC_API_URL=http://localhost:8080 astro dev", + "start:staging": "cross-env PUBLIC_API_URL=https://testapi.discours.io astro dev", "typecheck": "astro check && tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", "vercel-build": "astro build" From c4ecec9c063cfd191f08f4287c427816c66a2767 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Wed, 23 Nov 2022 22:14:59 +0300 Subject: [PATCH 4/9] Create rating control. Refactoring style. --- src/components/Article/FullArticle.tsx | 84 ++++--- .../Article/RatingControl.module.scss | 29 +++ src/components/Article/RatingControl.tsx | 19 ++ src/components/Author/Card.tsx | 16 +- src/components/Feed/Card.module.scss | 30 --- src/components/Feed/Card.tsx | 7 +- src/components/Views/Article.tsx | 22 +- src/styles/Article.module.scss | 212 ++++++++++++++++++ src/styles/Article.scss | 204 ----------------- 9 files changed, 337 insertions(+), 286 deletions(-) create mode 100644 src/components/Article/RatingControl.module.scss create mode 100644 src/components/Article/RatingControl.tsx create mode 100644 src/styles/Article.module.scss delete mode 100644 src/styles/Article.scss diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 6046c682..ecc3c51b 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -3,13 +3,17 @@ import './Full.scss' import { Icon } from '../_shared/Icon' import ArticleComment from './Comment' import { AuthorCard } from '../Author/Card' -import { createMemo, For, onMount, Show } from 'solid-js' +import { createMemo, createSignal, For, onMount, Show } from 'solid-js' import type { Author, Reaction, Shout } from '../../graphql/types.gen' import { t } from '../../utils/intl' import { showModal } from '../../stores/ui' import MD from './MD' import { SharePopup } from './SharePopup' import { useSession } from '../../context/session' +import stylesHeader from '../Nav/Header.module.scss' +import styles from '../../styles/Article.module.scss' +import RatingControl from './RatingControl' +import { clsx } from 'clsx' const MAX_COMMENT_LEVEL = 6 @@ -39,6 +43,7 @@ const formatDate = (date: Date) => { export const FullArticle = (props: ArticleProps) => { const { session } = useSession() const formattedDate = createMemo(() => formatDate(new Date(props.article.createdAt))) + const [isSharePopupVisible, setIsSharePopupVisible] = createSignal(false) const mainTopic = () => (props.article.topics?.find((topic) => topic?.slug === props.article.mainTopic)?.title || '').replace( @@ -64,8 +69,8 @@ export const FullArticle = (props: ArticleProps) => { return (
-
-