Style fixes

This commit is contained in:
Alexey Khaov 2023-01-24 00:31:47 +03:00
parent 1977493dcd
commit 95fd5e0f17
6 changed files with 72 additions and 15 deletions

View File

@ -103,7 +103,10 @@ export const LayoutShoutsPage = (props: PageProps) => {
<Show when={isLoaded()} fallback={<Loading />}> <Show when={isLoaded()} fallback={<Loading />}>
<div class={styles.topicPage}> <div class={styles.topicPage}>
<Show when={layout() && Boolean(sortedArticles())}> <Show when={layout() && Boolean(sortedArticles())}>
<div class="wide-container">
<h1>{title()}</h1> <h1>{title()}</h1>
</div>
<ModeSwitcher /> <ModeSwitcher />
<Row1 article={sortedArticles()[0]} /> <Row1 article={sortedArticles()[0]} />
<Row2 articles={sortedArticles().slice(1, 3)} /> <Row2 articles={sortedArticles().slice(1, 3)} />

View File

@ -13,6 +13,7 @@ import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll'
import { splitToPages } from '../../utils/splitToPages' import { splitToPages } from '../../utils/splitToPages'
import { RatingControl } from '../Article/RatingControl' import { RatingControl } from '../Article/RatingControl'
import styles from './Author.module.scss' import styles from './Author.module.scss'
import stylesArticle from '../../styles/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'
@ -95,6 +96,43 @@ export const AuthorView = (props: AuthorProps) => {
} }
}) })
const zhopa = {
'v-kramer': {
_id: 'v-kramer',
id: 33,
slug: 'v-kramer',
name: 'Владислав Крамер',
bio: 'юрист, публицист, охотник на ведьм',
about: null,
userpic: '',
communities: null,
links: [],
createdAt: '2016-04-25T10:21:25.065000',
lastSeen: '2023-01-22T14:37:55.058203'
},
'aleksei-bodyashkin': {
id: 831,
name: 'Алексей Бодяшкин',
slug: 'aleksei-bodyashkin',
userpic:
'https://assets.discours.io/unsafe/100x/production/image/d4d5bf40-974c-11ed-9568-bf8d9bd79f61.jpg'
},
'vsevolod-korolyov': {
id: 680,
name: 'Всеволод Королёв',
slug: 'vsevolod-korolyov',
userpic:
'https://assets.discours.io/unsafe/100x/production/image/5b959660-944f-11ec-86dd-e3ee00090109.jpg'
},
'igor-bobyrev': { id: 790, name: 'Игорь Бобырев', slug: 'igor-bobyrev', userpic: '' },
'natasha-lozinskaya': {
id: 829,
name: 'Наташа Лозинская',
slug: 'natasha-lozinskaya',
userpic: ''
}
}
return ( return (
<div class="author-page"> <div class="author-page">
<Show when={author()} fallback={<div class="center">{t('Loading')}</div>}> <Show when={author()} fallback={<div class="center">{t('Loading')}</div>}>
@ -118,11 +156,13 @@ export const AuthorView = (props: AuthorProps) => {
{t('Comments')} {t('Comments')}
</button> </button>
</li> </li>
{/*
<li classList={{ selected: searchParams().by === 'popular' }}> <li classList={{ selected: searchParams().by === 'popular' }}>
<button type="button" onClick={() => changeSearchParam('by', 'popular')}> <button type="button" onClick={() => changeSearchParam('by', 'popular')}>
Популярное Популярное
</button> </button>
</li> </li>
*/}
<li classList={{ selected: searchParams().by === 'about' }}> <li classList={{ selected: searchParams().by === 'about' }}>
<button type="button" onClick={() => changeSearchParam('by', 'about')}> <button type="button" onClick={() => changeSearchParam('by', 'about')}>
О себе О себе
@ -162,13 +202,26 @@ export const AuthorView = (props: AuthorProps) => {
</div> </div>
</div> </div>
<Switch fallback={<p>дефолтное состояние</p>}> <Switch
fallback={
<div class="wide-container">
<p>дефолтное состояние</p>
</div>
}
>
<Match when={searchParams().by === 'about'}> <Match when={searchParams().by === 'about'}>
<h1>About</h1> <div class="wide-container">
<p>{JSON.stringify(authorEntities())}</p> <Show when={authorEntities()[author().slug].bio}>
<p>{authorEntities()[author().slug].bio}</p>
</Show>
</div>
</Match> </Match>
<Match when={searchParams().by === 'commented'}> <Match when={searchParams().by === 'commented'}>
<div class="wide-container">
<ul class={stylesArticle.comments}>
<For each={commented()}>{(comment) => <Comment comment={comment} />}</For> <For each={commented()}>{(comment) => <Comment comment={comment} />}</For>
</ul>
</div>
</Match> </Match>
<Match when={searchParams().by === 'popular'}> <Match when={searchParams().by === 'popular'}>
<Row1 article={sortedArticles()[0]} /> <Row1 article={sortedArticles()[0]} />

View File

@ -2,7 +2,8 @@
.wrapper { .wrapper {
border: 2px solid #e8e8e8; border: 2px solid #e8e8e8;
border-radius: 8px; border-radius: 8px;
padding: 16px; padding: 3rem 1.6rem 1.6rem;
position: relative;
.growArea { .growArea {
display: grid; display: grid;
@ -15,7 +16,7 @@
transition: height 1.3s ease-in-out; transition: height 1.3s ease-in-out;
} }
& textarea { textarea {
margin-bottom: 0; margin-bottom: 0;
font-family: inherit; font-family: inherit;
resize: none; resize: none;
@ -36,14 +37,13 @@
} }
&::after, &::after,
& textarea { textarea {
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
padding: 0; padding: 0;
grid-area: 1 / 1 / 2 / 2; grid-area: 1 / 1 / 2 / 2;
width: 100%; width: 100%;
min-height: unset;
} }
} }

View File

@ -47,6 +47,7 @@ const GrowingTextarea = (props: Props) => {
onInput={(event) => handleChangeMessage(event)} onInput={(event) => handleChangeMessage(event)}
placeholder={props?.placeholder} placeholder={props?.placeholder}
/> />
<label for="">{props?.placeholder}</label>
</div> </div>
<div class={clsx(styles.actions, { [styles.visible]: inputText().trim().length > 0 })}> <div class={clsx(styles.actions, { [styles.visible]: inputText().trim().length > 0 })}>
<div class={styles.buttons}> <div class={styles.buttons}>

View File

@ -26,6 +26,7 @@
"Collaborate": "Помочь редактировать", "Collaborate": "Помочь редактировать",
"Comments": "Комментарии", "Comments": "Комментарии",
"Communities": "Сообщества", "Communities": "Сообщества",
"Cooperate": "Соучаствовать",
"Copy link": "Скопировать ссылку", "Copy link": "Скопировать ссылку",
"Create account": "Создать аккаунт", "Create account": "Создать аккаунт",
"Create post": "Создать публикацию", "Create post": "Создать публикацию",
@ -65,6 +66,7 @@
"I have an account": "У меня есть аккаунт!", "I have an account": "У меня есть аккаунт!",
"I have no account yet": "У меня еще нет аккаунта", "I have no account yet": "У меня еще нет аккаунта",
"I know the password": "Я знаю пароль", "I know the password": "Я знаю пароль",
"Invite to collab": "Пригласить к участию",
"Invalid email": "Проверьте правильность ввода почты", "Invalid email": "Проверьте правильность ввода почты",
"Join": "Присоединиться", "Join": "Присоединиться",
"Join our maillist": "Чтобы получать рассылку лучших публикаций, просто укажите свою почту", "Join our maillist": "Чтобы получать рассылку лучших публикаций, просто укажите свою почту",

View File

@ -243,11 +243,10 @@ button {
border: 2px solid #000; border: 2px solid #000;
border-radius: 0.8rem; border-radius: 0.8rem;
color: #000; color: #000;
font-size: 1.2em; font-size: 1.4rem;
line-height: 2.8rem; line-height: 2.8rem;
height: 3.2rem; height: 3.2rem;
padding: 0; padding: 0 1rem;
width: 3.2rem;
&:hover { &:hover {
background: #000; background: #000;
@ -400,10 +399,9 @@ form {
} }
textarea { textarea {
min-height: 10em;
& ~ label { & ~ label {
top: 3rem; left: 1.6rem;
top: 3.2rem;
} }
} }