From 6b6602a9c9c107ad5988dffa4fd5e8f7b24947b5 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 23 Nov 2022 14:53:48 +0100 Subject: [PATCH 1/7] 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 2/7] 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 (
-
-