lint
This commit is contained in:
parent
0c959b80ad
commit
cfb744c0a0
13
.eslintrc.js
13
.eslintrc.js
|
@ -27,7 +27,7 @@ module.exports = {
|
||||||
// 'plugin:@typescript-eslint/recommended-requiring-type-checking'
|
// 'plugin:@typescript-eslint/recommended-requiring-type-checking'
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
'no-unused-vars': [
|
'@typescript-eslint/no-unused-vars': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
argsIgnorePattern: '^_',
|
argsIgnorePattern: '^_',
|
||||||
|
@ -68,7 +68,7 @@ module.exports = {
|
||||||
'unicorn/prefer-dom-node-append': 'off', // FIXME
|
'unicorn/prefer-dom-node-append': 'off', // FIXME
|
||||||
'unicorn/prefer-top-level-await': 'warn',
|
'unicorn/prefer-top-level-await': 'warn',
|
||||||
'unicorn/consistent-function-scoping': 'warn',
|
'unicorn/consistent-function-scoping': 'warn',
|
||||||
'sonarjs/no-duplicate-string': 'warn',
|
'sonarjs/no-duplicate-string': ['warn', 5],
|
||||||
|
|
||||||
// Promise
|
// Promise
|
||||||
// 'promise/catch-or-return': 'off', // Should be enabled
|
// 'promise/catch-or-return': 'off', // Should be enabled
|
||||||
|
@ -77,14 +77,7 @@ module.exports = {
|
||||||
eqeqeq: 'error',
|
eqeqeq: 'error',
|
||||||
'no-param-reassign': 'error',
|
'no-param-reassign': 'error',
|
||||||
'no-nested-ternary': 'error',
|
'no-nested-ternary': 'error',
|
||||||
'no-shadow': 'error',
|
'no-shadow': 'error'
|
||||||
'no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{
|
|
||||||
argsIgnorePattern: '^_',
|
|
||||||
varsIgnorePattern: '^log$'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
'import/resolver': {
|
'import/resolver': {
|
||||||
|
|
14
.stylelintrc
14
.stylelintrc
|
@ -19,7 +19,19 @@
|
||||||
],
|
],
|
||||||
"scss/dollar-variable-pattern": ["^[a-z][a-zA-Z]+$", {
|
"scss/dollar-variable-pattern": ["^[a-z][a-zA-Z]+$", {
|
||||||
"ignore": "global"
|
"ignore": "global"
|
||||||
}]
|
}],
|
||||||
|
"selector-pseudo-class-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignorePseudoClasses": ["global", "export"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"property-no-vendor-prefix": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignoreProperties": ["box-decoration-break"]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"defaultSeverity": "warning"
|
"defaultSeverity": "warning"
|
||||||
}
|
}
|
||||||
|
|
31
.stylelintrc.bak
Normal file
31
.stylelintrc.bak
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"stylelint-config-standard-scss"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"stylelint-order",
|
||||||
|
"stylelint-scss"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"selector-class-pattern": null,
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
"scss/function-no-unknown": null,
|
||||||
|
"scss/no-global-function-names": null,
|
||||||
|
"function-url-quotes": null,
|
||||||
|
"font-family-no-missing-generic-family-keyword": null,
|
||||||
|
"order/order": [
|
||||||
|
"custom-properties",
|
||||||
|
"declarations"
|
||||||
|
],
|
||||||
|
"scss/dollar-variable-pattern": ["^[a-z][a-zA-Z]+$", {
|
||||||
|
"ignore": "global"
|
||||||
|
}],
|
||||||
|
"selector-pseudo-class-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignorePseudoClasses": ["global", "export"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
|
}
|
|
@ -35,6 +35,7 @@ import { SessionProvider } from '../context/session'
|
||||||
import { ProfileSettingsPage } from '../pages/profile/profileSettings.page'
|
import { ProfileSettingsPage } from '../pages/profile/profileSettings.page'
|
||||||
import { ProfileSecurityPage } from '../pages/profile/profileSecurity.page'
|
import { ProfileSecurityPage } from '../pages/profile/profileSecurity.page'
|
||||||
import { ProfileSubscriptionsPage } from '../pages/profile/profileSubscriptions.page'
|
import { ProfileSubscriptionsPage } from '../pages/profile/profileSubscriptions.page'
|
||||||
|
import { DraftsPage } from '../pages/drafts.page'
|
||||||
import { SnackbarProvider } from '../context/snackbar'
|
import { SnackbarProvider } from '../context/snackbar'
|
||||||
import { LocalizeProvider } from '../context/localize'
|
import { LocalizeProvider } from '../context/localize'
|
||||||
import { EditorProvider } from '../context/editor'
|
import { EditorProvider } from '../context/editor'
|
||||||
|
@ -49,6 +50,7 @@ const pagesMap: Record<keyof typeof ROUTES, Component<PageProps>> = {
|
||||||
create: CreatePage,
|
create: CreatePage,
|
||||||
edit: EditPage,
|
edit: EditPage,
|
||||||
editSettings: EditPage,
|
editSettings: EditPage,
|
||||||
|
drafts: DraftsPage,
|
||||||
home: HomePage,
|
home: HomePage,
|
||||||
topics: AllTopicsPage,
|
topics: AllTopicsPage,
|
||||||
topic: TopicPage,
|
topic: TopicPage,
|
||||||
|
|
|
@ -101,9 +101,9 @@ img {
|
||||||
}
|
}
|
||||||
|
|
||||||
.writeComment {
|
.writeComment {
|
||||||
border: 2px solid #f6f6f6;
|
|
||||||
@include font-size(1.7rem);
|
@include font-size(1.7rem);
|
||||||
|
|
||||||
|
border: 2px solid #f6f6f6;
|
||||||
outline: none;
|
outline: none;
|
||||||
padding: 0.2em 0.4em;
|
padding: 0.2em 0.4em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -114,9 +114,9 @@ img {
|
||||||
}
|
}
|
||||||
|
|
||||||
.commentWarning {
|
.commentWarning {
|
||||||
background: #f6f6f6;
|
|
||||||
@include font-size(2.2rem);
|
@include font-size(2.2rem);
|
||||||
|
|
||||||
|
background: #f6f6f6;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
padding: 2.4rem 1.8rem;
|
padding: 2.4rem 1.8rem;
|
||||||
}
|
}
|
||||||
|
@ -166,10 +166,6 @@ img {
|
||||||
max-height: 1.8em;
|
max-height: 1.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutStatsItemInner .iconEdit {
|
|
||||||
margin-right: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
@ -177,6 +173,7 @@ img {
|
||||||
a {
|
a {
|
||||||
border: none;
|
border: none;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: unset;
|
background: unset;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
@ -189,9 +186,9 @@ img {
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutStatsItemInner {
|
.shoutStatsItemInner {
|
||||||
cursor: pointer;
|
|
||||||
margin: -0.3em -0.3em 0;
|
margin: -0.3em -0.3em 0;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
@ -201,24 +198,6 @@ img {
|
||||||
margin-right: 0.3em;
|
margin-right: 0.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: #000;
|
|
||||||
cursor: pointer;
|
|
||||||
img {
|
|
||||||
filter: invert(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.shoutStatsItemInner {
|
|
||||||
cursor: pointer;
|
|
||||||
margin: -0.3em -0.3em 0;
|
|
||||||
padding: 0.3em;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #000;
|
background: #000;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default (props: { shout: Shout }) => {
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
let audioRef: HTMLAudioElement
|
let audioRef: HTMLAudioElement
|
||||||
const [currentTrack, setCurrentTrack] = createSignal(media()[0])
|
const [currentTrack] = createSignal(media()[0])
|
||||||
const [paused, setPaused] = createSignal(true)
|
const [paused, setPaused] = createSignal(true)
|
||||||
const togglePlayPause = () => setPaused(!paused())
|
const togglePlayPause = () => setPaused(!paused())
|
||||||
const playMedia = (m: MediaItem) => {
|
const playMedia = (m: MediaItem) => {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
&.isNew {
|
&.isNew {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: rgba(38, 56, 217, 0.05);
|
background: rgb(38 56 217 / 5%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-down(sm) {
|
@include media-breakpoint-down(sm) {
|
||||||
|
@ -178,6 +178,7 @@
|
||||||
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%);
|
||||||
|
|
||||||
@include font-size(1.2rem);
|
@include font-size(1.2rem);
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
|
@ -189,6 +190,7 @@
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-down(md) {
|
@include media-breakpoint-down(md) {
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import styles from './Comment.module.scss'
|
import styles from './Comment.module.scss'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
import { AuthorCard } from '../Author/Card'
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
import { Show, createMemo, createSignal, For, lazy, Suspense } from 'solid-js'
|
import { Show, createMemo, createSignal, For, lazy, Suspense } from 'solid-js'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import type { Author, Reaction } from '../../graphql/types.gen'
|
import type { Author, Reaction } from '../../graphql/types.gen'
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: opacity 0.3s ease-in-out;
|
transition: opacity 0.3s ease-in-out;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +32,7 @@
|
||||||
|
|
||||||
.commentRatingControlUp {
|
.commentRatingControlUp {
|
||||||
border-bottom: 8px solid rgb(0 0 0 / 40%);
|
border-bottom: 8px solid rgb(0 0 0 / 40%);
|
||||||
|
|
||||||
&.voted {
|
&.voted {
|
||||||
border-bottom-color: #2bb452;
|
border-bottom-color: #2bb452;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +40,7 @@
|
||||||
|
|
||||||
.commentRatingControlDown {
|
.commentRatingControlDown {
|
||||||
border-top: 8px solid rgb(0 0 0 / 40%);
|
border-top: 8px solid rgb(0 0 0 / 40%);
|
||||||
|
|
||||||
&.voted {
|
&.voted {
|
||||||
border-top-color: #d00820;
|
border-top-color: #d00820;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { capitalize, formatDate } from '../../utils'
|
import { capitalize, formatDate } from '../../utils'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
import { AuthorCard } from '../Author/Card'
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
import { createEffect, createMemo, createSignal, For, Match, onMount, Show, Switch } from 'solid-js'
|
import { createEffect, createMemo, createSignal, 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 MD from './MD'
|
import MD from './MD'
|
||||||
|
@ -13,7 +13,7 @@ import { useSession } from '../../context/session'
|
||||||
import VideoPlayer from './VideoPlayer'
|
import VideoPlayer from './VideoPlayer'
|
||||||
import Slider from '../_shared/Slider'
|
import Slider from '../_shared/Slider'
|
||||||
import { getPagePath } from '@nanostores/router'
|
import { getPagePath } from '@nanostores/router'
|
||||||
import { router } from '../../stores/router'
|
import { router, useRouter } from '../../stores/router'
|
||||||
import { useReactions } from '../../context/reactions'
|
import { useReactions } from '../../context/reactions'
|
||||||
import { Title } from '@solidjs/meta'
|
import { Title } from '@solidjs/meta'
|
||||||
import { useLocalize } from '../../context/localize'
|
import { useLocalize } from '../../context/localize'
|
||||||
|
@ -77,7 +77,8 @@ export const FullArticle = (props: ArticleProps) => {
|
||||||
|
|
||||||
const canEdit = () => props.article.authors?.some((a) => a.slug === user()?.slug)
|
const canEdit = () => props.article.authors?.some((a) => a.slug === user()?.slug)
|
||||||
|
|
||||||
const bookmark = (ev) => {
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
||||||
|
const handleBookmarkButtonClick = (ev) => {
|
||||||
// TODO: implement bookmark clicked
|
// TODO: implement bookmark clicked
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
}
|
}
|
||||||
|
@ -97,14 +98,14 @@ export const FullArticle = (props: ArticleProps) => {
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const { searchParams } = useRouter()
|
const { searchParams, changeSearchParam } = useRouter()
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (props.scrollToComments) {
|
if (props.scrollToComments) {
|
||||||
scrollToComments()
|
scrollToComments()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { changeSearchParam } = useRouter()
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (searchParams()?.scrollTo === 'comments' && commentsRef.current) {
|
if (searchParams()?.scrollTo === 'comments' && commentsRef.current) {
|
||||||
scrollToComments()
|
scrollToComments()
|
||||||
|
@ -228,7 +229,7 @@ export const FullArticle = (props: ArticleProps) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class={styles.shoutStatsItem} onClick={bookmark}>
|
<div class={styles.shoutStatsItem} onClick={handleBookmarkButtonClick}>
|
||||||
<div class={styles.shoutStatsItemInner}>
|
<div class={styles.shoutStatsItemInner}>
|
||||||
<Icon name="bookmark" class={styles.icon} />
|
<Icon name="bookmark" class={styles.icon} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import styles from './ShoutRatingControl.module.scss'
|
import styles from './ShoutRatingControl.module.scss'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { createMemo, For } from 'solid-js'
|
import { createMemo } from 'solid-js'
|
||||||
import { ReactionKind, Shout } from '../../graphql/types.gen'
|
import { ReactionKind, Shout } from '../../graphql/types.gen'
|
||||||
import { loadShout } from '../../stores/zine/articles'
|
import { loadShout } from '../../stores/zine/articles'
|
||||||
import { useSession } from '../../context/session'
|
import { useSession } from '../../context/session'
|
||||||
|
|
|
@ -169,12 +169,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttonWrite {
|
.buttonWrite {
|
||||||
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
color: #000;
|
color: #000;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
transition: background-color 0.3s, color 0.3s;
|
transition: background-color 0.3s, color 0.3s;
|
||||||
|
|
||||||
@include font-size(1.5rem);
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #000;
|
background: #000;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -208,8 +208,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.authorAbout {
|
.authorAbout {
|
||||||
color: #696969;
|
|
||||||
@include font-size(1.7rem);
|
@include font-size(1.7rem);
|
||||||
|
|
||||||
|
color: #696969;
|
||||||
}
|
}
|
||||||
|
|
||||||
.authorSubscribe {
|
.authorSubscribe {
|
|
@ -1,7 +1,7 @@
|
||||||
import type { Author, User } from '../../graphql/types.gen'
|
import type { Author } from '../../graphql/types.gen'
|
||||||
import Userpic from './Userpic'
|
import Userpic from './Userpic'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
import styles from './Card.module.scss'
|
import styles from './AuthorCard.module.scss'
|
||||||
import { createMemo, createSignal, For, Show } from 'solid-js'
|
import { createMemo, createSignal, For, Show } from 'solid-js'
|
||||||
import { translit } from '../../utils/ru2en'
|
import { translit } from '../../utils/ru2en'
|
||||||
import { follow, unfollow } from '../../stores/zine/common'
|
import { follow, unfollow } from '../../stores/zine/common'
|
|
@ -11,6 +11,7 @@ export const AuthorRatingControl = (props: AuthorRatingControlProps) => {
|
||||||
const isUpvoted = false
|
const isUpvoted = false
|
||||||
const isDownvoted = false
|
const isDownvoted = false
|
||||||
|
|
||||||
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
||||||
const handleRatingChange = (isUpvote: boolean) => {
|
const handleRatingChange = (isUpvote: boolean) => {
|
||||||
console.log('handleRatingChange', { isUpvote })
|
console.log('handleRatingChange', { isUpvote })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Author } from '../../graphql/types.gen'
|
import type { Author } from '../../graphql/types.gen'
|
||||||
import { AuthorCard } from './Card'
|
import { AuthorCard } from './AuthorCard'
|
||||||
import './Full.scss'
|
import './Full.scss'
|
||||||
|
|
||||||
export const AuthorFull = (props: { author: Author }) => {
|
export const AuthorFull = (props: { author: Author }) => {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Show } from 'solid-js'
|
import { Show } from 'solid-js'
|
||||||
import type { Author } from '../../graphql/types.gen'
|
import type { Author, User } from '../../graphql/types.gen'
|
||||||
import styles from './Userpic.module.scss'
|
import styles from './Userpic.module.scss'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
|
|
||||||
interface UserpicProps {
|
interface UserpicProps {
|
||||||
user: Author
|
user: Author | User
|
||||||
hasLink?: boolean
|
hasLink?: boolean
|
||||||
isBig?: boolean
|
isBig?: boolean
|
||||||
class?: string
|
class?: string
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
.discoursFooter {
|
.discoursFooter {
|
||||||
background: #000;
|
|
||||||
color: rgb(255 255 255 / 64%);
|
|
||||||
@include font-size(1.7rem);
|
@include font-size(1.7rem);
|
||||||
|
|
||||||
|
background: #000;
|
||||||
|
color: rgb(255 255 255 / 64%);
|
||||||
padding: 2.4rem 0 4.2rem;
|
padding: 2.4rem 0 4.2rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@ -48,10 +48,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.footerCopyright {
|
.footerCopyright {
|
||||||
border-top: 5px solid #404040;
|
|
||||||
color: #696969;
|
|
||||||
@include font-size(1.5rem);
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
|
border-top: 5px solid #404040;
|
||||||
|
color: #696969;
|
||||||
padding-top: 1.6rem;
|
padding-top: 1.6rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
.about-discours {
|
.about-discours {
|
||||||
background: #000;
|
|
||||||
color: #fff;
|
|
||||||
@include font-size(1.7rem);
|
@include font-size(1.7rem);
|
||||||
|
|
||||||
|
background: #000;
|
||||||
|
color: #fff;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin-bottom: 6.4rem;
|
margin-bottom: 6.4rem;
|
||||||
padding: 3.6rem 0;
|
padding: 3.6rem 0;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
.navigationHeader {
|
.navigationHeader {
|
||||||
@include font-size(1.8rem);
|
@include font-size(1.8rem);
|
||||||
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 1.1em;
|
margin-top: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
|
@include font-size(2rem);
|
||||||
|
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: 1px solid;
|
border-bottom: 1px solid;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
@include font-size(2rem);
|
|
||||||
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -30,13 +30,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: none;
|
border: none;
|
||||||
color: #000;
|
color: #000;
|
||||||
display: flex;
|
display: flex;
|
||||||
@include font-size(1.5rem);
|
|
||||||
|
|
||||||
padding: 0 0.5em;
|
padding: 0 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-direction: row;
|
flex-flow: row nowrap;
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.dropDown {
|
.dropDown {
|
||||||
|
@ -50,7 +49,7 @@
|
||||||
top: calc(100% + 8px);
|
top: calc(100% + 8px);
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
|
box-shadow: 0 4px 10px rgb(0 0 0 / 25%);
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: #898c94;
|
color: #898c94;
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-flow: row nowrap;
|
||||||
flex-wrap: nowrap;
|
|
||||||
padding: 6px 11px;
|
padding: 6px 11px;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
|
@ -18,6 +17,7 @@
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
color: rgba(#000, 0.3);
|
color: rgba(#000, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,25 +12,35 @@ type FloatingMenuProps = {
|
||||||
|
|
||||||
const embedData = async (data) => {
|
const embedData = async (data) => {
|
||||||
const result = await HTMLParser(data, false)
|
const result = await HTMLParser(data, false)
|
||||||
|
|
||||||
|
if (typeof result === 'string') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (result && 'type' in result && result.type === 'iframe') {
|
if (result && 'type' in result && result.type === 'iframe') {
|
||||||
return result.attributes
|
return result.attributes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validateEmbed = async (value: string): Promise<string> => {
|
||||||
|
const iframeData = await HTMLParser(value, false)
|
||||||
|
|
||||||
|
if (typeof iframeData === 'string') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iframeData && iframeData.type !== 'iframe') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const EditorFloatingMenu = (props: FloatingMenuProps) => {
|
export const EditorFloatingMenu = (props: FloatingMenuProps) => {
|
||||||
const [inlineEditorOpen, setInlineEditorOpen] = createSignal<boolean>(false)
|
const [inlineEditorOpen, setInlineEditorOpen] = createSignal<boolean>(false)
|
||||||
|
|
||||||
const handleEmbedFormSubmit = async (value: string) => {
|
const handleEmbedFormSubmit = async (value: string) => {
|
||||||
// TODO: add support instagram embed (blockquote)
|
// TODO: add support instagram embed (blockquote)
|
||||||
const emb = await embedData(value)
|
const { src } = (await embedData(value)) as { src: string }
|
||||||
props.editor.chain().focus().setIframe(emb).run()
|
props.editor.chain().focus().setIframe({ src }).run()
|
||||||
}
|
|
||||||
|
|
||||||
const validateEmbed = async (value) => {
|
|
||||||
const iframeData = await HTMLParser(value, false)
|
|
||||||
if (iframeData && iframeData.type !== 'iframe') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&.inBubble {
|
&.inBubble {
|
||||||
//...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
&.inFloating {
|
&.inFloating {
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
button {
|
button {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
&:disabled,
|
&:disabled,
|
||||||
&:disabled:hover {
|
&:disabled:hover {
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
|
@ -24,8 +25,7 @@
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-flow: row nowrap;
|
||||||
flex-wrap: nowrap;
|
|
||||||
padding: 6px 11px;
|
padding: 6px 11px;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
color: rgba(#000, 0.3);
|
color: rgba(#000, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import styles from './InlineForm.module.scss'
|
import styles from './InlineForm.module.scss'
|
||||||
import { Icon } from '../../_shared/Icon'
|
import { Icon } from '../../_shared/Icon'
|
||||||
import { createEditorTransaction } from 'solid-tiptap'
|
|
||||||
import type { Editor } from '@tiptap/core'
|
|
||||||
import { createSignal, Show } from 'solid-js'
|
import { createSignal, Show } from 'solid-js'
|
||||||
import { useLocalize } from '../../../context/localize'
|
import { useLocalize } from '../../../context/localize'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
|
@ -50,7 +48,7 @@ export const InlineForm = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class={clsx(styles.InlineForm, {
|
class={clsx(styles.InlineForm, {
|
||||||
[styles.inBubble]: props.variant === 'inBubble',
|
// [styles.inBubble]: props.variant === 'inBubble',
|
||||||
[styles.inFloating]: props.variant === 'inFloating'
|
[styles.inFloating]: props.variant === 'inFloating'
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.Panel {
|
.Panel {
|
||||||
background: #1f1f1f;
|
background: #1f1f1f;
|
||||||
color: rgb(255 255 255 / 0.35);
|
color: rgb(255 255 255 / 35%);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 1.7rem;
|
font-size: 1.7rem;
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
border-bottom: 2px solid rgb(255 255 255 / 0.1);
|
border-bottom: 2px solid rgb(255 255 255 / 10%);
|
||||||
padding: 1.8rem 0;
|
padding: 1.8rem 0;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: rgb(255 255 255 / 0.35);
|
color: rgb(255 255 255 / 35%);
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
@ -87,6 +87,7 @@
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hidden {
|
&.hidden {
|
||||||
transform: translateX(100%);
|
transform: translateX(100%);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,11 @@ import { useLocalize } from '../../../context/localize'
|
||||||
import styles from './Panel.module.scss'
|
import styles from './Panel.module.scss'
|
||||||
import { useEditorContext } from '../../../context/editor'
|
import { useEditorContext } from '../../../context/editor'
|
||||||
|
|
||||||
type Props = {
|
// type Props = {
|
||||||
// isVisible: boolean
|
// // isVisible: boolean
|
||||||
}
|
// }
|
||||||
|
|
||||||
export const Panel = (props: Props) => {
|
export const Panel = () => {
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
const {
|
const {
|
||||||
isEditorPanelVisible,
|
isEditorPanelVisible,
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 2px solid;
|
|
||||||
@include font-size(1.6rem);
|
@include font-size(1.6rem);
|
||||||
|
|
||||||
|
border-left: 2px solid;
|
||||||
margin: 1.5em 0;
|
margin: 1.5em 0;
|
||||||
padding-left: 1.6em;
|
padding-left: 1.6em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { createOptions, Select } from '@thisbeyond/solid-select'
|
||||||
import { useLocalize } from '../../../context/localize'
|
import { useLocalize } from '../../../context/localize'
|
||||||
import '@thisbeyond/solid-select/style.css'
|
import '@thisbeyond/solid-select/style.css'
|
||||||
import './TopicSelect.scss'
|
import './TopicSelect.scss'
|
||||||
import { clone } from '../../../utils/clone'
|
|
||||||
|
|
||||||
type TopicSelectProps = {
|
type TopicSelectProps = {
|
||||||
topics: Topic[]
|
topics: Topic[]
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import { mergeAttributes, Node } from '@tiptap/core'
|
import { mergeAttributes, Node } from '@tiptap/core'
|
||||||
import { NodeRange } from 'prosemirror-model'
|
|
||||||
import { insert } from 'solid-js/web'
|
|
||||||
import { TextSelection } from 'prosemirror-state'
|
|
||||||
|
|
||||||
export interface IframeOptions {
|
export interface IframeOptions {
|
||||||
allowFullscreen: boolean
|
allowFullscreen: boolean
|
||||||
|
@ -48,7 +45,7 @@ export const Embed = Node.create<IframeOptions>({
|
||||||
const iframe = document.createElement('iframe')
|
const iframe = document.createElement('iframe')
|
||||||
iframe.width = node.attrs.width
|
iframe.width = node.attrs.width
|
||||||
iframe.height = node.attrs.height
|
iframe.height = node.attrs.height
|
||||||
iframe.allowfullscreen = node.attrs.allowfullscreen
|
iframe.allowFullscreen = node.attrs.allowFullscreen
|
||||||
iframe.src = node.attrs.src
|
iframe.src = node.attrs.src
|
||||||
div.append(iframe)
|
div.append(iframe)
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebarContainer {
|
.sidebarContainer {
|
||||||
display: none; // режим отладки
|
|
||||||
color: rgb(255 255 255 / 50%);
|
|
||||||
@include font-size(1.6rem);
|
@include font-size(1.6rem);
|
||||||
|
|
||||||
|
display: none; // режим отладки
|
||||||
|
color: rgb(255 255 255 / 50%);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
|
@ -85,9 +85,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 2px solid;
|
|
||||||
@include font-size(1.6rem);
|
@include font-size(1.6rem);
|
||||||
|
|
||||||
|
border-left: 2px solid;
|
||||||
margin: 1.5em 0;
|
margin: 1.5em 0;
|
||||||
padding-left: 1.6em;
|
padding-left: 1.6em;
|
||||||
}
|
}
|
||||||
|
@ -287,10 +287,7 @@ li.ProseMirror-selectednode {
|
||||||
li.ProseMirror-selectednode::after {
|
li.ProseMirror-selectednode::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -32px;
|
inset: -2px -2px -2px -32px;
|
||||||
right: -2px;
|
|
||||||
top: -2px;
|
|
||||||
bottom: -2px;
|
|
||||||
border: 2px solid #8cf;
|
border: 2px solid #8cf;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,9 +132,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutCardSubtitle {
|
.shoutCardSubtitle {
|
||||||
color: #696969;
|
|
||||||
@include font-size(1.7rem);
|
@include font-size(1.7rem);
|
||||||
|
|
||||||
|
color: #696969;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
margin-bottom: 0.8rem;
|
margin-bottom: 0.8rem;
|
||||||
|
@ -263,9 +263,9 @@
|
||||||
|
|
||||||
.shoutCardTitle,
|
.shoutCardTitle,
|
||||||
.shoutCardSubtitle {
|
.shoutCardSubtitle {
|
||||||
display: inline;
|
|
||||||
@include font-size(2.6rem);
|
@include font-size(2.6rem);
|
||||||
|
|
||||||
|
display: inline;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,24 +554,25 @@
|
||||||
|
|
||||||
.shoutCardBigTitle {
|
.shoutCardBigTitle {
|
||||||
.shoutCardTitle {
|
.shoutCardTitle {
|
||||||
display: block;
|
|
||||||
@include font-size(3.2rem);
|
@include font-size(3.2rem);
|
||||||
|
|
||||||
|
display: block;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutCardSubtitle {
|
.shoutCardSubtitle {
|
||||||
color: #696969;
|
|
||||||
@include font-size(2.4rem);
|
@include font-size(2.4rem);
|
||||||
|
|
||||||
|
color: #696969;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutCardCompact {
|
.shoutCardCompact {
|
||||||
.shoutCardTitle,
|
.shoutCardTitle,
|
||||||
.shoutCardSubtitle {
|
.shoutCardSubtitle {
|
||||||
display: inline;
|
|
||||||
@include font-size(2.6rem);
|
@include font-size(2.6rem);
|
||||||
|
|
||||||
|
display: inline;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,9 +670,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.shoutCardSubtitle {
|
.shoutCardSubtitle {
|
||||||
|
@include font-size(2.4rem);
|
||||||
|
|
||||||
color: #696969;
|
color: #696969;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@include font-size(2.4rem);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import type { Shout } from '../../graphql/types.gen'
|
||||||
import { capitalize } from '../../utils'
|
import { capitalize } from '../../utils'
|
||||||
import { translit } from '../../utils/ru2en'
|
import { translit } from '../../utils/ru2en'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
import styles from './Card.module.scss'
|
import styles from './ArticleCard.module.scss'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { CardTopic } from './CardTopic'
|
import { CardTopic } from './CardTopic'
|
||||||
import { ShoutRatingControl } from '../Article/ShoutRatingControl'
|
import { ShoutRatingControl } from '../Article/ShoutRatingControl'
|
||||||
|
@ -37,7 +37,6 @@ interface ArticleCardProps {
|
||||||
isBeside?: boolean
|
isBeside?: boolean
|
||||||
}
|
}
|
||||||
article: Shout
|
article: Shout
|
||||||
scrollTo: 'comments'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTitleAndSubtitle = (article: Shout): { title: string; subtitle: string } => {
|
const getTitleAndSubtitle = (article: Shout): { title: string; subtitle: string } => {
|
|
@ -66,9 +66,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
border: none;
|
|
||||||
@include font-size(1.5rem);
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
|
border: none;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding-right: 0.3em;
|
padding-right: 0.3em;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// TODO: additional entities list column + article
|
// TODO: additional entities list column + article
|
||||||
|
|
||||||
import { For, Show } from 'solid-js'
|
import { For, Show } from 'solid-js'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
import { AuthorCard } from '../Author/Card'
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
import { TopicCard } from '../Topic/Card'
|
import { TopicCard } from '../Topic/Card'
|
||||||
import styles from './Beside.module.scss'
|
import styles from './Beside.module.scss'
|
||||||
import type { Author, Shout, Topic, User } from '../../graphql/types.gen'
|
import type { Author, Shout, Topic, User } from '../../graphql/types.gen'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { JSX } from 'solid-js/jsx-runtime'
|
import type { JSX } from 'solid-js/jsx-runtime'
|
||||||
import { For, Show } from 'solid-js'
|
import { For, Show } from 'solid-js'
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
import './Group.scss'
|
import './Group.scss'
|
||||||
|
|
||||||
interface GroupProps {
|
interface GroupProps {
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
.article-preview {
|
|
||||||
background: center url('loading.gif') no-repeat;
|
|
||||||
margin: auto;
|
|
||||||
vertical-align: middle;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
/* TODO: centered full viewport */
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
import { Row1 } from './Row1'
|
|
||||||
import { Row2 } from './Row2'
|
|
||||||
import { Row3 } from './Row3'
|
|
||||||
import { shuffle } from '../../utils'
|
|
||||||
import { createMemo, createSignal, For, Suspense } from 'solid-js'
|
|
||||||
import type { JSX } from 'solid-js'
|
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
|
||||||
import './List.scss'
|
|
||||||
import { useLocalize } from '../../context/localize'
|
|
||||||
|
|
||||||
export const Block6 = (props: { articles: Shout[] }) => {
|
|
||||||
const dice = createMemo(() => shuffle([Row1, Row2, Row3]))
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<For each={dice()}>{(c: () => JSX.Element) => c(props.articles)}</For>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ArticleListProps {
|
|
||||||
articles: Shout[]
|
|
||||||
page: number
|
|
||||||
size: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (props: ArticleListProps) => {
|
|
||||||
const { t } = useLocalize()
|
|
||||||
const [articles, setArticles] = createSignal(
|
|
||||||
props.articles.slice(props.page * props.size, props.size * (props.page + 1)) || []
|
|
||||||
)
|
|
||||||
const [loadingMore, setLoadingMore] = createSignal(false)
|
|
||||||
// const [, { more }] = useZine()
|
|
||||||
const handleMore = () => {
|
|
||||||
setArticles(props.articles.slice(props.page * props.size, props.size * (props.page + 1)))
|
|
||||||
if (props.size * (props.page + 1) > props.articles.length) {
|
|
||||||
console.log('[article-list] load more')
|
|
||||||
setLoadingMore(true)
|
|
||||||
// TODO: more()
|
|
||||||
setLoadingMore(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const x: number = Math.floor(articles().length / 6)
|
|
||||||
// eslint-disable-next-line unicorn/new-for-builtins
|
|
||||||
const numbers: number[] = [...Array(x).keys()]
|
|
||||||
return (
|
|
||||||
<Suspense fallback={<div class="article-preview">{t('Loading')}</div>}>
|
|
||||||
<For each={numbers}>
|
|
||||||
{() => <Block6 articles={articles().slice(0, Math.min(6, articles().length))} />}
|
|
||||||
</For>
|
|
||||||
<a href={''} onClick={handleMore} classList={{ disabled: loadingMore() }}>
|
|
||||||
{loadingMore() ? '...' : t('More')}
|
|
||||||
</a>
|
|
||||||
</Suspense>
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Show } from 'solid-js'
|
import { Show } from 'solid-js'
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
|
|
||||||
export const Row1 = (props: { article: Shout; nodate?: boolean }) => (
|
export const Row1 = (props: { article: Shout; nodate?: boolean }) => (
|
||||||
<Show when={!!props.article}>
|
<Show when={!!props.article}>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { createComputed, createSignal, Show, For } from 'solid-js'
|
import { createComputed, createSignal, Show, For } from 'solid-js'
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
|
|
||||||
const x = [
|
const x = [
|
||||||
['12', '12'],
|
['12', '12'],
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { JSX } from 'solid-js/jsx-runtime'
|
import type { JSX } from 'solid-js/jsx-runtime'
|
||||||
import { For } from 'solid-js'
|
import { For } from 'solid-js'
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
|
|
||||||
export const Row3 = (props: { articles: Shout[]; header?: JSX.Element; nodate?: boolean }) => {
|
export const Row3 = (props: { articles: Shout[]; header?: JSX.Element; nodate?: boolean }) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
|
|
||||||
export const Row5 = (props: { articles: Shout[]; nodate?: boolean }) => {
|
export const Row5 = (props: { articles: Shout[]; nodate?: boolean }) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { For } from 'solid-js'
|
import { For } from 'solid-js'
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from './Card'
|
import { ArticleCard } from './ArticleCard'
|
||||||
|
|
||||||
export default (props: { articles: Shout[] }) => (
|
export default (props: { articles: Shout[] }) => (
|
||||||
<div class="floor floor--7">
|
<div class="floor floor--7">
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
.counter {
|
.counter {
|
||||||
@include font-size(1.2rem);
|
@include font-size(1.2rem);
|
||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
|
|
|
@ -84,8 +84,8 @@ export const Sidebar = (props: FeedSidebarProps) => {
|
||||||
<div class={styles.sidebar}>
|
<div class={styles.sidebar}>
|
||||||
<ul>
|
<ul>
|
||||||
<For each={menuItems}>
|
<For each={menuItems}>
|
||||||
{(item: ListItem, index) => (
|
{(item: ListItem) => (
|
||||||
<li key={index}>
|
<li>
|
||||||
<a href="#">
|
<a href="#">
|
||||||
<span class={styles.sidebarItemName}>
|
<span class={styles.sidebarItemName}>
|
||||||
{item.icon && <Icon name={item.icon} class={styles.icon} />}
|
{item.icon && <Icon name={item.icon} class={styles.icon} />}
|
||||||
|
|
|
@ -5,11 +5,11 @@ import { useLocalize } from '../../context/localize'
|
||||||
|
|
||||||
export type MessageActionType = 'reply' | 'copy' | 'pin' | 'forward' | 'select' | 'delete'
|
export type MessageActionType = 'reply' | 'copy' | 'pin' | 'forward' | 'select' | 'delete'
|
||||||
|
|
||||||
type MessageActionsPopup = {
|
type MessageActionsPopupProps = {
|
||||||
actionSelect?: (selectedAction) => void
|
actionSelect?: (selectedAction) => void
|
||||||
} & Omit<PopupProps, 'children'>
|
} & Omit<PopupProps, 'children'>
|
||||||
|
|
||||||
export const MessageActionsPopup = (props: MessageActionsPopup) => {
|
export const MessageActionsPopup = (props: MessageActionsPopupProps) => {
|
||||||
const [selectedAction, setSelectedAction] = createSignal<MessageActionType | null>(null)
|
const [selectedAction, setSelectedAction] = createSignal<MessageActionType | null>(null)
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
const actions: { name: string; action: MessageActionType }[] = [
|
const actions: { name: string; action: MessageActionType }[] = [
|
||||||
|
|
|
@ -33,12 +33,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.authImage {
|
.authImage {
|
||||||
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
background: #141414 url('/auth-page.jpg') center no-repeat;
|
background: #141414 url('/auth-page.jpg') center no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
@include font-size(1.5rem);
|
|
||||||
|
|
||||||
padding: 3em;
|
padding: 3em;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@ -81,8 +81,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.disclaimer {
|
.disclaimer {
|
||||||
color: #9fa1a7;
|
|
||||||
@include font-size(1.2rem);
|
@include font-size(1.2rem);
|
||||||
|
|
||||||
|
color: #9fa1a7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.authActions {
|
.authActions {
|
||||||
|
|
|
@ -130,10 +130,11 @@
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
position: relative;
|
position: relative;
|
||||||
//flex: 1 100% !important;
|
|
||||||
|
// flex: 1 100% !important;
|
||||||
|
|
||||||
// replace row > * selector to remove !important
|
// replace row > * selector to remove !important
|
||||||
//width: auto !important;
|
// width: auto !important;
|
||||||
|
|
||||||
@include media-breakpoint-down(md) {
|
@include media-breakpoint-down(md) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
@ -142,9 +143,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.mainNavigationWrapper {
|
.mainNavigationWrapper {
|
||||||
|
@include font-size(1.7rem);
|
||||||
|
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
@include font-size(1.7rem);
|
|
||||||
|
|
||||||
@include media-breakpoint-down(md) {
|
@include media-breakpoint-down(md) {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -513,8 +515,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.textLabel {
|
.textLabel {
|
||||||
|
// padding: 0 1.2rem;
|
||||||
|
|
||||||
display: inline;
|
display: inline;
|
||||||
//padding: 0 1.2rem;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,13 @@ import { createMemo, createSignal, Show } from 'solid-js'
|
||||||
import Notifications from './Notifications'
|
import Notifications from './Notifications'
|
||||||
import { ProfilePopup } from './ProfilePopup'
|
import { ProfilePopup } from './ProfilePopup'
|
||||||
import Userpic from '../Author/Userpic'
|
import Userpic from '../Author/Userpic'
|
||||||
import type { Author } from '../../graphql/types.gen'
|
|
||||||
import { showModal, useWarningsStore } from '../../stores/ui'
|
import { showModal, useWarningsStore } from '../../stores/ui'
|
||||||
import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient'
|
import { ShowOnlyOnClient } from '../_shared/ShowOnlyOnClient'
|
||||||
import { useSession } from '../../context/session'
|
import { useSession } from '../../context/session'
|
||||||
import { useLocalize } from '../../context/localize'
|
import { useLocalize } from '../../context/localize'
|
||||||
import { getPagePath } from '@nanostores/router'
|
import { getPagePath } from '@nanostores/router'
|
||||||
import { Button } from '../_shared/Button'
|
import { Button } from '../_shared/Button'
|
||||||
import { useEditorContext } from '../../context/editor'
|
// import { useEditorContext } from '../../context/editor'
|
||||||
|
|
||||||
type HeaderAuthProps = {
|
type HeaderAuthProps = {
|
||||||
setIsProfilePopupVisible: (value: boolean) => void
|
setIsProfilePopupVisible: (value: boolean) => void
|
||||||
|
@ -28,9 +27,9 @@ export const HeaderAuth = (props: HeaderAuthProps) => {
|
||||||
|
|
||||||
const { session, isSessionLoaded, isAuthenticated } = useSession()
|
const { session, isSessionLoaded, isAuthenticated } = useSession()
|
||||||
|
|
||||||
const {
|
// const {
|
||||||
actions: { toggleEditorPanel }
|
// actions: { toggleEditorPanel }
|
||||||
} = useEditorContext()
|
// } = useEditorContext()
|
||||||
|
|
||||||
const toggleWarnings = () => setVisibleWarnings(!visibleWarnings())
|
const toggleWarnings = () => setVisibleWarnings(!visibleWarnings())
|
||||||
|
|
||||||
|
@ -50,6 +49,12 @@ export const HeaderAuth = (props: HeaderAuthProps) => {
|
||||||
const showSaveButton = createMemo(() => isAuthenticated() && isEditorPage())
|
const showSaveButton = createMemo(() => isAuthenticated() && isEditorPage())
|
||||||
const showCreatePostButton = createMemo(() => isAuthenticated() && !isEditorPage())
|
const showCreatePostButton = createMemo(() => isAuthenticated() && !isEditorPage())
|
||||||
|
|
||||||
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
||||||
|
const handleBurgerButtonClick = () => {
|
||||||
|
// TODO: implement me
|
||||||
|
console.log('Burger clicked')
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ShowOnlyOnClient>
|
<ShowOnlyOnClient>
|
||||||
<Show when={isSessionLoaded()} keyed={true}>
|
<Show when={isSessionLoaded()} keyed={true}>
|
||||||
|
@ -100,7 +105,11 @@ export const HeaderAuth = (props: HeaderAuthProps) => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class={clsx(styles.userControlItem, styles.userControlItemVerbose)}>
|
<div class={clsx(styles.userControlItem, styles.userControlItemVerbose)}>
|
||||||
<Button value={<Icon name="burger" />} variant={'outline'} onClick={() => {}} />
|
<Button
|
||||||
|
value={<Icon name="burger" />}
|
||||||
|
variant={'outline'}
|
||||||
|
onClick={handleBurgerButtonClick}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 800px) and (max-width: 991px) {
|
@media (width >= 800px) and (width <= 991px) {
|
||||||
// top: 11em;
|
// top: 11em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,8 @@
|
||||||
&.narrow {
|
&.narrow {
|
||||||
max-width: 460px;
|
max-width: 460px;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
@media (min-width: 800px) and (max-width: 991px) {
|
|
||||||
|
@media (width >= 800px) and (width <= 991px) {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { AuthorCard } from '../Author/Card'
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
import type { Author } from '../../graphql/types.gen'
|
import type { Author } from '../../graphql/types.gen'
|
||||||
|
|
||||||
import { translit } from '../../utils/ru2en'
|
import { translit } from '../../utils/ru2en'
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.topicTitle {
|
.topicTitle {
|
||||||
font-weight: bold;
|
|
||||||
@include font-size(2.2rem);
|
@include font-size(2.2rem);
|
||||||
|
|
||||||
|
font-weight: bold;
|
||||||
margin-bottom: 1.2rem;
|
margin-bottom: 1.2rem;
|
||||||
margin-top: 0.5rem !important;
|
margin-top: 0.5rem !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import type { Author } from '../../graphql/types.gen'
|
||||||
|
|
||||||
import { setAuthorsSort, useAuthorsStore } from '../../stores/zine/authors'
|
import { setAuthorsSort, useAuthorsStore } from '../../stores/zine/authors'
|
||||||
import { useRouter } from '../../stores/router'
|
import { useRouter } from '../../stores/router'
|
||||||
import { AuthorCard } from '../Author/Card'
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { useSession } from '../../context/session'
|
import { useSession } from '../../context/session'
|
||||||
import { translit } from '../../utils/ru2en'
|
import { translit } from '../../utils/ru2en'
|
||||||
|
|
|
@ -14,7 +14,7 @@ import stylesArticle from '../Article/Article.module.scss'
|
||||||
import { clsx } from 'clsx'
|
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/AuthorCard'
|
||||||
import { apiClient } from '../../utils/apiClient'
|
import { apiClient } from '../../utils/apiClient'
|
||||||
import { Comment } from '../Article/Comment'
|
import { Comment } from '../Article/Comment'
|
||||||
import { useLocalize } from '../../context/localize'
|
import { useLocalize } from '../../context/localize'
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
.asidePanel {
|
.asidePanel {
|
||||||
background: #1f1f1f;
|
background: #1f1f1f;
|
||||||
color: rgb(255 255 255 / 0.35);
|
color: rgb(255 255 255 / 35%);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 1.7rem;
|
font-size: 1.7rem;
|
||||||
|
@ -78,8 +78,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
border-bottom: 2px solid rgb(255 255 255 / 0.1);
|
border-bottom: 2px solid rgb(255 255 255 / 10%);
|
||||||
//margin-bottom: 1.8rem;
|
|
||||||
|
// margin-bottom: 1.8rem;
|
||||||
margin-top: 1.8rem;
|
margin-top: 1.8rem;
|
||||||
padding-bottom: 1.8rem;
|
padding-bottom: 1.8rem;
|
||||||
|
|
||||||
|
@ -125,7 +126,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: rgb(255 255 255 / 0.35);
|
color: rgb(255 255 255 / 35%);
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
|
@ -55,12 +55,7 @@ export const EditView = (props: EditViewProps) => {
|
||||||
const handleFormSubmit = async (e) => {
|
const handleFormSubmit = async (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
const article = await apiClient.updateArticle({
|
const article = await apiClient.publishDraft()
|
||||||
article: {
|
|
||||||
slug: props.shout.slug,
|
|
||||||
visibility: 'community'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
openPage(router, 'article', { slug: article.slug })
|
openPage(router, 'article', { slug: article.slug })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
.feedNavigation {
|
.feedNavigation {
|
||||||
@include font-size(1.5rem);
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { createEffect, createMemo, createSignal, For, onMount, Show } from 'solid-js'
|
import { createEffect, createSignal, For, onMount, Show } from 'solid-js'
|
||||||
import '../../styles/Feed.scss'
|
import '../../styles/Feed.scss'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
import { ArticleCard } from '../Feed/Card'
|
import { ArticleCard } from '../Feed/ArticleCard'
|
||||||
import { AuthorCard } from '../Author/Card'
|
import { AuthorCard } from '../Author/AuthorCard'
|
||||||
import { Sidebar } from '../Feed/Sidebar'
|
import { Sidebar } from '../Feed/Sidebar'
|
||||||
import { loadShouts, useArticlesStore } from '../../stores/zine/articles'
|
import { loadShouts, useArticlesStore } from '../../stores/zine/articles'
|
||||||
import { useAuthorsStore } from '../../stores/zine/authors'
|
import { useAuthorsStore } from '../../stores/zine/authors'
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {
|
||||||
import { useTopAuthorsStore } from '../../stores/zine/topAuthors'
|
import { useTopAuthorsStore } from '../../stores/zine/topAuthors'
|
||||||
import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
|
import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
|
||||||
import { splitToPages } from '../../utils/splitToPages'
|
import { splitToPages } from '../../utils/splitToPages'
|
||||||
import { ArticleCard } from '../Feed/Card'
|
import { ArticleCard } from '../Feed/ArticleCard'
|
||||||
import { useLocalize } from '../../context/localize'
|
import { useLocalize } from '../../context/localize'
|
||||||
|
|
||||||
type HomeProps = {
|
type HomeProps = {
|
||||||
|
|
|
@ -23,12 +23,14 @@ type InboxSearchParams = {
|
||||||
initChat: string
|
initChat: string
|
||||||
chat: string
|
chat: string
|
||||||
}
|
}
|
||||||
// const userSearch = (array: Author[], keyword: string) => {
|
|
||||||
// const searchTerm = keyword.toLowerCase()
|
const userSearch = (array: Author[], keyword: string) => {
|
||||||
// return array.filter((value) => {
|
return array.filter((value) => new RegExp(keyword.trim(), 'gi').test(value.name))
|
||||||
// return value.name.toLowerCase().match(new RegExp(searchTerm, 'g'))
|
}
|
||||||
// })
|
|
||||||
// }
|
const handleOpenInviteModal = () => {
|
||||||
|
showModal('inviteToChat')
|
||||||
|
}
|
||||||
|
|
||||||
export const InboxView = () => {
|
export const InboxView = () => {
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
|
@ -46,14 +48,15 @@ export const InboxView = () => {
|
||||||
const [messageToReply, setMessageToReply] = createSignal<MessageType | null>(null)
|
const [messageToReply, setMessageToReply] = createSignal<MessageType | null>(null)
|
||||||
const { session } = useSession()
|
const { session } = useSession()
|
||||||
const currentUserId = createMemo(() => session()?.user.id)
|
const currentUserId = createMemo(() => session()?.user.id)
|
||||||
|
|
||||||
// Поиск по диалогам
|
// Поиск по диалогам
|
||||||
const getQuery = (query) => {
|
const getQuery = (query) => {
|
||||||
// if (query().length >= 2) {
|
if (query().length >= 2) {
|
||||||
// const match = userSearch(recipients(), query())
|
const match = userSearch(recipients(), query())
|
||||||
// setRecipients(match)
|
setRecipients(match)
|
||||||
// } else {
|
} else {
|
||||||
// setRecipients(cashedRecipients())
|
// setRecipients(cashedRecipients())
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let chatWindow
|
let chatWindow
|
||||||
|
@ -136,10 +139,6 @@ export const InboxView = () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleOpenInviteModal = () => {
|
|
||||||
showModal('inviteToChat')
|
|
||||||
}
|
|
||||||
|
|
||||||
const chatsToShow = () => {
|
const chatsToShow = () => {
|
||||||
const sorted = chats().sort((a, b) => {
|
const sorted = chats().sort((a, b) => {
|
||||||
return b.updatedAt - a.updatedAt
|
return b.updatedAt - a.updatedAt
|
||||||
|
@ -158,7 +157,10 @@ export const InboxView = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleKeyDown = async (event) => {
|
const handleKeyDown = async (event) => {
|
||||||
if (event.keyCode === 13 && event.shiftKey) return
|
if (event.keyCode === 13 && event.shiftKey) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (event.keyCode === 13 && !event.shiftKey && postMessageText()?.trim().length > 0) {
|
if (event.keyCode === 13 && !event.shiftKey && postMessageText()?.trim().length > 0) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
handleSubmit()
|
handleSubmit()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Show, For, createSignal } from 'solid-js'
|
import { Show, For, createSignal } from 'solid-js'
|
||||||
import '../../styles/Search.scss'
|
import '../../styles/Search.scss'
|
||||||
import type { Shout } from '../../graphql/types.gen'
|
import type { Shout } from '../../graphql/types.gen'
|
||||||
import { ArticleCard } from '../Feed/Card'
|
import { ArticleCard } from '../Feed/ArticleCard'
|
||||||
|
|
||||||
import { loadShouts, useArticlesStore } from '../../stores/zine/articles'
|
import { loadShouts, useArticlesStore } from '../../stores/zine/articles'
|
||||||
import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
|
import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { splitToPages } from '../../utils/splitToPages'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import Slider from '../_shared/Slider'
|
import Slider from '../_shared/Slider'
|
||||||
import { Row1 } from '../Feed/Row1'
|
import { Row1 } from '../Feed/Row1'
|
||||||
import { ArticleCard } from '../Feed/Card'
|
import { ArticleCard } from '../Feed/ArticleCard'
|
||||||
import { useLocalize } from '../../context/localize'
|
import { useLocalize } from '../../context/localize'
|
||||||
|
|
||||||
type TopicsPageSearchParams = {
|
type TopicsPageSearchParams = {
|
||||||
|
|
|
@ -5,16 +5,15 @@
|
||||||
max-height: 360px;
|
max-height: 360px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-flow: row nowrap;
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.user {
|
.user {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-flow: row nowrap;
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 1.2rem;
|
margin-right: 1.2rem;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import type { i18n } from 'i18next'
|
||||||
import type { Accessor, JSX } from 'solid-js'
|
import type { Accessor, JSX } from 'solid-js'
|
||||||
import { createContext, createEffect, createSignal, Show, useContext } from 'solid-js'
|
import { createContext, createEffect, createSignal, Show, useContext } from 'solid-js'
|
||||||
import { useRouter } from '../stores/router'
|
import { useRouter } from '../stores/router'
|
||||||
import i18next from 'i18next'
|
import i18next, { changeLanguage, t } from 'i18next'
|
||||||
import Cookie from 'js-cookie'
|
import Cookie from 'js-cookie'
|
||||||
|
|
||||||
type LocalizeContextType = {
|
type LocalizeContextType = {
|
||||||
|
@ -30,13 +30,13 @@ export const LocalizeProvider = (props: { children: JSX.Element }) => {
|
||||||
|
|
||||||
const lng: Language = searchParams().lng === 'en' ? 'en' : 'ru'
|
const lng: Language = searchParams().lng === 'en' ? 'en' : 'ru'
|
||||||
|
|
||||||
i18next.changeLanguage(lng)
|
changeLanguage(lng)
|
||||||
setLang(lng)
|
setLang(lng)
|
||||||
Cookie.set('lng', lng)
|
Cookie.set('lng', lng)
|
||||||
changeSearchParam('lng', null)
|
changeSearchParam('lng', null)
|
||||||
})
|
})
|
||||||
|
|
||||||
const value: LocalizeContextType = { t: i18next.t, lang, setLang }
|
const value: LocalizeContextType = { t, lang, setLang }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LocalizeContext.Provider value={value}>
|
<LocalizeContext.Provider value={value}>
|
||||||
|
|
|
@ -54,7 +54,6 @@ export const SessionProvider = (props: { children: JSX.Element }) => {
|
||||||
initialValue: null
|
initialValue: null
|
||||||
})
|
})
|
||||||
|
|
||||||
const userSlug = createMemo(() => session()?.user?.slug)
|
|
||||||
const user = createMemo(() => session()?.user)
|
const user = createMemo(() => session()?.user)
|
||||||
|
|
||||||
const isAuthenticated = createMemo(() => Boolean(session()?.user?.slug))
|
const isAuthenticated = createMemo(() => Boolean(session()?.user?.slug))
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { createMemo, createSignal, For, lazy, onMount, Show, Suspense } from 'solid-js'
|
import { createSignal, For, onMount, Show } from 'solid-js'
|
||||||
import { PageLayout } from '../components/_shared/PageLayout'
|
import { PageLayout } from '../components/_shared/PageLayout'
|
||||||
import { useSession } from '../context/session'
|
import { useSession } from '../context/session'
|
||||||
import { Shout } from '../graphql/types.gen'
|
import { Shout } from '../graphql/types.gen'
|
||||||
import { useRouter } from '../stores/router'
|
|
||||||
import { apiClient } from '../utils/apiClient'
|
import { apiClient } from '../utils/apiClient'
|
||||||
|
|
||||||
export const DraftsPage = () => {
|
export const DraftsPage = () => {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { Beside } from '../components/Feed/Beside'
|
||||||
import Slider from '../components/_shared/Slider'
|
import Slider from '../components/_shared/Slider'
|
||||||
import { Row1 } from '../components/Feed/Row1'
|
import { Row1 } from '../components/Feed/Row1'
|
||||||
import styles from '../styles/Topic.module.scss'
|
import styles from '../styles/Topic.module.scss'
|
||||||
import { ArticleCard } from '../components/Feed/Card'
|
import { ArticleCard } from '../components/Feed/ArticleCard'
|
||||||
import { useLocalize } from '../context/localize'
|
import { useLocalize } from '../context/localize'
|
||||||
|
|
||||||
export const PRERENDERED_ARTICLES_COUNT = 21
|
export const PRERENDERED_ARTICLES_COUNT = 21
|
||||||
|
@ -27,14 +27,16 @@ export const LayoutShoutsPage = (props: PageProps) => {
|
||||||
const getLayout = createMemo<LayoutType>(() => {
|
const getLayout = createMemo<LayoutType>(() => {
|
||||||
const { page: getPage } = useRouter()
|
const { page: getPage } = useRouter()
|
||||||
const page = getPage()
|
const page = getPage()
|
||||||
if (page.route !== 'expo') throw new Error('ts guard')
|
if (page.route !== 'expo') {
|
||||||
|
throw new Error('ts guard')
|
||||||
|
}
|
||||||
const { layout } = page.params
|
const { layout } = page.params
|
||||||
return layout as LayoutType
|
return layout as LayoutType
|
||||||
})
|
})
|
||||||
const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false)
|
const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false)
|
||||||
const { sortedLayoutShouts, loadLayoutShoutsBy } = useLayoutsStore(getLayout(), props.layoutShouts)
|
const { sortedLayoutShouts, loadLayoutShoutsBy } = useLayoutsStore(getLayout(), props.layoutShouts)
|
||||||
const sortedArticles = createMemo<Shout[]>(() => sortedLayoutShouts().get(getLayout()) || [])
|
const sortedArticles = createMemo<Shout[]>(() => sortedLayoutShouts().get(getLayout()) || [])
|
||||||
const loadMoreLayout = async (kind: LayoutType) => {
|
const loadMoreLayout = async (_kind: LayoutType) => {
|
||||||
saveScrollPosition()
|
saveScrollPosition()
|
||||||
const { hasMore } = await loadLayoutShoutsBy({
|
const { hasMore } = await loadLayoutShoutsBy({
|
||||||
// filters: { layout: kind },
|
// filters: { layout: kind },
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { hydrate } from 'solid-js/web'
|
||||||
import type { PageContextBuiltInClient } from 'vite-plugin-ssr/client/router'
|
import type { PageContextBuiltInClient } from 'vite-plugin-ssr/client/router'
|
||||||
import type { PageContext } from './types'
|
import type { PageContext } from './types'
|
||||||
import { MetaProvider } from '@solidjs/meta'
|
import { MetaProvider } from '@solidjs/meta'
|
||||||
import i18next from 'i18next'
|
import { use as useI18next, init as initI18next } from 'i18next'
|
||||||
import HttpApi from 'i18next-http-backend'
|
import HttpApi from 'i18next-http-backend'
|
||||||
|
|
||||||
let layoutReady = false
|
let layoutReady = false
|
||||||
|
@ -12,8 +12,8 @@ let layoutReady = false
|
||||||
export const render = async (pageContext: PageContextBuiltInClient & PageContext) => {
|
export const render = async (pageContext: PageContextBuiltInClient & PageContext) => {
|
||||||
const { lng, pageProps } = pageContext
|
const { lng, pageProps } = pageContext
|
||||||
|
|
||||||
i18next.use(HttpApi)
|
useI18next(HttpApi)
|
||||||
await i18next.init({
|
await initI18next({
|
||||||
// debug: true,
|
// debug: true,
|
||||||
supportedLngs: ['ru', 'en'],
|
supportedLngs: ['ru', 'en'],
|
||||||
fallbackLng: lng,
|
fallbackLng: lng,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { App } from '../components/App'
|
||||||
import { initRouter } from '../stores/router'
|
import { initRouter } from '../stores/router'
|
||||||
import type { PageContext } from './types'
|
import type { PageContext } from './types'
|
||||||
import { MetaProvider, renderTags } from '@solidjs/meta'
|
import { MetaProvider, renderTags } from '@solidjs/meta'
|
||||||
import i18next from 'i18next'
|
import i18next, { changeLanguage, init as initI18next } from 'i18next'
|
||||||
import ru from '../../public/locales/ru/translation.json'
|
import ru from '../../public/locales/ru/translation.json'
|
||||||
import en from '../../public/locales/en/translation.json'
|
import en from '../../public/locales/en/translation.json'
|
||||||
import type { Language } from '../context/localize'
|
import type { Language } from '../context/localize'
|
||||||
|
@ -31,7 +31,8 @@ export const render = async (pageContext: PageContext) => {
|
||||||
const lng = getLng(pageContext)
|
const lng = getLng(pageContext)
|
||||||
|
|
||||||
if (!i18next.isInitialized) {
|
if (!i18next.isInitialized) {
|
||||||
i18next.init({
|
// eslint-disable-next-line import/no-named-as-default-member
|
||||||
|
await initI18next({
|
||||||
// debug: true,
|
// debug: true,
|
||||||
supportedLngs: ['ru', 'en'],
|
supportedLngs: ['ru', 'en'],
|
||||||
fallbackLng: lng,
|
fallbackLng: lng,
|
||||||
|
@ -43,7 +44,7 @@ export const render = async (pageContext: PageContext) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (i18next.language !== lng) {
|
} else if (i18next.language !== lng) {
|
||||||
await i18next.changeLanguage(lng)
|
await changeLanguage(lng)
|
||||||
}
|
}
|
||||||
|
|
||||||
initRouter(pageContext.urlParsed.pathname, pageContext.urlParsed.search)
|
initRouter(pageContext.urlParsed.pathname, pageContext.urlParsed.search)
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment__details {
|
.comment__details {
|
||||||
display: flex;
|
|
||||||
@include font-size(1.2rem);
|
@include font-size(1.2rem);
|
||||||
|
|
||||||
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
@ -76,10 +76,7 @@ main {
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
inset: 0;
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
border: none;
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
@include font-size(4rem);
|
@include font-size(4rem);
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,10 +239,10 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.button--light {
|
.button--light {
|
||||||
background-color: #f6f6f6;
|
|
||||||
color: #000;
|
|
||||||
@include font-size(1.5rem);
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
color: #000;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 0.6rem 1.2rem 0.6rem 1rem;
|
padding: 0.6rem 1.2rem 0.6rem 1rem;
|
||||||
|
@ -324,6 +324,7 @@ button {
|
||||||
.button--submit,
|
.button--submit,
|
||||||
.button--outline {
|
.button--outline {
|
||||||
@include font-size(2rem);
|
@include font-size(2rem);
|
||||||
|
|
||||||
padding: 1.6rem 2rem;
|
padding: 1.6rem 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,8 +500,9 @@ figure {
|
||||||
}
|
}
|
||||||
|
|
||||||
figcaption {
|
figcaption {
|
||||||
color: #9fa1a7;
|
|
||||||
@include font-size(1.2rem);
|
@include font-size(1.2rem);
|
||||||
|
|
||||||
|
color: #9fa1a7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view-switcher {
|
.view-switcher {
|
||||||
|
|
|
@ -253,6 +253,34 @@ export const apiClient = {
|
||||||
console.debug('[updateArticle]:', response.data)
|
console.debug('[updateArticle]:', response.data)
|
||||||
return response.data.updateArticle.shout
|
return response.data.updateArticle.shout
|
||||||
},
|
},
|
||||||
|
publishDraft: async (): Promise<Shout> => {
|
||||||
|
console.log('publishDraft')
|
||||||
|
return {
|
||||||
|
authors: undefined,
|
||||||
|
body: '',
|
||||||
|
community: '',
|
||||||
|
cover: '',
|
||||||
|
createdAt: undefined,
|
||||||
|
deletedAt: undefined,
|
||||||
|
deletedBy: undefined,
|
||||||
|
id: 0,
|
||||||
|
lang: '',
|
||||||
|
layout: '',
|
||||||
|
mainTopic: '',
|
||||||
|
media: '',
|
||||||
|
publishedAt: undefined,
|
||||||
|
slug: '',
|
||||||
|
stat: undefined,
|
||||||
|
subtitle: '',
|
||||||
|
title: '',
|
||||||
|
topics: undefined,
|
||||||
|
updatedAt: undefined,
|
||||||
|
updatedBy: undefined,
|
||||||
|
versionOf: '',
|
||||||
|
visibility: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
createReaction: async (input: ReactionInput) => {
|
createReaction: async (input: ReactionInput) => {
|
||||||
const response = await privateGraphQLClient.mutation(reactionCreate, { reaction: input }).toPromise()
|
const response = await privateGraphQLClient.mutation(reactionCreate, { reaction: input }).toPromise()
|
||||||
console.debug('[createReaction]:', response)
|
console.debug('[createReaction]:', response)
|
||||||
|
|
|
@ -36,10 +36,8 @@ export default defineConfig(({ mode }) => {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: []
|
external: []
|
||||||
},
|
},
|
||||||
chunkSizeWarningLimit: 812,
|
chunkSizeWarningLimit: 1024,
|
||||||
target: 'esnext'
|
target: 'esnext'
|
||||||
// FIXME ??
|
|
||||||
// polyfillDynamicImport: false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user