lint & build

This commit is contained in:
bniwredyc 2023-02-10 02:19:20 +01:00
parent ebfb6eeef1
commit 878f0cb307
43 changed files with 142 additions and 160 deletions

View File

@ -12,12 +12,16 @@
"selector-class-pattern": null, "selector-class-pattern": null,
"no-descending-specificity": null, "no-descending-specificity": null,
"scss/function-no-unknown": null, "scss/function-no-unknown": null,
"scss/no-global-function-names": null,
"function-url-quotes": null, "function-url-quotes": null,
"font-family-no-missing-generic-family-keyword": null, "font-family-no-missing-generic-family-keyword": null,
"order/order": [ "order/order": [
"custom-properties", "custom-properties",
"declarations" "declarations"
] ],
"scss/dollar-variable-pattern": ["^[a-z][a-zA-Z]+$", {
"ignore": "global"
}]
}, },
"defaultSeverity": "warning" "defaultSeverity": "warning"
} }

View File

@ -13,7 +13,7 @@ export default async (req, res) => {
const client = mailgun.client(mgOptions) const client = mailgun.client(mgOptions)
try { try {
const response = await client.lists.members.createMember(mgOptions.domain, { await client.lists.members.createMember(mgOptions.domain, {
address: email, address: email,
subscribed: true, subscribed: true,
upsert: 'yes' upsert: 'yes'

View File

@ -1,10 +1,9 @@
import { defineConfig, AstroUserConfig } from 'astro/config' import { defineConfig, AstroUserConfig } from 'astro/config'
import vercel from '@astrojs/vercel/serverless' import vercel from '@astrojs/vercel/serverless'
import solidJs from '@astrojs/solid-js' import solidJs from '@astrojs/solid-js'
import type { CSSOptions } from 'vite'
import defaultGenerateScopedName from 'postcss-modules/build/generateScopedName' import defaultGenerateScopedName from 'postcss-modules/build/generateScopedName'
import { isDev } from './src/utils/config' import { isDev } from './src/utils/config'
import { visualizer } from 'rollup-plugin-visualizer' // import { visualizer } from 'rollup-plugin-visualizer'
const PATH_PREFIX = '/src/' const PATH_PREFIX = '/src/'
@ -18,18 +17,6 @@ const getDevCssClassPrefix = (filename: string): string => {
const devGenerateScopedName = (name: string, filename: string, css: string) => const devGenerateScopedName = (name: string, filename: string, css: string) =>
getDevCssClassPrefix(filename) + '_' + defaultGenerateScopedName(name, filename, css) getDevCssClassPrefix(filename) + '_' + defaultGenerateScopedName(name, filename, css)
const css: CSSOptions = {
preprocessorOptions: {
scss: {
additionalData: '@import "src/styles/imports";\n'
}
},
modules: {
generateScopedName: isDev ? devGenerateScopedName : defaultGenerateScopedName,
localsConvention: null
}
}
const astroConfig: AstroUserConfig = { const astroConfig: AstroUserConfig = {
site: 'https://new.discours.io', site: 'https://new.discours.io',
integrations: [solidJs()], integrations: [solidJs()],
@ -39,7 +26,7 @@ const astroConfig: AstroUserConfig = {
build: { build: {
chunkSizeWarningLimit: 777, chunkSizeWarningLimit: 777,
rollupOptions: { rollupOptions: {
plugins: [visualizer()], // plugins: [visualizer()],
output: { output: {
// eslint-disable-next-line sonarjs/cognitive-complexity // eslint-disable-next-line sonarjs/cognitive-complexity
/* /*
@ -71,7 +58,17 @@ const astroConfig: AstroUserConfig = {
external: [] external: []
} }
}, },
css css: {
preprocessorOptions: {
scss: {
additionalData: '@import "src/styles/imports";\n'
}
},
modules: {
generateScopedName: isDev ? devGenerateScopedName : defaultGenerateScopedName,
localsConvention: null
}
}
} }
} }

View File

@ -13,13 +13,14 @@
} }
.comment { .comment {
&:before, &::before,
&:after { &::after {
content: ''; content: '';
left: 0; left: 0;
position: absolute; position: absolute;
} }
&:before {
&::before {
border-bottom: 2px solid #ccc; border-bottom: 2px solid #ccc;
border-left: 2px solid #ccc; border-left: 2px solid #ccc;
border-radius: 0 0 0 1.2rem; border-radius: 0 0 0 1.2rem;
@ -27,20 +28,24 @@
height: 2.4rem; height: 2.4rem;
width: 1.2rem; width: 1.2rem;
} }
&:after {
&::after {
background: #ccc; background: #ccc;
height: 100%; height: 100%;
top: 0; top: 0;
width: 2px; width: 2px;
} }
&:last-child:after {
&:last-child::after {
display: none; display: none;
} }
} }
.shout-body { .shout-body {
@include font-size(1.5rem); @include font-size(1.5rem);
margin-bottom: 1em; margin-bottom: 1em;
*:last-child { *:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
@ -76,7 +81,7 @@
.commentControlEdit, .commentControlEdit,
.commentControlComplain { .commentControlComplain {
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
//opacity: 0; // opacity: 0;
transition: opacity 0.3s; transition: opacity 0.3s;
} }
} }
@ -105,6 +110,7 @@
&:hover { &:hover {
background: #000; background: #000;
color: #fff; color: #fff;
.icon { .icon {
filter: invert(1); filter: invert(1);
opacity: 1; opacity: 1;
@ -116,6 +122,7 @@
margin-right: 0.3em; margin-right: 0.3em;
opacity: 0.6; opacity: 0.6;
transition: filter 0.3s, opacity 0.2s; transition: filter 0.3s, opacity 0.2s;
img { img {
margin-bottom: -0.1em; margin-bottom: -0.1em;
} }
@ -166,7 +173,6 @@
gap: 1rem; gap: 1rem;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
color: rgba(0, 0, 0, 0.3);
font-size: 1.2rem; font-size: 1.2rem;
margin-bottom: 4px; margin-bottom: 4px;
color: rgb(0 0 0 / 30%); color: rgb(0 0 0 / 30%);

View File

@ -1,5 +1,5 @@
import { Show, createMemo, createSignal, onMount, For } from 'solid-js' import { Show, createMemo, createSignal, onMount, For } from 'solid-js'
import Comment from './Comment' import { Comment } from './Comment'
import { t } from '../../utils/intl' import { t } from '../../utils/intl'
import styles from '../../styles/Article.module.scss' import styles from '../../styles/Article.module.scss'
import { createReaction, useReactionsStore } from '../../stores/zine/reactions' import { createReaction, useReactionsStore } from '../../stores/zine/reactions'
@ -14,7 +14,6 @@ import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient'
import Button from '../_shared/Button' import Button from '../_shared/Button'
const ARTICLE_COMMENTS_PAGE_SIZE = 50 const ARTICLE_COMMENTS_PAGE_SIZE = 50
const MAX_COMMENT_LEVEL = 6
type Props = { type Props = {
commentAuthors: Author[] commentAuthors: Author[]
@ -48,13 +47,7 @@ export const CommentsTree = (props: Props) => {
setIsCommentsLoading(false) setIsCommentsLoading(false)
} }
} }
const getCommentById = (cid: number) => reactions().find((r: Reaction) => r.id === cid)
const getCommentLevel = (c: Reaction, level = 0) => {
if (c && c.replyTo && level < MAX_COMMENT_LEVEL) {
return getCommentLevel(getCommentById(c.replyTo), level + 1)
}
return level
}
onMount(async () => await loadMore()) onMount(async () => await loadMore())
const [submitted, setSubmitted] = createSignal<boolean>(false) const [submitted, setSubmitted] = createSignal<boolean>(false)

View File

@ -6,7 +6,7 @@ import { createMemo, For, Match, onMount, Show, Switch } from 'solid-js'
import type { Author, Shout } from '../../graphql/types.gen' import type { Author, Shout } from '../../graphql/types.gen'
import { t } from '../../utils/intl' import { t } from '../../utils/intl'
import MD from './MD' import MD from './MD'
import { getShareUrl, SharePopup } from './SharePopup' import { SharePopup } from './SharePopup'
import { getDescription } from '../../utils/meta' import { getDescription } from '../../utils/meta'
import stylesHeader from '../Nav/Header.module.scss' import stylesHeader from '../Nav/Header.module.scss'
import styles from '../../styles/Article.module.scss' import styles from '../../styles/Article.module.scss'

View File

@ -201,6 +201,7 @@
.authorName { .authorName {
@include font-size(3.4rem); @include font-size(3.4rem);
font-weight: 500; font-weight: 500;
margin-bottom: 0.2em; margin-bottom: 0.2em;
} }
@ -313,6 +314,7 @@
.authorName { .authorName {
@include font-size(1.2rem); @include font-size(1.2rem);
margin-bottom: 0; margin-bottom: 0;
} }

View File

@ -39,8 +39,6 @@ export const AuthorCard = (props: AuthorCardProps) => {
actions: { loadSession } actions: { loadSession }
} = useSession() } = useSession()
if (!props.author) return false // FIXME: с сервера должен приходить автор реакции (ApiClient.CreateReaction)
const [isSubscribing, setIsSubscribing] = createSignal(false) const [isSubscribing, setIsSubscribing] = createSignal(false)
const subscribed = createMemo<boolean>(() => { const subscribed = createMemo<boolean>(() => {

View File

@ -17,6 +17,7 @@
.author-page { .author-page {
.view-switcher { .view-switcher {
@include font-size(1.5rem); @include font-size(1.5rem);
margin-top: 0; margin-top: 0;
button { button {

View File

@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { inputRules } from 'prosemirror-inputrules' import { inputRules } from 'prosemirror-inputrules'
import type { Mark, MarkType } from 'prosemirror-model' import type { Mark, MarkType } from 'prosemirror-model'
import type { EditorState, Transaction } from 'prosemirror-state' import type { EditorState, Transaction } from 'prosemirror-state'

View File

@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { Plugin, PluginKey, TextSelection, Transaction } from 'prosemirror-state' import { Plugin, PluginKey, TextSelection, Transaction } from 'prosemirror-state'
import type { EditorView } from 'prosemirror-view' import type { EditorView } from 'prosemirror-view'
import type { Mark, Node, Schema } from 'prosemirror-model' import type { Mark, Node, Schema } from 'prosemirror-model'

View File

@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { Plugin } from 'prosemirror-state' import { Plugin } from 'prosemirror-state'
import type { EditorView } from 'prosemirror-view' import type { EditorView } from 'prosemirror-view'
import type { ProseMirrorExtension } from '../helpers' import type { ProseMirrorExtension } from '../helpers'

View File

@ -1,3 +1,5 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { renderGrouped } from 'prosemirror-menu' import { renderGrouped } from 'prosemirror-menu'
import { EditorState, Plugin } from 'prosemirror-state' import { EditorState, Plugin } from 'prosemirror-state'
import styles from '../styles/ProseMirror.module.scss' import styles from '../styles/ProseMirror.module.scss'

View File

@ -411,12 +411,13 @@
} }
.shoutCardDetails { .shoutCardDetails {
@include font-size(1.5rem);
align-items: flex-start; align-items: flex-start;
border-top: 2px solid #141414; border-top: 2px solid #141414;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
@include font-size(1.5rem);
margin-top: 1em; margin-top: 1em;
padding: 1em 0 0; padding: 1em 0 0;
position: relative; position: relative;

View File

@ -1,6 +1,6 @@
.feedArticlePopup { .feedArticlePopup {
box-shadow: none !important; box-shadow: none !important;
border: 1px solid rgb(0 0 0 / 0.15); border: 1px solid rgb(0 0 0 / 15%);
border-radius: 1.6rem; border-radius: 1.6rem;
padding: 1.6rem !important; padding: 1.6rem !important;

View File

@ -7,12 +7,13 @@
} }
.counter { .counter {
@include font-size(1.2rem);
align-items: center; align-items: center;
align-self: flex-start; align-self: flex-start;
background: #f6f6f6; background: #f6f6f6;
border-radius: 0.8rem; border-radius: 0.8rem;
display: flex; display: flex;
@include font-size(1.2rem);
font-weight: 500; font-weight: 500;
padding: 0.2em 0.5em; padding: 0.2em 0.5em;
} }

View File

@ -73,6 +73,7 @@
&.opened, &.opened,
&.opened:hover { &.opened:hover {
background: #000; background: #000;
.name, .name,
.message, .message,
.time { .time {

View File

@ -51,10 +51,12 @@ $actionsWidth: 32px * 2;
z-index: -1; z-index: -1;
transition: 0.3s ease-in-out; transition: 0.3s ease-in-out;
} }
&.popupVisible { &.popupVisible {
position: relative; position: relative;
z-index: 100; z-index: 100;
} }
&.popupVisible, &.popupVisible,
&:hover { &:hover {
.actions { .actions {
@ -101,6 +103,7 @@ $actionsWidth: 32px * 2;
right: unset; right: unset;
left: -$actionsWidth/2; left: -$actionsWidth/2;
flex-direction: row-reverse; flex-direction: row-reverse;
.reply { .reply {
transform: scaleX(-1); transform: scaleX(-1);
} }

View File

@ -4,7 +4,7 @@ import { Modal } from './Modal'
import { AuthModal } from './AuthModal' import { AuthModal } from './AuthModal'
import { t } from '../../utils/intl' import { t } from '../../utils/intl'
import { useModalStore } from '../../stores/ui' import { useModalStore } from '../../stores/ui'
import { router, Routes, useRouter } from '../../stores/router' import { router, useRouter } from '../../stores/router'
import styles from './Header.module.scss' import styles from './Header.module.scss'
import { getPagePath } from '@nanostores/router' import { getPagePath } from '@nanostores/router'
import { clsx } from 'clsx' import { clsx } from 'clsx'
@ -13,7 +13,7 @@ import { getShareUrl, SharePopup } from '../Article/SharePopup'
import { getDescription } from '../../utils/meta' import { getDescription } from '../../utils/meta'
import { Snackbar } from './Snackbar' import { Snackbar } from './Snackbar'
const resources: { name: string; route: keyof Routes }[] = [ const resources: { name: string; route: 'home' | 'feed' | 'topics' }[] = [
{ name: t('zine'), route: 'home' }, { name: t('zine'), route: 'home' },
{ name: t('feed'), route: 'feed' }, { name: t('feed'), route: 'feed' },
{ name: t('topics'), route: 'topics' } { name: t('topics'), route: 'topics' }
@ -111,7 +111,7 @@ export const Header = (props: Props) => {
<For each={resources}> <For each={resources}>
{(r) => ( {(r) => (
<li classList={{ [styles.selected]: r.route === page().route }}> <li classList={{ [styles.selected]: r.route === page().route }}>
<a href={getPagePath(router, r.route, null)}>{r.name}</a> <a href={getPagePath(router, r.route)}>{r.name}</a>
</li> </li>
)} )}
</For> </For>

View File

@ -1,13 +1,14 @@
.snackbar { .snackbar {
min-height: 4px; min-height: 4px;
background-color: #141414; background-color: #141414;
color: #ffffff; color: #fff;
transition: background-color 0.3s; transition: background-color 0.3s;
&.error { &.error {
background-color: #d00820; background-color: #d00820;
} }
} }
.content { .content {
transition: height 0.3s, color 0.3s; transition: height 0.3s, color 0.3s;
height: 60px; height: 60px;

View File

@ -1,7 +1,6 @@
import { createSignal, Show } from 'solid-js' import { createSignal, Show } from 'solid-js'
import { PageWrap } from '../../_shared/PageWrap' import { PageWrap } from '../../_shared/PageWrap'
import { Icon } from '../../_shared/Icon' import { Icon } from '../../_shared/Icon'
import { showModal } from '../../../stores/ui'
// const title = t('Terms of use') // const title = t('Terms of use')

View File

@ -1,11 +1,10 @@
import { PageWrap } from '../../_shared/PageWrap' import { PageWrap } from '../../_shared/PageWrap'
import type { PageProps } from '../../types'
import styles from './Settings.module.scss' import styles from './Settings.module.scss'
import { Icon } from '../../_shared/Icon' import { Icon } from '../../_shared/Icon'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import ProfileSettingsNavigation from '../../Discours/ProfileSettingsNavigation' import ProfileSettingsNavigation from '../../Discours/ProfileSettingsNavigation'
export const ProfileSecurityPage = (props: PageProps) => { export const ProfileSecurityPage = () => {
return ( return (
<PageWrap> <PageWrap>
<div class="wide-container"> <div class="wide-container">

View File

@ -2,7 +2,7 @@ import { PageWrap } from '../../_shared/PageWrap'
import { t } from '../../../utils/intl' import { t } from '../../../utils/intl'
import { Icon } from '../../_shared/Icon' import { Icon } from '../../_shared/Icon'
import ProfileSettingsNavigation from '../../Discours/ProfileSettingsNavigation' import ProfileSettingsNavigation from '../../Discours/ProfileSettingsNavigation'
import { For, createSignal, Show, onMount, createEffect } from 'solid-js' import { For, createSignal, Show, onMount } from 'solid-js'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import styles from './Settings.module.scss' import styles from './Settings.module.scss'
import { useProfileForm } from '../../../context/profile' import { useProfileForm } from '../../../context/profile'
@ -13,6 +13,16 @@ import { useSession } from '../../../context/session'
import Button from '../../_shared/Button' import Button from '../../_shared/Button'
import { useSnackbar } from '../../../context/snackbar' import { useSnackbar } from '../../../context/snackbar'
const handleFileUpload = async (uploadFile: UploadFile) => {
const formData = new FormData()
formData.append('file', uploadFile.file, uploadFile.name)
const response = await fetch('/api/upload', {
method: 'POST',
body: formData
})
return response.json()
}
export const ProfileSettingsPage = () => { export const ProfileSettingsPage = () => {
const [addLinkForm, setAddLinkForm] = createSignal(false) const [addLinkForm, setAddLinkForm] = createSignal(false)
const [incorrectUrl, setIncorrectUrl] = createSignal(false) const [incorrectUrl, setIncorrectUrl] = createSignal(false)
@ -54,16 +64,6 @@ export const ProfileSettingsPage = () => {
const { selectFiles } = createFileUploader({ multiple: false, accept: 'image/*' }) const { selectFiles } = createFileUploader({ multiple: false, accept: 'image/*' })
const handleFileUpload = async (uploadFile: UploadFile) => {
const formData = new FormData()
formData.append('file', uploadFile.file, uploadFile.name)
const response = await fetch('/api/upload', {
method: 'POST',
body: formData
})
return response.json()
}
const handleAvatarClick = async () => { const handleAvatarClick = async () => {
await selectFiles(async ([uploadFile]) => { await selectFiles(async ([uploadFile]) => {
try { try {

View File

@ -1,12 +1,11 @@
import { PageWrap } from '../../_shared/PageWrap' import { PageWrap } from '../../_shared/PageWrap'
import type { PageProps } from '../../types'
import styles from './Settings.module.scss' import styles from './Settings.module.scss'
import stylesSettings from '../../../styles/FeedSettings.module.scss' import stylesSettings from '../../../styles/FeedSettings.module.scss'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import ProfileSettingsNavigation from '../../Discours/ProfileSettingsNavigation' import ProfileSettingsNavigation from '../../Discours/ProfileSettingsNavigation'
import { SearchField } from '../../_shared/SearchField' import { SearchField } from '../../_shared/SearchField'
export const ProfileSubscriptionsPage = (props: PageProps) => { export const ProfileSubscriptionsPage = () => {
return ( return (
<PageWrap> <PageWrap>
<div class="wide-container"> <div class="wide-container">

View File

@ -28,9 +28,6 @@ h5 {
top: 0; top: 0;
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
}
.avatar {
background: #ccc; background: #ccc;
border: none; border: none;
object-fit: cover; object-fit: cover;

View File

@ -3,7 +3,7 @@
import { MODALS, setLocale, showModal } from '../stores/ui' import { MODALS, setLocale, showModal } from '../stores/ui'
import { Component, createEffect, createMemo } from 'solid-js' import { Component, createEffect, createMemo } from 'solid-js'
import { Routes, useRouter } from '../stores/router' import { ROUTES, useRouter } from '../stores/router'
import { Dynamic, isServer } from 'solid-js/web' import { Dynamic, isServer } from 'solid-js/web'
import type { PageProps, RootSearchParams } from './types' import type { PageProps, RootSearchParams } from './types'
@ -35,13 +35,13 @@ import { SessionProvider } from '../context/session'
import { ProfileSettingsPage } from './Pages/profile/ProfileSettingsPage' import { ProfileSettingsPage } from './Pages/profile/ProfileSettingsPage'
import { ProfileSecurityPage } from './Pages/profile/ProfileSecurityPage' import { ProfileSecurityPage } from './Pages/profile/ProfileSecurityPage'
import { ProfileSubscriptionsPage } from './Pages/profile/ProfileSubscriptionsPage' import { ProfileSubscriptionsPage } from './Pages/profile/ProfileSubscriptionsPage'
import CreateSettingsPage from './Pages/CreateSettingsPage' import { CreateSettingsPage } from './Pages/CreateSettingsPage'
import { SnackbarProvider } from '../context/snackbar' import { SnackbarProvider } from '../context/snackbar'
// TODO: lazy load // TODO: lazy load
// const SomePage = lazy(() => import('./Pages/SomePage')) // const SomePage = lazy(() => import('./Pages/SomePage'))
const pagesMap: Record<keyof Routes, Component<PageProps>> = { const pagesMap: Record<keyof typeof ROUTES, Component<PageProps>> = {
inbox: InboxPage, inbox: InboxPage,
expo: LayoutShoutsPage, expo: LayoutShoutsPage,
connect: ConnectPage, connect: ConnectPage,

View File

@ -5,7 +5,6 @@ import type { Topic } from '../../graphql/types.gen'
import { FollowingEntity } from '../../graphql/types.gen' import { FollowingEntity } from '../../graphql/types.gen'
import { t } from '../../utils/intl' import { t } from '../../utils/intl'
import { follow, unfollow } from '../../stores/zine/common' import { follow, unfollow } from '../../stores/zine/common'
import { getLogger } from '../../utils/logger'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import { useSession } from '../../context/session' import { useSession } from '../../context/session'
import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient' import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient'

View File

@ -11,7 +11,6 @@ import { translit } from '../../utils/ru2en'
import styles from '../../styles/AllTopics.module.scss' import styles from '../../styles/AllTopics.module.scss'
import { SearchField } from '../_shared/SearchField' import { SearchField } from '../_shared/SearchField'
import { scrollHandler } from '../../utils/scroll' import { scrollHandler } from '../../utils/scroll'
import { StatMetrics } from '../_shared/StatMetrics'
type AllAuthorsPageSearchParams = { type AllAuthorsPageSearchParams = {
by: '' | 'name' | 'shouts' | 'followers' by: '' | 'name' | 'shouts' | 'followers'

View File

@ -1,11 +1,13 @@
.ratingContainer { .ratingContainer {
@include font-size(1.5rem); @include font-size(1.5rem);
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
} }
.ratingControl { .ratingControl {
@include font-size(1.5rem); @include font-size(1.5rem);
display: inline-flex; display: inline-flex;
margin-left: 1em; margin-left: 1em;
vertical-align: middle; vertical-align: middle;
@ -35,10 +37,11 @@
} }
.subscribersCounter { .subscribersCounter {
@include font-size(1rem);
background: #fff; background: #fff;
border: 2px solid #000; border: 2px solid #000;
border-radius: 100%; border-radius: 100%;
@include font-size(1rem);
font-weight: bold; font-weight: bold;
height: 32px; height: 32px;
line-height: 30px; line-height: 30px;

View File

@ -6,8 +6,6 @@ import { AuthorFull } from '../Author/Full'
import { t } from '../../utils/intl' import { t } from '../../utils/intl'
import { useAuthorsStore } from '../../stores/zine/authors' import { useAuthorsStore } from '../../stores/zine/authors'
import { loadShouts, useArticlesStore } from '../../stores/zine/articles' import { loadShouts, useArticlesStore } from '../../stores/zine/articles'
import { useTopicsStore } from '../../stores/zine/topics'
import { useRouter } from '../../stores/router' import { useRouter } from '../../stores/router'
import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll' import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
import { splitToPages } from '../../utils/splitToPages' import { splitToPages } from '../../utils/splitToPages'
@ -18,7 +16,6 @@ import { clsx } from 'clsx'
import Userpic from '../Author/Userpic' import Userpic from '../Author/Userpic'
import { Popup } from '../_shared/Popup' import { Popup } from '../_shared/Popup'
import { AuthorCard } from '../Author/Card' import { AuthorCard } from '../Author/Card'
import { loadReactionsBy, REACTIONS_AMOUNT_PER_PAGE } from '../../stores/zine/reactions'
import { apiClient } from '../../utils/apiClient' import { apiClient } from '../../utils/apiClient'
import { Comment } from '../Article/Comment' import { Comment } from '../Article/Comment'
@ -43,7 +40,6 @@ export const AuthorView = (props: AuthorProps) => {
shouts: props.shouts shouts: props.shouts
}) })
const { authorEntities } = useAuthorsStore({ authors: [props.author] }) const { authorEntities } = useAuthorsStore({ authors: [props.author] })
const { topicsByAuthor } = useTopicsStore()
const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false) const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false)
const author = createMemo(() => authorEntities()[props.authorSlug]) const author = createMemo(() => authorEntities()[props.authorSlug])

View File

@ -1,5 +1,6 @@
.feedNavigation { .feedNavigation {
@include font-size(1.5rem); @include font-size(1.5rem);
font-weight: 500; font-weight: 500;
h4 { h4 {
@ -40,6 +41,7 @@
.feedAside { .feedAside {
h4 { h4 {
@include font-size(2.2rem); @include font-size(2.2rem);
font-weight: bold; font-weight: bold;
margin-bottom: 2.4rem; margin-bottom: 2.4rem;
text-transform: lowercase; text-transform: lowercase;
@ -69,7 +71,7 @@
a { a {
position: static; position: static;
&:before { &::before {
content: ''; content: '';
height: 100%; height: 100%;
left: 0; left: 0;
@ -88,6 +90,7 @@
ul { ul {
@include font-size(1.4rem); @include font-size(1.4rem);
font-weight: bold; font-weight: bold;
margin: 1rem 0 0; margin: 1rem 0 0;
line-height: 1.4; line-height: 1.4;
@ -106,6 +109,7 @@
.comment { .comment {
@include font-size(1.5rem); @include font-size(1.5rem);
line-height: 1.4; line-height: 1.4;
margin-bottom: 2.4rem; margin-bottom: 2.4rem;
@ -126,6 +130,7 @@
.commentArticleTitle { .commentArticleTitle {
@include font-size(1.2rem); @include font-size(1.2rem);
line-clamp: 1; line-clamp: 1;
-webkit-line-clamp: 1; -webkit-line-clamp: 1;
} }

View File

@ -2,7 +2,6 @@ import { createEffect, createMemo, createSignal, For, onMount, Show } from 'soli
import '../../styles/Feed.scss' import '../../styles/Feed.scss'
import stylesBeside from '../../components/Feed/Beside.module.scss' import stylesBeside from '../../components/Feed/Beside.module.scss'
import { Icon } from '../_shared/Icon' import { Icon } from '../_shared/Icon'
import { TopicCard } from '../Topic/Card'
import { ArticleCard } from '../Feed/Card' import { ArticleCard } from '../Feed/Card'
import { AuthorCard } from '../Author/Card' import { AuthorCard } from '../Author/Card'
import { t } from '../../utils/intl' import { t } from '../../utils/intl'
@ -14,12 +13,9 @@ import { useAuthorsStore } from '../../stores/zine/authors'
import { useTopicsStore } from '../../stores/zine/topics' import { useTopicsStore } from '../../stores/zine/topics'
import { useTopAuthorsStore } from '../../stores/zine/topAuthors' import { useTopAuthorsStore } from '../../stores/zine/topAuthors'
import { useSession } from '../../context/session' import { useSession } from '../../context/session'
import stylesArticle from '../../styles/Article.module.scss'
import stylesTopic from '../Feed/CardTopic.module.scss' import stylesTopic from '../Feed/CardTopic.module.scss'
import styles from './Feed.module.scss' import styles from './Feed.module.scss'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import Userpic from '../Author/Userpic'
import type { Author } from '../../graphql/types.gen'
// const AUTHORSHIP_REACTIONS = [ // const AUTHORSHIP_REACTIONS = [
// ReactionKind.Accept, // ReactionKind.Accept,

View File

@ -22,12 +22,12 @@ type InboxSearchParams = {
initChat: string initChat: string
chat: string chat: string
} }
const userSearch = (array: Author[], keyword: string) => { // const userSearch = (array: Author[], keyword: string) => {
const searchTerm = keyword.toLowerCase() // const searchTerm = keyword.toLowerCase()
return array.filter((value) => { // return array.filter((value) => {
return value.name.toLowerCase().match(new RegExp(searchTerm, 'g')) // return value.name.toLowerCase().match(new RegExp(searchTerm, 'g'))
}) // })
} // }
export const InboxView = () => { export const InboxView = () => {
const { const {

View File

@ -1,4 +1,4 @@
import { blockTypeItem, icons, MenuItem, wrapItem } from 'prosemirror-menu' import { icons, MenuItem, wrapItem } from 'prosemirror-menu'
import { toggleMark } from 'prosemirror-commands' import { toggleMark } from 'prosemirror-commands'
const markActive = (state, type) => { const markActive = (state, type) => {

View File

@ -12,7 +12,7 @@ export const schema = new Schema({
paragraph: { paragraph: {
content: 'inline*', content: 'inline*',
group: 'block', group: 'block',
toDOM: function toDOM(node) { toDOM: function toDOM() {
return ['p', { class: 'paragraph' }, 0] return ['p', { class: 'paragraph' }, 0]
} }
}, },

View File

@ -18,6 +18,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.buttons { .buttons {
gap: 10px; gap: 10px;
} }

View File

@ -27,6 +27,7 @@
&.bordered { &.bordered {
@include font-size(1.6rem); @include font-size(1.6rem);
border: 2px solid #000; border: 2px solid #000;
padding: 2.4rem; padding: 2.4rem;
@ -41,7 +42,8 @@
&.tiny { &.tiny {
@include font-size(1.4rem); @include font-size(1.4rem);
box-shadow: 0 4px 60px rgba(0, 0, 0, 0.1);
box-shadow: 0 4px 60px rgb(0 0 0 / 10%);
padding: 1rem; padding: 1rem;
ul li { ul li {

View File

@ -2,7 +2,6 @@ import { createEffect, createSignal, JSX, Show } from 'solid-js'
import styles from './Popup.module.scss' import styles from './Popup.module.scss'
import { clsx } from 'clsx' import { clsx } from 'clsx'
import { useOutsideClickHandler } from '../../../utils/useOutsideClickHandler' import { useOutsideClickHandler } from '../../../utils/useOutsideClickHandler'
import { set } from 'husky'
type HorizontalAnchor = 'center' | 'right' type HorizontalAnchor = 'center' | 'right'

View File

@ -1,5 +1,5 @@
import { Accessor, createMemo, JSX } from 'solid-js' import type { Accessor, JSX } from 'solid-js'
import { createContext, createSignal, useContext } from 'solid-js' import { createContext, createSignal, useContext, createMemo } from 'solid-js'
import { createChatClient } from '../graphql/privateGraphQLClient' import { createChatClient } from '../graphql/privateGraphQLClient'
import type { Chat, Message, MutationCreateMessageArgs } from '../graphql/types.gen' import type { Chat, Message, MutationCreateMessageArgs } from '../graphql/types.gen'
import { apiClient } from '../utils/apiClient' import { apiClient } from '../utils/apiClient'

View File

@ -3,39 +3,7 @@ import { createRouter, createSearchParams } from '@nanostores/router'
import { isServer } from 'solid-js/web' import { isServer } from 'solid-js/web'
import { useStore } from '@nanostores/solid' import { useStore } from '@nanostores/solid'
// TODO: more export const ROUTES = {
export interface Routes {
home: void
connect: void
create: void
createSettings: void
topics: void
topic: 'slug'
authors: void
author: 'slug'
feed: void
article: 'slug'
search: 'q'
dogma: void
discussionRules: void
guide: void
help: void
manifest: void
partners: void
principles: void
projects: void
termsOfUse: void
thanks: void
expo: 'layout'
inbox: void // TODO: добавить ID текущего юзера
profileSettings: void
profileSecurity: void
profileSubscriptions: void
}
const searchParamsStore = createSearchParams()
const routerStore = createRouter<Routes>(
{
home: '/', home: '/',
inbox: '/inbox', inbox: '/inbox',
connect: '/connect', connect: '/connect',
@ -62,12 +30,13 @@ const routerStore = createRouter<Routes>(
profileSettings: '/profile/settings', profileSettings: '/profile/settings',
profileSecurity: '/profile/security', profileSecurity: '/profile/security',
profileSubscriptions: '/profile/subscriptions' profileSubscriptions: '/profile/subscriptions'
}, } as const
{
const searchParamsStore = createSearchParams()
const routerStore = createRouter(ROUTES, {
search: false, search: false,
links: false links: false
} })
)
export const router = routerStore export const router = routerStore

View File

@ -1,6 +1,6 @@
import type { Reaction, ReactionInput } from '../../graphql/types.gen' import type { Reaction, ReactionInput } from '../../graphql/types.gen'
import { apiClient } from '../../utils/apiClient' import { apiClient } from '../../utils/apiClient'
import { createEffect, createSignal } from 'solid-js' import { createSignal } from 'solid-js'
// TODO: import { roomConnect } from '../../utils/p2p' // TODO: import { roomConnect } from '../../utils/p2p'
export const REACTIONS_AMOUNT_PER_PAGE = 100 export const REACTIONS_AMOUNT_PER_PAGE = 100

View File

@ -56,9 +56,10 @@
} }
.feed-filter { .feed-filter {
@include font-size(1.7rem);
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@include font-size(1.7rem);
font-weight: 500; font-weight: 500;
list-style: none; list-style: none;
margin: 0 0 1.6rem; margin: 0 0 1.6rem;

View File

@ -38,7 +38,7 @@ main {
padding: 10px; padding: 10px;
height: calc(100% - 10px); height: calc(100% - 10px);
$fade-height: 10px; $fadeHeight: 10px;
.sidebarHeader { .sidebarHeader {
display: flex; display: flex;
@ -50,7 +50,7 @@ main {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
position: relative; position: relative;
padding: $fade-height 0; padding: $fadeHeight 0;
&::before, &::before,
&::after { &::after {
@ -59,17 +59,17 @@ main {
width: 100%; width: 100%;
right: 0; right: 0;
z-index: 1; z-index: 1;
height: $fade-height; height: $fadeHeight;
} }
&::before { &::before {
top: 0; top: 0;
background: linear-gradient(white, transparent $fade-height); background: linear-gradient(white, transparent $fadeHeight);
} }
&::after { &::after {
bottom: 0; bottom: 0;
background: linear-gradient(transparent, white $fade-height); background: linear-gradient(transparent, white $fadeHeight);
} }
.dialogs { .dialogs {
@ -207,6 +207,7 @@ main {
flex: 1; flex: 1;
overflow: auto; overflow: auto;
position: relative; position: relative;
.messagesContainer { .messagesContainer {
left: 0; left: 0;
height: 100%; height: 100%;
@ -216,6 +217,7 @@ main {
width: 100%; width: 100%;
scroll-behavior: smooth; scroll-behavior: smooth;
} }
.conversation__date { .conversation__date {
position: relative; position: relative;
text-align: center; text-align: center;