diff --git a/package-lock.json b/package-lock.json index 93dd7891..dfa4d242 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "@solid-primitives/storage": "^1.3.7", "@solid-primitives/upload": "^0.0.109", "@solidjs/meta": "^0.28.2", + "@thisbeyond/solid-select": "^0.13.0", "@tiptap/core": "^2.0.0-beta.220", "@tiptap/extension-blockquote": "^2.0.0-beta.220", "@tiptap/extension-bold": "^2.0.0-beta.220", @@ -5549,6 +5550,15 @@ "solid-js": ">=1.4.0" } }, + "node_modules/@thisbeyond/solid-select": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@thisbeyond/solid-select/-/solid-select-0.13.0.tgz", + "integrity": "sha512-eION+Xf8TGLs1NZrvRo1NRKOl4plYMbY7UswHhh5bEUY8oMltjrBhUWF0hzaFViEc1zZpkCQyafaD89iofG6Tg==", + "dev": true, + "peerDependencies": { + "solid-js": "^1.5" + } + }, "node_modules/@tiptap/core": { "version": "2.0.0-beta.220", "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.220.tgz", @@ -27776,6 +27786,13 @@ "dev": true, "requires": {} }, + "@thisbeyond/solid-select": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@thisbeyond/solid-select/-/solid-select-0.13.0.tgz", + "integrity": "sha512-eION+Xf8TGLs1NZrvRo1NRKOl4plYMbY7UswHhh5bEUY8oMltjrBhUWF0hzaFViEc1zZpkCQyafaD89iofG6Tg==", + "dev": true, + "requires": {} + }, "@tiptap/core": { "version": "2.0.0-beta.220", "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.220.tgz", diff --git a/package.json b/package.json index 10507782..9b532377 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "@solid-primitives/storage": "^1.3.7", "@solid-primitives/upload": "^0.0.109", "@solidjs/meta": "^0.28.2", + "@thisbeyond/solid-select": "^0.13.0", "@tiptap/core": "^2.0.0-beta.220", "@tiptap/extension-blockquote": "^2.0.0-beta.220", "@tiptap/extension-bold": "^2.0.0-beta.220", diff --git a/public/icons/bookmark-x.svg b/public/icons/bookmark-x.svg index ab24ac7c..c5670137 100644 --- a/public/icons/bookmark-x.svg +++ b/public/icons/bookmark-x.svg @@ -1,4 +1,3 @@ - - + + diff --git a/public/icons/bookmark.svg b/public/icons/bookmark.svg index ab24ac7c..c5670137 100644 --- a/public/icons/bookmark.svg +++ b/public/icons/bookmark.svg @@ -1,4 +1,3 @@ - - + + diff --git a/public/icons/comment.svg b/public/icons/comment.svg index 9ea76718..54fdc046 100644 --- a/public/icons/comment.svg +++ b/public/icons/comment.svg @@ -1,4 +1,3 @@ - - + + diff --git a/public/icons/feed-all.svg b/public/icons/feed-all.svg index 91e4730a..bf43645b 100644 --- a/public/icons/feed-all.svg +++ b/public/icons/feed-all.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/icons/feed-collaborate.svg b/public/icons/feed-collaborate.svg index 900af627..624212bc 100644 --- a/public/icons/feed-collaborate.svg +++ b/public/icons/feed-collaborate.svg @@ -1,11 +1,3 @@ - - - - - - - - - - + + diff --git a/public/icons/feed-discussion.svg b/public/icons/feed-discussion.svg index b551ac5e..33487b34 100644 --- a/public/icons/feed-discussion.svg +++ b/public/icons/feed-discussion.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/icons/feed-drafts.svg b/public/icons/feed-drafts.svg index 77aa04bc..09f21898 100644 --- a/public/icons/feed-drafts.svg +++ b/public/icons/feed-drafts.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/icons/feed-my.svg b/public/icons/feed-my.svg index 51a98763..0f3b6ab3 100644 --- a/public/icons/feed-my.svg +++ b/public/icons/feed-my.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/icons/feed-notifications.svg b/public/icons/feed-notifications.svg index ad127830..18f1f252 100644 --- a/public/icons/feed-notifications.svg +++ b/public/icons/feed-notifications.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/icons/pencil-outline.svg b/public/icons/pencil-outline.svg index 95eda09a..b03787a4 100644 --- a/public/icons/pencil-outline.svg +++ b/public/icons/pencil-outline.svg @@ -1,4 +1,3 @@ - - + + diff --git a/public/icons/share-outline.svg b/public/icons/share-outline.svg index a12b4c26..75d67fea 100644 --- a/public/icons/share-outline.svg +++ b/public/icons/share-outline.svg @@ -1,3 +1,3 @@ - - + + diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index d78ce69e..acc42485 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -238,5 +238,9 @@ "Invalid url format": "Invalid url format", "Headers": "Headers", "Quotes": "Quotes", - "Lists": "Lists" + "Lists": "Lists", + "Bookmarks": "Bookmarks", + "Logout": "Logout", + "This comment has not yet been rated": "This comment has not yet been rated", + "This post has not been rated yet": "This post has not been rated yet" } diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 1839ee0c..bde0c4d6 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -256,5 +256,9 @@ "Invalid url format": "Неверный формат ссылки", "Headers": "Заголовки", "Quotes": "Цитаты", - "Lists": "Списки" + "Lists": "Списки", + "Bookmarks": "Закладки", + "Logout": "Выход", + "This comment has not yet been rated": "Этот комментарий еще пока никто не оценил", + "This post has not been rated yet": "Эту публикацию еще пока никто не оценил" } diff --git a/src/components/App.tsx b/src/components/App.tsx index 080f58c2..3cc6d408 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -34,7 +34,6 @@ import { SessionProvider } from '../context/session' import { ProfileSettingsPage } from '../pages/profile/profileSettings.page' import { ProfileSecurityPage } from '../pages/profile/profileSecurity.page' import { ProfileSubscriptionsPage } from '../pages/profile/profileSubscriptions.page' -import { CreateSettingsPage } from '../pages/createSettings.page' import { SnackbarProvider } from '../context/snackbar' import { LocalizeProvider } from '../context/localize' @@ -46,7 +45,7 @@ const pagesMap: Record> = { expo: LayoutShoutsPage, connect: ConnectPage, create: CreatePage, - createSettings: CreateSettingsPage, + createSettings: CreatePage, home: HomePage, topics: AllTopicsPage, topic: TopicPage, diff --git a/src/components/Article/Comment.module.scss b/src/components/Article/Comment.module.scss index 96cdf800..1ea32cec 100644 --- a/src/components/Article/Comment.module.scss +++ b/src/components/Article/Comment.module.scss @@ -1,16 +1,17 @@ .comment { - margin: 0 -2.4rem 0.5em; - padding: 0.8rem 2.4rem; + margin: 0.5em 0; + padding: 1rem; transition: background-color 0.3s; position: relative; list-style: none; - @include media-breakpoint-down(sm) { - margin-right: -1.2rem; + &.isNew { + border-radius: 6px; + background: rgba(38, 56, 217, 0.05); } - &:last-child { - margin-bottom: 0; + @include media-breakpoint-down(sm) { + margin-right: -1.2rem; } .comment { @@ -196,42 +197,10 @@ .commentDetails { display: flex; + padding: 1rem 0.2rem 0; margin-bottom: 1.2rem; } -.commentRating { - align-items: center; - display: flex; - font-weight: bold; -} - -.commentRatingValue { - padding: 0 0.3em; -} - -.commentRatingPositive { - color: #2bb452; -} - -.commentRatingNegative { - color: #d00820; -} - -.commentRatingControl { - border-left: 6px solid transparent; - border-right: 6px solid transparent; - height: 0; - width: 0; -} - -.commentRatingControlUp { - border-bottom: 8px solid rgb(0 0 0 / 40%); -} - -.commentRatingControlDown { - border-top: 8px solid rgb(0 0 0 / 40%); -} - .compactUserpic { height: 28px; width: 28px; diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index 63ef6f9e..21942340 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -13,6 +13,8 @@ import { useReactions } from '../../context/reactions' import { useSnackbar } from '../../context/snackbar' import { ShowIfAuthenticated } from '../_shared/ShowIfAuthenticated' import { useLocalize } from '../../context/localize' +import { CommentRatingControl } from './CommentRatingControl' + const CommentEditor = lazy(() => import('../_shared/CommentEditor')) type Props = { @@ -20,6 +22,7 @@ type Props = { compact?: boolean isArticleAuthor?: boolean sortedComments?: Reaction[] + lastSeen?: Date } export const Comment = (props: Props) => { @@ -37,7 +40,7 @@ export const Comment = (props: Props) => { actions: { showSnackbar } } = useSnackbar() - const canEdit = createMemo(() => props.comment.createdBy?.slug === session()?.user?.slug) + const isCommentAuthor = createMemo(() => props.comment.createdBy?.slug === session()?.user?.slug) const comment = createMemo(() => props.comment) const body = createMemo(() => (comment().body || '').trim()) @@ -90,8 +93,9 @@ export const Comment = (props: Props) => { } } + const createdAt = new Date(comment()?.createdAt) return ( -
  • +
  • props.lastSeen })}>
    {
    -
    0, - [styles.commentRatingNegative]: comment().stat.rating < 0 - }} - > -
    +
    @@ -169,7 +163,7 @@ export const Comment = (props: Props) => { {loading() ? t('Loading') : t('Reply')} - +
    + } + variant="tiny" + > + + + - - - - - +
    + + + + + + +
    -
    - - {(topic) => ( - - )} - -
    +
    + + {(topic) => ( + + )} + +
    -
    - 1}> -

    {t('Authors')}

    -
    - - {(a) => ( -
    - -
    - )} -
    +
    + 1}> +

    {t('Authors')}

    +
    + + {(a) => ( +
    + +
    + )} +
    +
    +
    + + + +
    - - - diff --git a/src/components/Article/ShoutRatingControl.tsx b/src/components/Article/ShoutRatingControl.tsx index 6bb7bfc4..f20f7cd8 100644 --- a/src/components/Article/ShoutRatingControl.tsx +++ b/src/components/Article/ShoutRatingControl.tsx @@ -6,6 +6,8 @@ import { loadShout } from '../../stores/zine/articles' import { useSession } from '../../context/session' import { useReactions } from '../../context/reactions' import { Popup } from '../_shared/Popup' +import { VotersList } from '../_shared/VotersList' +import { useLocalize } from '../../context/localize' interface ShoutRatingControlProps { shout: Shout @@ -13,6 +15,7 @@ interface ShoutRatingControlProps { } export const ShoutRatingControl = (props: ShoutRatingControlProps) => { + const { t } = useLocalize() const { userSlug } = useSession() const { @@ -86,15 +89,10 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { {props.shout.stat.rating}} variant="tiny"> -
      - - {(reaction) => ( -
    • - {reaction.kind === ReactionKind.Like ? <>+1 : <>−1} {reaction.createdBy.name} -
    • - )} -
      -
    +
    - + {/*

    Соавторы

    */} + {/*

    У каждого соавтора можно добавить роль

    */} + {/*
    */} + {/*
    */} + {/* */} + {/* */} + {/*
    */} + {/* */} + {/*
    */} -
    -
    Михаил Драбкин
    -
    - -
    -
    + {/*
    */} + {/*
    Михаил Драбкин
    */} + {/*
    */} + {/* */} + {/*
    */} + {/*
    */}

    Карточка материала на главной

    @@ -96,8 +159,10 @@ export const CreateView = () => { Проверьте ещё раз введённые данные, если всё верно, вы можете сохранить или опубликовать ваш текст

    - - + {/**/} + diff --git a/src/components/Views/Feed.module.scss b/src/components/Views/Feed.module.scss index ca371949..fb6d3c1e 100644 --- a/src/components/Views/Feed.module.scss +++ b/src/components/Views/Feed.module.scss @@ -1,6 +1,5 @@ .feedNavigation { @include font-size(1.5rem); - font-weight: 500; h4 { @@ -19,17 +18,13 @@ } li { - display: flex; - justify-content: space-between; margin: 0 0 1rem; white-space: nowrap; width: 100%; a { - margin-right: 0.5em; - position: relative; - overflow: hidden; - text-overflow: ellipsis; + display: flex; + justify-content: space-between; } } diff --git a/src/components/Views/Feed.tsx b/src/components/Views/Feed.tsx index ee22966f..159d3843 100644 --- a/src/components/Views/Feed.tsx +++ b/src/components/Views/Feed.tsx @@ -82,123 +82,121 @@ export const FeedView = () => { return ( <>
    -
    -
    +
    +
    -
    -
    -
    -
    - -

    - -

    -
    + +
    ) diff --git a/src/components/Views/FourOuFour.tsx b/src/components/Views/FourOuFour.tsx index 6e29f7ec..e35a6448 100644 --- a/src/components/Views/FourOuFour.tsx +++ b/src/components/Views/FourOuFour.tsx @@ -10,20 +10,20 @@ export const FourOuFourView = (_props) => {
    -
    +
    -
    +
    {t('Error')}
    404
    -
    +

    {t(`You've reached a non-existed page`)}

    {t('Try to find another way')}:

    diff --git a/src/components/Views/Inbox.tsx b/src/components/Views/Inbox.tsx index 46d908e3..61af9594 100644 --- a/src/components/Views/Inbox.tsx +++ b/src/components/Views/Inbox.tsx @@ -70,7 +70,7 @@ export const InboxView = () => { } } - // TODO: удалить когда будет готова подписка + /* createEffect(() => { setInterval(async () => { if (!currentDialog()) return @@ -83,7 +83,7 @@ export const InboxView = () => { } }, 2000) }) - + */ onMount(async () => { try { const response = await loadRecipients({ days: 365 }) @@ -171,7 +171,7 @@ export const InboxView = () => {
    -
    +
    -
    +
    { return (
    -
    +
    { placeholder={t('Enter text') + '...'} />
    -
    +
    @@ -94,13 +94,13 @@ export const SearchView = (props: Props) => {
    {(article) => ( -
    +
    )} -
    +
    {t('Load more')} diff --git a/src/components/Views/Topic.tsx b/src/components/Views/Topic.tsx index 7c741b58..d4a2aed1 100644 --- a/src/components/Views/Topic.tsx +++ b/src/components/Views/Topic.tsx @@ -81,7 +81,7 @@ export const TopicView = (props: TopicProps) => {
    -
    +
    • */}
    -
    +
    {`${t('Show')} `} {t('All posts')} diff --git a/src/components/_shared/Slider.tsx b/src/components/_shared/Slider.tsx index a520858e..a4db0a32 100644 --- a/src/components/_shared/Slider.tsx +++ b/src/components/_shared/Slider.tsx @@ -101,7 +101,7 @@ export default (props: SliderProps) => {
    -

    {props.title}

    +

    {props.title}

    { + return ( +
    +
      + 0} + fallback={ +
    • + {props.fallbackMessage} +
    • + } + > + + {(reaction) => ( +
    • + + {reaction.kind === ReactionKind.Like ? ( +
      +1
      + ) : ( +
      −1
      + )} +
    • + )} +
      +
      +
    +
    + ) +} diff --git a/src/components/_shared/VotersList/index.ts b/src/components/_shared/VotersList/index.ts new file mode 100644 index 00000000..a94042b9 --- /dev/null +++ b/src/components/_shared/VotersList/index.ts @@ -0,0 +1 @@ +export { VotersList } from './VotersList' diff --git a/src/context/inbox.tsx b/src/context/inbox.tsx index adaa12b3..8cecb8a4 100644 --- a/src/context/inbox.tsx +++ b/src/context/inbox.tsx @@ -1,6 +1,6 @@ import type { Accessor, JSX } from 'solid-js' import { createContext, createSignal, useContext, createMemo } from 'solid-js' -import { createChatClient } from '../graphql/privateGraphQLClient' +import { createSubClient } from '../graphql/privateGraphQLClient' import type { Chat, Message, MutationCreateMessageArgs } from '../graphql/types.gen' import { apiClient } from '../utils/apiClient' import newMessage from '../graphql/subs/new-message' @@ -29,7 +29,7 @@ export function useInbox() { export const InboxProvider = (props: { children: JSX.Element }) => { const [chats, setChats] = createSignal([]) const [messages, setMessages] = createSignal([]) - const subclient = createMemo(() => createChatClient()) + const subclient = createMemo(() => createSubClient()) const loadChats = async () => { try { const newChats = await apiClient.getChats({ limit: 50, offset: 0 }) @@ -71,8 +71,8 @@ export const InboxProvider = (props: { children: JSX.Element }) => { return chat } - const { unsubscribe } = pipe( - () => subclient().subscription(newMessage, {}), + pipe( + subclient().subscription(newMessage, {}), subscribe((result) => { console.info('[subscription]') console.debug(result) @@ -83,8 +83,8 @@ export const InboxProvider = (props: { children: JSX.Element }) => { createChat, loadChats, getMessages, - sendMessage, - unsubscribe // TODO: call unsubscribe some time! + sendMessage + // unsubscribe // TODO: call unsubscribe some time! } const value: InboxContextType = { chats, messages, actions } diff --git a/src/graphql/privateGraphQLClient.ts b/src/graphql/privateGraphQLClient.ts index 5b414a22..e6a4f4aa 100644 --- a/src/graphql/privateGraphQLClient.ts +++ b/src/graphql/privateGraphQLClient.ts @@ -7,7 +7,7 @@ import { createClient } from '@urql/core' // import { createClient as createSubClient } from 'graphql-sse' -import { createClient as createSubClient } from 'graphql-ws' +import { createClient as createWSClient } from 'graphql-ws' import { devtoolsExchange } from '@urql/devtools' import { isDev, apiBaseUrl } from '../utils/config' // import { cache } from './cache' @@ -55,8 +55,8 @@ const options: ClientOptions = { export const privateGraphQLClient = createClient(options) -export const createChatClient = () => { - const subClient = createSubClient({ +export const createSubClient = () => { + const subClient = createWSClient({ url: apiBaseUrl.replace('http', 'ws') // + '/messages' }) diff --git a/src/graphql/query/article-load.ts b/src/graphql/query/article-load.ts index 43b0dd4a..6bec8004 100644 --- a/src/graphql/query/article-load.ts +++ b/src/graphql/query/article-load.ts @@ -39,6 +39,7 @@ export default gql` viewed reacted rating + commented } } } diff --git a/src/graphql/subs/new-reaction.ts b/src/graphql/subs/new-reaction.ts new file mode 100644 index 00000000..8ffd4cf8 --- /dev/null +++ b/src/graphql/subs/new-reaction.ts @@ -0,0 +1,26 @@ +import { gql } from '@urql/core' + +export default gql` + subscription { + newReactions { + id + body + kind + range + createdAt + replyTo + stat { + rating + } + shout { + id + slug + } + createdBy { + name + slug + userpic + } + } + } +` diff --git a/src/graphql/subs/new-shout.ts b/src/graphql/subs/new-shout.ts new file mode 100644 index 00000000..8172fd63 --- /dev/null +++ b/src/graphql/subs/new-shout.ts @@ -0,0 +1,25 @@ +import { gql } from '@urql/core' + +export default gql` + subscription { + newShout { + id + slug + title + subtitle + body + topics { + # id + title + slug + } + authors { + id + name + slug + userpic + caption + } + } + } +` diff --git a/src/pages/about/discussionRules.page.tsx b/src/pages/about/discussionRules.page.tsx index e3bc8cfe..7f03e424 100644 --- a/src/pages/about/discussionRules.page.tsx +++ b/src/pages/about/discussionRules.page.tsx @@ -10,7 +10,7 @@ export const DiscussionRulesPage = () => { {title}
    -
    +

    diff --git a/src/pages/about/dogma.page.tsx b/src/pages/about/dogma.page.tsx index 76edcd14..229cf16a 100644 --- a/src/pages/about/dogma.page.tsx +++ b/src/pages/about/dogma.page.tsx @@ -7,7 +7,7 @@ export const DogmaPage = () => {
    -
    +

    Редакционные принципы

    Дискурс - журнал с открытой горизонтальной редакцией. Содержание журнала определяется прямым diff --git a/src/pages/about/guide.page.tsx b/src/pages/about/guide.page.tsx index 4479a8f0..6381dc93 100644 --- a/src/pages/about/guide.page.tsx +++ b/src/pages/about/guide.page.tsx @@ -23,7 +23,7 @@ export const GuidePage = () => {

    -
    +
    -
    +

    Как устроен Дискурс

    diff --git a/src/pages/about/help.page.tsx b/src/pages/about/help.page.tsx index 9c629d25..cded23cb 100644 --- a/src/pages/about/help.page.tsx +++ b/src/pages/about/help.page.tsx @@ -22,7 +22,7 @@ export const HelpPage = () => {
    -
    +
    -
    +

    Как вы можете поддержать Дискурс?

    @@ -78,7 +78,7 @@ export const HelpPage = () => { продолжался, пожалуйста, поддержите проект.

    -
    +
    diff --git a/src/pages/about/manifest.page.tsx b/src/pages/about/manifest.page.tsx index 0a2c2863..6fa36ce6 100644 --- a/src/pages/about/manifest.page.tsx +++ b/src/pages/about/manifest.page.tsx @@ -23,7 +23,7 @@ export const ManifestPage = () => {
    -
    +
    -
    +

    Манифест

    diff --git a/src/pages/about/partners.page.tsx b/src/pages/about/partners.page.tsx index 1dd97be0..e96afbb4 100644 --- a/src/pages/about/partners.page.tsx +++ b/src/pages/about/partners.page.tsx @@ -9,7 +9,7 @@ export const PartnersPage = () => { {t('Partners')}
    -
    +

    {t('Partners')}

    diff --git a/src/pages/about/principles.page.tsx b/src/pages/about/principles.page.tsx index e3f15916..88378c9f 100644 --- a/src/pages/about/principles.page.tsx +++ b/src/pages/about/principles.page.tsx @@ -10,7 +10,7 @@ export const PrinciplesPage = () => { {t('Principles')}
    -
    +

    {t('Principles')}

    diff --git a/src/pages/about/projects.page.tsx b/src/pages/about/projects.page.tsx index d84c02ba..a6c7dffe 100644 --- a/src/pages/about/projects.page.tsx +++ b/src/pages/about/projects.page.tsx @@ -9,7 +9,7 @@ export const ProjectsPage = () => { {t('Projects')}
    -
    +

    {t('Projects')}

    diff --git a/src/pages/about/termsOfUse.page.tsx b/src/pages/about/termsOfUse.page.tsx index 64218598..22dda7f5 100644 --- a/src/pages/about/termsOfUse.page.tsx +++ b/src/pages/about/termsOfUse.page.tsx @@ -20,7 +20,7 @@ export const TermsOfUsePage = () => {
    -
    +
    -
    +

    Пользовательское соглашение

    diff --git a/src/pages/about/thanks.page.tsx b/src/pages/about/thanks.page.tsx index 6f57cd10..0569fbe5 100644 --- a/src/pages/about/thanks.page.tsx +++ b/src/pages/about/thanks.page.tsx @@ -14,7 +14,7 @@ export const ThanksPage = () => {
    -
    +

    {title}

    diff --git a/src/pages/connect.page.tsx b/src/pages/connect.page.tsx index f9882458..361e2d8f 100644 --- a/src/pages/connect.page.tsx +++ b/src/pages/connect.page.tsx @@ -5,7 +5,7 @@ export const ConnectPage = () => {
    -
    +

    Предложить идею

    diff --git a/src/pages/createSettings.page.tsx b/src/pages/createSettings.page.tsx deleted file mode 100644 index d2c87be5..00000000 --- a/src/pages/createSettings.page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { PageLayout } from '../components/_shared/PageLayout' - -export const CreateSettingsPage = () => { - return Настройки публикации -} - -export const Page = CreateSettingsPage diff --git a/src/pages/layoutShouts.page.tsx b/src/pages/layoutShouts.page.tsx index fc254427..afda53b3 100644 --- a/src/pages/layoutShouts.page.tsx +++ b/src/pages/layoutShouts.page.tsx @@ -76,7 +76,7 @@ export const LayoutShoutsPage = (props: PageProps) => { const ModeSwitcher = () => (
    -
    +
    • {t('Audio')} @@ -92,7 +92,7 @@ export const LayoutShoutsPage = (props: PageProps) => {
    -
    +
    {`${t('Show')} `} {t('All posts')} diff --git a/src/pages/profile/profileSecurity.page.tsx b/src/pages/profile/profileSecurity.page.tsx index e627be83..e53076d2 100644 --- a/src/pages/profile/profileSecurity.page.tsx +++ b/src/pages/profile/profileSecurity.page.tsx @@ -8,7 +8,7 @@ export const ProfileSecurityPage = () => { return (
    -
    +
    @@ -16,7 +16,7 @@ export const ProfileSecurityPage = () => {
    -
    +

    Вход и безопасность

    Настройки аккаунта, почты, пароля и способов входа.

    diff --git a/src/pages/profile/profileSettings.page.tsx b/src/pages/profile/profileSettings.page.tsx index fc6cd6f5..b9f11fcf 100644 --- a/src/pages/profile/profileSettings.page.tsx +++ b/src/pages/profile/profileSettings.page.tsx @@ -6,7 +6,6 @@ import { clsx } from 'clsx' import styles from './Settings.module.scss' import { useProfileForm } from '../../context/profile' import validateUrl from '../../utils/validateUrl' - import { createFileUploader, UploadFile } from '@solid-primitives/upload' import { Loading } from '../../components/_shared/Loading' import { useSession } from '../../context/session' @@ -85,14 +84,14 @@ export const ProfileSettingsPage = () => {
    -
    +
    -
    +

    {t('Profile settings')}

    {t('Here you can customize your profile the way you want.')}

    @@ -140,7 +139,9 @@ export const ProfileSettingsPage = () => { value={form.slug} class="nolabel" /> -

    {t(`${slugError()}`)}

    + +

    {t(`${slugError()}`)}

    +
    diff --git a/src/pages/profile/profileSubscriptions.page.tsx b/src/pages/profile/profileSubscriptions.page.tsx index 27cb684f..96438265 100644 --- a/src/pages/profile/profileSubscriptions.page.tsx +++ b/src/pages/profile/profileSubscriptions.page.tsx @@ -9,7 +9,7 @@ export const ProfileSubscriptionsPage = () => { return (
    -
    +
    @@ -17,7 +17,7 @@ export const ProfileSubscriptionsPage = () => {
    -
    +

    Подписки

    Здесь можно управлять всеми своими подписками на сайте.

    diff --git a/src/styles/_globals.scss b/src/styles/_globals.scss index f0684bd8..3649585e 100644 --- a/src/styles/_globals.scss +++ b/src/styles/_globals.scss @@ -1,16 +1,16 @@ $include-column-box-sizing: true !default; -$rfs-breakpoint: 1360px !default; +$rfs-breakpoint: 1460px !default; $rfs-base-value: 1.6rem !default; $rfs-rem-value: 10 !default; -$grid-columns: 12; -$grid-gutter-width: 5.2rem !default; +$grid-columns: 24; +$grid-gutter-width: 4rem !default; $grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, - // xxl: 1400px, + // xxl: 1500px, ) !default; $default-color: #141414; $link-color: #2638d9; diff --git a/src/styles/app.scss b/src/styles/app.scss index 7809e9db..5811a7c3 100644 --- a/src/styles/app.scss +++ b/src/styles/app.scss @@ -67,13 +67,17 @@ section { .wide-container { margin: 0 auto; - max-width: 1400px; + max-width: 1500px; padding: 0 divide($container-padding-x, 2); width: 100%; @include media-breakpoint-up(sm) { padding: 0 $container-padding-x; } + + @include media-breakpoint-up(xl) { + padding: 0 $grid-gutter-width; + } } h1, @@ -593,7 +597,7 @@ figcaption { } .floor--7 { - .col-md-6 { + .col-md-12 { @include media-breakpoint-down(lg) { &:nth-child(1), &:nth-child(2) { @@ -682,7 +686,7 @@ figcaption { } .container { - max-width: 1400px; + max-width: 1500px; width: auto; @include media-breakpoint-down(sm) { diff --git a/src/utils/apiClient.ts b/src/utils/apiClient.ts index 3c598f83..e5bdf81a 100644 --- a/src/utils/apiClient.ts +++ b/src/utils/apiClient.ts @@ -38,6 +38,7 @@ import myChats from '../graphql/query/chats-load' import chatMessagesLoadBy from '../graphql/query/chat-messages-load-by' import authorBySlug from '../graphql/query/author-by-slug' import userSubscribers from '../graphql/query/author-followers' +import userFollowing from '../graphql/query/author-following' import topicBySlug from '../graphql/query/topic-by-slug' import createChat from '../graphql/mutation/create-chat' import reactionsLoadBy from '../graphql/query/reactions-load-by' @@ -221,6 +222,10 @@ export const apiClient = { const response = await publicGraphQLClient.query(userSubscribers, { slug }).toPromise() return response.data.userFollowers }, + getAuthorFollowing: async ({ slug }: { slug: string }): Promise => { + const response = await publicGraphQLClient.query(userFollowing, { slug }).toPromise() + return response.data.userFollowing + }, updateProfile: async (input: ProfileInput) => { const response = await privateGraphQLClient.mutation(updateProfile, { profile: input }).toPromise() return response.data.updateProfile diff --git a/src/utils/clone.ts b/src/utils/clone.ts new file mode 100644 index 00000000..1f224f77 --- /dev/null +++ b/src/utils/clone.ts @@ -0,0 +1,3 @@ +// debug nested objects console.log('message', clone(obj)) + +export const clone = (obj: T): T => JSON.parse(JSON.stringify(obj))