fix: update dependencies to latest + fix upload of files

This commit is contained in:
2023-07-22 16:34:23 +02:00
parent 41c2d95dde
commit 5a411ade19
42 changed files with 1382 additions and 8571 deletions

View File

@ -87,7 +87,11 @@ export const GuildSettings: React.FC = () => {
const formData = new FormData()
formData.append('icon', file)
try {
await authentication.api.put(`/guilds/${guild.id}/icon`, formData)
await authentication.api.put(`/guilds/${guild.id}/icon`, formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
setFetchState('idle')
} catch (error) {
setFetchState('error')

View File

@ -50,7 +50,8 @@ export const MessageText: React.FC<MessageContentProps> = (props) => {
)
},
emoji: (props) => {
return <Emoji value={props.value} size={20} tooltip />
const { value } = props
return <Emoji value={value} size={20} tooltip />
},
code: (properties) => {
const { inline, className, children, ...props } = properties

View File

@ -60,7 +60,12 @@ export const SendMessage: React.FC<SendMessageProps> = (props) => {
formData.append('file', file)
await authentication.api.post(
`/channels/${path.channelId}/messages/uploads`,
formData
formData,
{
headers: {
'Content-Type': 'multipart/form-data'
}
}
)
}
}

View File

@ -156,7 +156,12 @@ export const UserSettings: React.FC = () => {
try {
const { data } = await authentication.api.put(
`/users/current/logo`,
formData
formData,
{
headers: {
'Content-Type': 'multipart/form-data'
}
}
)
setUser((oldUser) => {
return {

View File

@ -13,9 +13,9 @@ export const Head: React.FC<HeadProps> = (props) => {
const {
title = 'Thream',
image = 'https://thream.divlo.fr/images/icons/128x128.png',
image = 'https://thream.theoludwig.fr/images/icon-128x128.png',
description = t('common:description'),
url = 'https://thream.divlo.fr/'
url = 'https://thream.theoludwig.fr/'
} = props
return (
@ -26,7 +26,7 @@ export const Head: React.FC<HeadProps> = (props) => {
{/* Meta Tag */}
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta name='description' content={description} />
<meta name='Language' content='fr, en' />
<meta name='Language' content='fr-FR, en-US' />
<meta name='theme-color' content='#27B05E' />
{/* Open Graph Metadata */}
@ -35,7 +35,7 @@ export const Head: React.FC<HeadProps> = (props) => {
<meta property='og:url' content={url} />
<meta property='og:image' content={image} />
<meta property='og:description' content={description} />
<meta property='og:locale' content='fr_FR, en_US' />
<meta property='og:locale' content='fr-FR, en-US' />
<meta property='og:site_name' content={title} />
{/* Twitter card Metadata */}
@ -43,12 +43,6 @@ export const Head: React.FC<HeadProps> = (props) => {
<meta name='twitter:description' content={description} />
<meta name='twitter:title' content={title} />
<meta name='twitter:image' content={image} />
{/* PWA Data */}
<link rel='manifest' href='/manifest.json' />
<meta name='apple-mobile-web-app-capable' content='yes' />
<meta name='mobile-web-app-capable' content='yes' />
<link rel='apple-touch-icon' href={image} />
</NextHead>
)
}

View File

@ -15,7 +15,7 @@ export const Header: React.FC = () => {
quality={100}
width={60}
height={60}
src='/images/icons/Thream.png'
src='/images/Thream.png'
alt='Thream'
/>
<span className='ml-1 hidden font-headline font-medium text-green-800 dark:text-green-400 xs:block'>

View File

@ -7,10 +7,10 @@ export interface LoaderProps {
}
export const Loader: React.FC<LoaderProps> = (props) => {
const { width = 50, height = 50 } = props
const { width = 50, height = 50, className } = props
return (
<div className={props.className}>
<div className={className}>
<div
data-cy='progress-spinner'
className='relative mx-auto my-0 before:block before:pt-[100%] before:content-none'