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/__checks__/discoursio-webapp.check.js b/__checks__/discoursio-webapp.check.js new file mode 100644 index 00000000..7e0fae98 --- /dev/null +++ b/__checks__/discoursio-webapp.check.js @@ -0,0 +1,25 @@ +const { chromium } = require('playwright') + +const checkUrl = async (page, targetUrl, pageName) => { + const response = await page.goto(targetUrl) + if (response.status() > 399) { + throw new Error(`Failed with response code ${response.status()}`) + } + + await page.screenshot({ path: `${pageName}.jpg` }) +} + +async function run() { + const browser = await chromium.launch() + const page = await browser.newPage() + + const targetUrl = process.env.ENVIRONMENT_URL || 'https://testing.discours.io' + + await checkUrl(page, targetUrl, 'main') + await checkUrl(page, `${targetUrl}/authors`, 'authors') + await checkUrl(page, `${targetUrl}/topics`, 'topics') + await page.close() + await browser.close() +} + +run() diff --git a/package.json b/package.json index b559979e..56758ccf 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", "start:staging": "cross-env PUBLIC_API_URL=https://testapi.discours.io astro dev", "typecheck": "astro check && tsc --noEmit", "typecheck:watch": "tsc --noEmit --watch", 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 (
-
-
-