Merge remote-tracking branch 'gitlab/dev' into editor
# Conflicts: # package-lock.json # package.json # src/components/Views/AllAuthors.tsx # src/components/Views/AllTopics.tsx
This commit is contained in:
commit
cb8d3f0f0b
24
api/image.mjs
Normal file
24
api/image.mjs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import fetch from 'node-fetch'
|
||||||
|
|
||||||
|
export default async function handler(req, res) {
|
||||||
|
const imageUrl = req.query.url
|
||||||
|
|
||||||
|
if (!imageUrl) {
|
||||||
|
return res.status(400).send('Missing URL parameter')
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const imageRes = await fetch(imageUrl)
|
||||||
|
|
||||||
|
if (!imageRes.ok) {
|
||||||
|
return res.status(404).send('Image not found')
|
||||||
|
}
|
||||||
|
|
||||||
|
res.setHeader('Content-Type', imageRes.headers.get('content-type'))
|
||||||
|
|
||||||
|
imageRes.body.pipe(res)
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err)
|
||||||
|
return res.status(404).send('Error')
|
||||||
|
}
|
||||||
|
}
|
1170
package-lock.json
generated
1170
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -35,7 +35,8 @@
|
||||||
"@hocuspocus/provider": "^1.1.3",
|
"@hocuspocus/provider": "^1.1.3",
|
||||||
"formidable": "^2.1.1",
|
"formidable": "^2.1.1",
|
||||||
"i18next": "^22.4.11",
|
"i18next": "^22.4.11",
|
||||||
"mailgun.js": "^8.2.1"
|
"mailgun.js": "^8.2.1",
|
||||||
|
"node-fetch": "^3.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.21.0",
|
"@babel/core": "^7.21.0",
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
.navigationHeader {
|
.navigationHeader {
|
||||||
@include font-size(1.8rem);
|
@include font-size(1.8rem);
|
||||||
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 1.1em !important;
|
margin-top: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navigation {
|
.navigation {
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
flex-wrap: nowrap !important;
|
flex-wrap: nowrap !important;
|
||||||
justify-content: space-between;
|
justify-content: flex-start;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
.fixed & {
|
.fixed & {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.ratingContainer {
|
.ratingContainer {
|
||||||
@include font-size(1.5rem);
|
@include font-size(1.5rem);
|
||||||
|
|
||||||
display: inline-block;
|
display: inline-flex;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ export const FeedView = () => {
|
||||||
<>
|
<>
|
||||||
<div class="wide-container feed">
|
<div class="wide-container feed">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class={clsx('left-col col-md-5 col-xl-4', styles.feedNavigation)}>
|
<div class={clsx('col-md-5 col-xl-4', styles.feedNavigation)}>
|
||||||
<FeedSidebar authors={sortedAuthors()} />
|
<FeedSidebar authors={sortedAuthors()} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
8
src/components/_shared/Image/Image.tsx
Normal file
8
src/components/_shared/Image/Image.tsx
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { splitProps } from 'solid-js'
|
||||||
|
import type { JSX } from 'solid-js'
|
||||||
|
|
||||||
|
export const Image = (props: JSX.ImgHTMLAttributes<HTMLImageElement>) => {
|
||||||
|
const [local, others] = splitProps(props, ['src'])
|
||||||
|
|
||||||
|
return <img src={`/api/image?url=${encodeURI(local.src)}`} {...others} />
|
||||||
|
}
|
1
src/components/_shared/Image/index.ts
Normal file
1
src/components/_shared/Image/index.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export { Image } from './Image'
|
|
@ -114,6 +114,10 @@ h5 {
|
||||||
|
|
||||||
.leftNavigation {
|
.leftNavigation {
|
||||||
top: 9rem !important;
|
top: 9rem !important;
|
||||||
|
|
||||||
|
h4:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.passwordToggleControl {
|
.passwordToggleControl {
|
||||||
|
|
|
@ -8,13 +8,14 @@ export const ProfileSecurityPage = () => {
|
||||||
return (
|
return (
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<div class="wide-container">
|
<div class="wide-container">
|
||||||
<div class="offset-md-5">
|
<div class="row">
|
||||||
<div class="left-col">
|
<div class="col-md-5">
|
||||||
<div class={clsx('left-navigation', styles.leftNavigation)}>
|
<div class={clsx('left-navigation', styles.leftNavigation)}>
|
||||||
<ProfileSettingsNavigation />
|
<ProfileSettingsNavigation />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-19">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-20 col-lg-18 col-xl-16">
|
<div class="col-md-20 col-lg-18 col-xl-16">
|
||||||
<h1>Вход и безопасность</h1>
|
<h1>Вход и безопасность</h1>
|
||||||
|
@ -126,6 +127,7 @@ export const ProfileSecurityPage = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { useSession } from '../../context/session'
|
||||||
import { Button } from '../../components/_shared/Button'
|
import { Button } from '../../components/_shared/Button'
|
||||||
import { useSnackbar } from '../../context/snackbar'
|
import { useSnackbar } from '../../context/snackbar'
|
||||||
import { useLocalize } from '../../context/localize'
|
import { useLocalize } from '../../context/localize'
|
||||||
|
import { Image } from '../../components/_shared/Image'
|
||||||
|
|
||||||
const handleFileUpload = async (uploadFile: UploadFile) => {
|
const handleFileUpload = async (uploadFile: UploadFile) => {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
@ -84,12 +85,13 @@ export const ProfileSettingsPage = () => {
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<Show when={form}>
|
<Show when={form}>
|
||||||
<div class="wide-container">
|
<div class="wide-container">
|
||||||
<div class="offset-md-5">
|
<div class="row">
|
||||||
<div class="left-col">
|
<div class="col-md-5">
|
||||||
<div class={clsx('left-navigation', styles.leftNavigation)}>
|
<div class={clsx('left-navigation', styles.leftNavigation)}>
|
||||||
<ProfileSettingsNavigation />
|
<ProfileSettingsNavigation />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-19">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-20 col-lg-18 col-xl-16">
|
<div class="col-md-20 col-lg-18 col-xl-16">
|
||||||
<h1>{t('Profile settings')}</h1>
|
<h1>{t('Profile settings')}</h1>
|
||||||
|
@ -99,7 +101,7 @@ export const ProfileSettingsPage = () => {
|
||||||
<div class="pretty-form__item">
|
<div class="pretty-form__item">
|
||||||
<div class={styles.avatarContainer}>
|
<div class={styles.avatarContainer}>
|
||||||
<Show when={!isUserpicUpdating()} fallback={<Loading />}>
|
<Show when={!isUserpicUpdating()} fallback={<Loading />}>
|
||||||
<img
|
<Image
|
||||||
class={styles.avatar}
|
class={styles.avatar}
|
||||||
src={form.userpic}
|
src={form.userpic}
|
||||||
alt={form.name}
|
alt={form.name}
|
||||||
|
@ -227,6 +229,7 @@ export const ProfileSettingsPage = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,13 +9,14 @@ export const ProfileSubscriptionsPage = () => {
|
||||||
return (
|
return (
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<div class="wide-container">
|
<div class="wide-container">
|
||||||
<div class="offset-md-5">
|
<div class="row">
|
||||||
<div class="left-col">
|
<div class="col-md-5">
|
||||||
<div class={clsx('left-navigation', styles.leftNavigation)}>
|
<div class={clsx('left-navigation', styles.leftNavigation)}>
|
||||||
<ProfileSettingsNavigation />
|
<ProfileSettingsNavigation />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-19">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-20 col-lg-18 col-xl-16">
|
<div class="col-md-20 col-lg-18 col-xl-16">
|
||||||
<h1>Подписки</h1>
|
<h1>Подписки</h1>
|
||||||
|
@ -128,6 +129,7 @@ export const ProfileSubscriptionsPage = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,22 +726,6 @@ figcaption {
|
||||||
margin-left: 235px;
|
margin-left: 235px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left-col {
|
|
||||||
height: 100%;
|
|
||||||
padding-right: 2rem;
|
|
||||||
right: 100%;
|
|
||||||
top: 0;
|
|
||||||
|
|
||||||
@include media-breakpoint-up(md) {
|
|
||||||
position: absolute;
|
|
||||||
width: 161px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include media-breakpoint-up(lg) {
|
|
||||||
width: 235px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-navigation {
|
.left-navigation {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user