diff --git a/astro.config.ts b/astro.config.ts index c2ca1005..46e5c4aa 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -12,7 +12,7 @@ const getDevCssClassPrefix = (filename: string): string => { return filename .slice(filename.indexOf(PATH_PREFIX) + PATH_PREFIX.length) .replace('.module.scss', '') - .replace(/[/?\\]/g, '-') + .replaceAll(/[/?\\]/g, '-') } const devGenerateScopedName = (name: string, filename: string, css: string) => diff --git a/src/components/Article/Comment.module.scss b/src/components/Article/Comment.module.scss index 50064a39..e1ae44ba 100644 --- a/src/components/Article/Comment.module.scss +++ b/src/components/Article/Comment.module.scss @@ -54,6 +54,7 @@ .commentControls { @include font-size(1.2rem); + margin-bottom: 0.5em; } @@ -120,6 +121,7 @@ .commentBody { @include font-size(1.5rem); + line-height: 1.47; } @@ -196,6 +198,7 @@ button { @include font-size(1.6rem); + margin-left: 1.2rem; } } diff --git a/src/components/Article/RatingControl.tsx b/src/components/Article/RatingControl.tsx index a052c5f7..6e560222 100644 --- a/src/components/Article/RatingControl.tsx +++ b/src/components/Article/RatingControl.tsx @@ -1,6 +1,5 @@ import styles from './RatingControl.module.scss' import { clsx } from 'clsx' -import { Icon } from '../_shared/Icon' interface RatingControlProps { rating?: number diff --git a/src/components/Author/Card.module.scss b/src/components/Author/Card.module.scss index ef8a6339..19df71b5 100644 --- a/src/components/Author/Card.module.scss +++ b/src/components/Author/Card.module.scss @@ -265,6 +265,7 @@ .authorComments { .authorName { @include font-size(1.2rem); + margin-bottom: 0; } diff --git a/src/components/Inbox/CreateModalContent.module.scss b/src/components/Inbox/CreateModalContent.module.scss index fc1b2f1b..ef6a7115 100644 --- a/src/components/Inbox/CreateModalContent.module.scss +++ b/src/components/Inbox/CreateModalContent.module.scss @@ -1,5 +1,6 @@ .CreateModalContent { padding: 24px; + .footer { padding-top: 12px; display: flex; diff --git a/src/components/Inbox/DialogAvatar.module.scss b/src/components/Inbox/DialogAvatar.module.scss index e9bfbb58..a5642b6f 100644 --- a/src/components/Inbox/DialogAvatar.module.scss +++ b/src/components/Inbox/DialogAvatar.module.scss @@ -18,6 +18,7 @@ border-radius: 50%; border: 3px solid #fff; } + .imageHolder { background-size: cover; width: 100%; @@ -29,9 +30,6 @@ .letter { display: block; border-radius: 100%; - } - - .letter { margin-bottom: -2px; font-weight: 500; font-size: 18px; diff --git a/src/components/Inbox/DialogCard.tsx b/src/components/Inbox/DialogCard.tsx index c09a2fec..fc804bb8 100644 --- a/src/components/Inbox/DialogCard.tsx +++ b/src/components/Inbox/DialogCard.tsx @@ -1,4 +1,4 @@ -import { Show, Switch, Match, createMemo, For } from 'solid-js' +import { Show, Switch, Match, createMemo } from 'solid-js' import DialogAvatar from './DialogAvatar' import type { ChatMember } from '../../graphql/types.gen' import GroupDialogAvatar from './GroupDialogAvatar' diff --git a/src/components/Inbox/GroupDialogAvatar.module.scss b/src/components/Inbox/GroupDialogAvatar.module.scss index feb5ea84..a89ba931 100644 --- a/src/components/Inbox/GroupDialogAvatar.module.scss +++ b/src/components/Inbox/GroupDialogAvatar.module.scss @@ -2,6 +2,7 @@ position: relative; height: 40px; width: 40px; + .grouped { position: absolute; diff --git a/src/components/Inbox/Message.module.scss b/src/components/Inbox/Message.module.scss index baa38207..1c9e3d75 100644 --- a/src/components/Inbox/Message.module.scss +++ b/src/components/Inbox/Message.module.scss @@ -20,6 +20,7 @@ a { color: inherit; text-decoration: underline; + &:hover { color: inherit; } @@ -46,6 +47,7 @@ line-height: 20px; } } + &.own { .body { justify-content: flex-end; @@ -54,6 +56,7 @@ background: #000; color: #fff; } + .time { text-align: right; } diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx index 64bccb0e..86e46b8b 100644 --- a/src/components/Nav/HeaderAuth.tsx +++ b/src/components/Nav/HeaderAuth.tsx @@ -3,7 +3,7 @@ import { clsx } from 'clsx' import { useRouter } from '../../stores/router' import { t } from '../../utils/intl' import { Icon } from '../_shared/Icon' -import { createEffect, createSignal, Show } from 'solid-js' +import { createSignal, Show } from 'solid-js' import Notifications from './Notifications' import { ProfilePopup } from './ProfilePopup' import Userpic from '../Author/Userpic' diff --git a/src/components/Nav/Modal.tsx b/src/components/Nav/Modal.tsx index 51b55eac..2bc41fb3 100644 --- a/src/components/Nav/Modal.tsx +++ b/src/components/Nav/Modal.tsx @@ -17,7 +17,7 @@ interface ModalProps { export const Modal = (props: ModalProps) => { const { modal } = useModalStore() - const backdropClick = (event: Event) => { + const backdropClick = () => { hideModal() } diff --git a/src/components/Pages/profile/ProfileSecurityPage.tsx b/src/components/Pages/profile/ProfileSecurityPage.tsx index d0a07515..b2344f2b 100644 --- a/src/components/Pages/profile/ProfileSecurityPage.tsx +++ b/src/components/Pages/profile/ProfileSecurityPage.tsx @@ -72,7 +72,7 @@ export const ProfileSecurityPage = (props: PageProps) => {
Google

- @@ -82,7 +82,7 @@ export const ProfileSecurityPage = (props: PageProps) => {

VK

- @@ -92,7 +92,7 @@ export const ProfileSecurityPage = (props: PageProps) => {

Facebook

- diff --git a/src/components/Pages/profile/Settings.module.scss b/src/components/Pages/profile/Settings.module.scss index dca79dc8..1ae1cade 100644 --- a/src/components/Pages/profile/Settings.module.scss +++ b/src/components/Pages/profile/Settings.module.scss @@ -9,6 +9,7 @@ h4 { h5 { @include font-size(1.7rem); + margin: 0 0 0.8rem; } diff --git a/src/components/Topic/Card.tsx b/src/components/Topic/Card.tsx index 5dcf8c23..8597622c 100644 --- a/src/components/Topic/Card.tsx +++ b/src/components/Topic/Card.tsx @@ -1,6 +1,6 @@ import { capitalize } from '../../utils' import styles from './Card.module.scss' -import { createEffect, createMemo, createSignal, Show } from 'solid-js' +import { createMemo, createSignal, Show } from 'solid-js' import type { Topic } from '../../graphql/types.gen' import { FollowingEntity } from '../../graphql/types.gen' import { t } from '../../utils/intl' @@ -8,7 +8,6 @@ import { follow, unfollow } from '../../stores/zine/common' import { getLogger } from '../../utils/logger' import { clsx } from 'clsx' import { useSession } from '../../context/session' -import { StatMetrics } from '../_shared/StatMetrics' import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient' const log = getLogger('TopicCard') diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index ed81d75c..b17dd9be 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -29,7 +29,7 @@ const userSearch = (array: Author[], keyword: string) => { export const InboxView = () => { const { chats, - actions: { loadChats, setListener } + actions: { loadChats } // setListener } = useInbox() const [messages, setMessages] = createSignal([]) const [recipients, setRecipients] = createSignal([]) diff --git a/src/components/_shared/SearchField.tsx b/src/components/_shared/SearchField.tsx index f90c98c8..e70b424e 100644 --- a/src/components/_shared/SearchField.tsx +++ b/src/components/_shared/SearchField.tsx @@ -1,7 +1,7 @@ import styles from './SearchField.module.scss' import { Icon } from './Icon' import { t } from '../../utils/intl' -import clsx from 'clsx' +import { clsx } from 'clsx' type SearchFieldProps = { onChange: (value: string) => void diff --git a/src/components/_shared/Slider.tsx b/src/components/_shared/Slider.tsx index 6b2a737e..4ce2d38b 100644 --- a/src/components/_shared/Slider.tsx +++ b/src/components/_shared/Slider.tsx @@ -4,7 +4,7 @@ import 'swiper/scss' import 'swiper/scss/navigation' import 'swiper/scss/pagination' import './Slider.scss' -import { createEffect, createMemo, createSignal, Show, For, JSX } from 'solid-js' +import { createEffect, createSignal, JSX } from 'solid-js' import { Icon } from './Icon' interface SliderProps { diff --git a/src/graphql/privateGraphQLClient.ts b/src/graphql/privateGraphQLClient.ts index f66eabff..82ad3480 100644 --- a/src/graphql/privateGraphQLClient.ts +++ b/src/graphql/privateGraphQLClient.ts @@ -8,18 +8,18 @@ import { } from '@urql/core' // import { createClient as createSSEClient } from 'graphql-sse' import { createClient as createWSClient } from 'graphql-ws' -// import { devtoolsExchange } from '@urql/devtools' +import { devtoolsExchange } from '@urql/devtools' import { isDev, apiBaseUrl } from '../utils/config' // import { cache } from './cache' const TOKEN_LOCAL_STORAGE_KEY = 'token' const exchanges: Exchange[] = [dedupExchange, fetchExchange] -/* - if (isDev) { + +if (isDev) { exchanges.unshift(devtoolsExchange) } -*/ + export const getToken = (): string => { return localStorage.getItem(TOKEN_LOCAL_STORAGE_KEY) } diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index 856674cb..0239ba2e 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -22,6 +22,7 @@ export type AuthResult = { } export type Author = { + about?: Maybe bio?: Maybe caption?: Maybe id: Scalars['Int'] @@ -54,9 +55,9 @@ export type AuthorsBy = { } export type Chat = { - admins?: Maybe>> + admins?: Maybe>> createdAt: Scalars['Int'] - createdBy: Scalars['Int'] + createdBy: Scalars['String'] description?: Maybe id: Scalars['String'] members?: Maybe>> @@ -65,7 +66,7 @@ export type Chat = { title?: Maybe unread?: Maybe updatedAt: Scalars['Int'] - users?: Maybe>> + users?: Maybe>> } export type ChatInput = { @@ -78,7 +79,6 @@ export type ChatMember = { id: Scalars['Int'] lastSeen?: Maybe name: Scalars['String'] - online?: Maybe slug: Scalars['String'] userpic?: Maybe } @@ -140,13 +140,12 @@ export type LoadShoutsOptions = { } export type Message = { - author: Scalars['Int'] + author: Scalars['String'] body: Scalars['String'] chatId: Scalars['String'] createdAt: Scalars['Int'] id: Scalars['Int'] replyTo?: Maybe - seen?: Maybe updatedAt?: Maybe } @@ -355,7 +354,6 @@ export type Query = { loadShout?: Maybe loadShouts: Array> markdownBody: Scalars['String'] - searchMessages: Result searchRecipients: Result signIn: AuthResult signOut: AuthResult @@ -420,12 +418,6 @@ export type QueryMarkdownBodyArgs = { body: Scalars['String'] } -export type QuerySearchMessagesArgs = { - by: MessagesBy - limit?: InputMaybe - offset?: InputMaybe -} - export type QuerySearchRecipientsArgs = { limit?: InputMaybe offset?: InputMaybe @@ -630,7 +622,14 @@ export type Stat = { export type Subscription = { newMessage: Message - collabUpdate: Reaction + onlineUpdated: Array + reactionUpdated: ReactionUpdating + shoutUpdated: Shout + userUpdated: User +} + +export type SubscriptionNewMessageArgs = { + chats?: InputMaybe> } export type SubscriptionReactionUpdatedArgs = { diff --git a/src/styles/Article.module.scss b/src/styles/Article.module.scss index e292a237..82ff7331 100644 --- a/src/styles/Article.module.scss +++ b/src/styles/Article.module.scss @@ -60,6 +60,7 @@ img { .shoutMediaBody { display: block; + audio { display: inline-block; } @@ -258,6 +259,7 @@ img { .commentsHeader { @include font-size(2.4rem); + margin-bottom: 1em; } @@ -287,6 +289,7 @@ img { button { @include font-size(1.5rem); + border-radius: 0.8rem; margin-right: 1.2rem; padding: 1.1rem 1.2rem 0.9rem; diff --git a/src/styles/Inbox.scss b/src/styles/Inbox.scss index f793dcc3..c35cc6a8 100644 --- a/src/styles/Inbox.scss +++ b/src/styles/Inbox.scss @@ -111,6 +111,7 @@ main { margin-right: 1em; color: #696969; cursor: pointer; + &.selected { span { border-bottom: 3px solid; @@ -134,10 +135,10 @@ main { .message-form { background: #fff; - padding: 2px 0 12px 0; + padding: 2px 0 12px; .wrapper { - border: 2px solid #cccccc; + border: 2px solid #ccc; border-radius: 16px; padding: 4px; display: flex; @@ -233,9 +234,9 @@ main { } time { - background: #fff; @include font-size(1.5rem); + background: #fff; color: #9fa1a7; padding: 0 0.5em; } diff --git a/src/styles/app.scss b/src/styles/app.scss index 91400adc..b43bc1cb 100644 --- a/src/styles/app.scss +++ b/src/styles/app.scss @@ -85,8 +85,8 @@ h2 { color: #fff; margin-left: -0.15em; padding: 0 0.15em; - box-decoration-break: clone; -webkit-box-decoration-break: clone; + box-decoration-break: clone; &::selection { background: #fff; @@ -804,5 +804,6 @@ details { .description { @include font-size(1.4rem); + color: rgba(0 0 0 / 40%); } diff --git a/src/utils/apiClient.ts b/src/utils/apiClient.ts index 80166d3b..e9b8823b 100644 --- a/src/utils/apiClient.ts +++ b/src/utils/apiClient.ts @@ -12,7 +12,6 @@ import type { MutationCreateMessageArgs, Chat, QueryLoadRecipientsArgs, - User, ProfileInput } from '../graphql/types.gen' import { publicGraphQLClient } from '../graphql/publicGraphQLClient' diff --git a/src/utils/groupby.ts b/src/utils/groupby.ts index 8ccbaa0a..85a7a83b 100644 --- a/src/utils/groupby.ts +++ b/src/utils/groupby.ts @@ -4,7 +4,7 @@ export const groupByName = (arr: Author[]) => { return arr.reduce( (acc, tt) => { let c = (tt.name || '') - .replace(/[^\d A-Za-zА-я]/g, '') + .replaceAll(/[^\d A-Za-zА-я]/g, '') .split(' ') .pop() .slice(0, 1) @@ -24,7 +24,7 @@ export const groupByTitle = (arr: (Shout | Topic)[]) => { return arr.reduce( (acc, tt) => { let c = (tt.title || '') - .replace(/[^\d A-Za-zА-я]/g, '') + .replaceAll(/[^\d A-Za-zА-я]/g, '') .slice(0, 1) .toUpperCase() if (/[^А-я]/.test(c)) c = 'A-Z'