Merge remote-tracking branch 'gitlab/dev' into drafts-2
This commit is contained in:
commit
796ca57167
|
@ -21,6 +21,11 @@ npm run typecheck:watch
|
||||||
```
|
```
|
||||||
## Code generation
|
## Code generation
|
||||||
|
|
||||||
|
generate new SolidJS component:
|
||||||
|
```
|
||||||
|
npx hygen component new NewComponentName
|
||||||
|
```
|
||||||
|
|
||||||
generate new SolidJS context:
|
generate new SolidJS context:
|
||||||
```
|
```
|
||||||
npx hygen context new NewContextName
|
npx hygen context new NewContextName
|
||||||
|
|
18
_templates/component/new/component.ejs.t
Normal file
18
_templates/component/new/component.ejs.t
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
to: src/components/<%= h.changeCase.pascal(name) %>/<%= h.changeCase.pascal(name) %>.tsx
|
||||||
|
---
|
||||||
|
|
||||||
|
import { clsx } from 'clsx'
|
||||||
|
import styles from './<%= h.changeCase.pascal(name) %>.module.scss'
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
class?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const <%= h.changeCase.pascal(name) %> = (props: Props) => {
|
||||||
|
return (
|
||||||
|
<div class={clsx(styles.<%= h.changeCase.pascal(name) %>, props.class)}>
|
||||||
|
<%= h.changeCase.pascal(name) %>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
4
_templates/component/new/index.ejs.t
Normal file
4
_templates/component/new/index.ejs.t
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
to: src/components/<%= h.changeCase.pascal(name) %>/index.ts
|
||||||
|
---
|
||||||
|
export { <%= h.changeCase.pascal(name) %> } from './<%= h.changeCase.pascal(name) %>'
|
7
_templates/component/new/styles.ejs.t
Normal file
7
_templates/component/new/styles.ejs.t
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
to: src/components/<%= h.changeCase.pascal(name) %>/<%= h.changeCase.pascal(name) %>.module.scss
|
||||||
|
---
|
||||||
|
|
||||||
|
.<%= h.changeCase.pascal(name) %> {
|
||||||
|
display: block;
|
||||||
|
}
|
4
public/icons/up-button.svg
Normal file
4
public/icons/up-button.svg
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect x="1" y="1" width="26" height="26" stroke="currentColor" stroke-width="2"/>
|
||||||
|
<path d="M10 11H13V20H15V11H18L14 7L10 11Z" fill="currentColor"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 251 B |
|
@ -166,6 +166,7 @@
|
||||||
"Restore password": "Restore password",
|
"Restore password": "Restore password",
|
||||||
"Save draft": "Save draft",
|
"Save draft": "Save draft",
|
||||||
"Save settings": "Save settings",
|
"Save settings": "Save settings",
|
||||||
|
"Scroll up": "Scroll up",
|
||||||
"Search": "Search",
|
"Search": "Search",
|
||||||
"Search author": "Search author",
|
"Search author": "Search author",
|
||||||
"Search topic": "Search topic",
|
"Search topic": "Search topic",
|
||||||
|
|
|
@ -187,6 +187,7 @@
|
||||||
"Send": "Отправить",
|
"Send": "Отправить",
|
||||||
"Send link again": "Прислать ссылку ещё раз",
|
"Send link again": "Прислать ссылку ещё раз",
|
||||||
"Settings": "Настройки",
|
"Settings": "Настройки",
|
||||||
|
"Scroll up": "Наверх",
|
||||||
"Share": "Поделиться",
|
"Share": "Поделиться",
|
||||||
"Short opening": "Небольшое вступление, чтобы заинтересовать читателя",
|
"Short opening": "Небольшое вступление, чтобы заинтересовать читателя",
|
||||||
"Show": "Показать",
|
"Show": "Показать",
|
||||||
|
|
|
@ -392,7 +392,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.userControl {
|
.userControl {
|
||||||
align-items: baseline;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity 0.3s;
|
transition: opacity 0.3s;
|
||||||
|
@ -428,6 +428,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 2.4em;
|
height: 2.4em;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-left: 0.5em;
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: margin-left 0.3s;
|
transition: margin-left 0.3s;
|
||||||
width: 2.4em;
|
width: 2.4em;
|
||||||
|
@ -484,11 +485,8 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.icon {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
|
.icon {
|
||||||
img {
|
img {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -508,7 +506,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.userControlItemVerbose {
|
.userControlItemVerbose {
|
||||||
margin-right: 0.5em;
|
margin-left: 0.5em;
|
||||||
|
|
||||||
|
&:global(.loginbtn) {
|
||||||
|
.icon {
|
||||||
|
height: 2.4rem;
|
||||||
|
width: 2.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: none;
|
||||||
|
height: 2.4rem;
|
||||||
|
width: 2.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(lg) {
|
@include media-breakpoint-up(lg) {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
@ -519,8 +530,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.textLabel {
|
.textLabel {
|
||||||
// padding: 0 1.2rem;
|
padding: 0 1.2rem;
|
||||||
|
|
||||||
display: inline;
|
display: inline;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
@ -531,4 +541,10 @@
|
||||||
a::before {
|
a::before {
|
||||||
border-radius: 1.2em !important;
|
border-radius: 1.2em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
.icon {
|
||||||
|
filter: invert(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
.titleInput,
|
.titleInput,
|
||||||
.subtitleInput {
|
.subtitleInput {
|
||||||
border: 0;
|
border: 0;
|
||||||
|
@ -98,6 +100,49 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scrollTopButton {
|
||||||
|
cursor: pointer;
|
||||||
|
left: 2rem;
|
||||||
|
position: sticky;
|
||||||
|
top: calc(100vh - 40px);
|
||||||
|
width: 2.8rem;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
@include media-breakpoint-down(md) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-breakpoint-up(xl) {
|
||||||
|
left: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.icon {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollTopButtonLabel {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollTopButtonLabel {
|
||||||
|
@include font-size(1.4rem);
|
||||||
|
|
||||||
|
display: none;
|
||||||
|
font-weight: bold;
|
||||||
|
left: 100%;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
.inputContainer {
|
.inputContainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { useRouter } from '../../stores/router'
|
||||||
import { Editor } from '../Editor/Editor'
|
import { Editor } from '../Editor/Editor'
|
||||||
import { Panel } from '../Editor/Panel'
|
import { Panel } from '../Editor/Panel'
|
||||||
import { useEditorContext } from '../../context/editor'
|
import { useEditorContext } from '../../context/editor'
|
||||||
|
import { Icon } from '../_shared/Icon'
|
||||||
|
|
||||||
type EditViewProps = {
|
type EditViewProps = {
|
||||||
shout: Shout
|
shout: Shout
|
||||||
|
@ -68,8 +69,20 @@ export const EditView = (props: EditViewProps) => {
|
||||||
setForm('slug', slug)
|
setForm('slug', slug)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scrollTop = () => {
|
||||||
|
window.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<button class={styles.scrollTopButton} onClick={scrollTop}>
|
||||||
|
<Icon name="up-button" class={styles.icon} />
|
||||||
|
<span class={styles.scrollTopButtonLabel}>{t('Scroll up')}</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class={styles.container}>
|
<div class={styles.container}>
|
||||||
<Title>{t('Write an article')}</Title>
|
<Title>{t('Write an article')}</Title>
|
||||||
<form>
|
<form>
|
||||||
|
|
|
@ -189,3 +189,33 @@ h5 {
|
||||||
transition: filter 0.3s;
|
transition: filter 0.3s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(.solid-select-control) {
|
||||||
|
align-items: center !important;
|
||||||
|
border: 2px solid #e8e8e8 !important;
|
||||||
|
border-radius: 2px;
|
||||||
|
min-height: 61px;
|
||||||
|
padding: 1rem 0.7rem 0.5rem 1.2rem !important;
|
||||||
|
|
||||||
|
:global(.solid-select-input) {
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.solid-select-multi-value) {
|
||||||
|
margin: 0 0.5rem 0.5rem 0;
|
||||||
|
padding-left: 0.8rem;
|
||||||
|
padding-bottom: 0.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.solid-select-multi-value-remove) {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
line-height: 1.1;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.5;
|
||||||
|
text-shadow: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user