Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
b5089f7f0b | |||
67a1699102 | |||
e8a9ce4e69 | |||
8f5bc2fe21 | |||
109da1be71 | |||
1ea78821b0 | |||
12ceefd650 | |||
734357b396 | |||
ccaf5234ed |
@ -1,2 +1,2 @@
|
||||
ARG VARIANT="16"
|
||||
ARG VARIANT="18"
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
|
||||
|
@ -10,8 +10,6 @@
|
||||
"editorconfig.editorconfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"divlo.vscode-styled-jsx-syntax",
|
||||
"divlo.vscode-styled-jsx-languageserver",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"mikestead.dotenv",
|
||||
"davidanson.vscode-markdownlint",
|
||||
|
@ -1,3 +1,3 @@
|
||||
COMPOSE_PROJECT_NAME=thream-website
|
||||
NEXT_PUBLIC_API_URL=http://localhost:8080
|
||||
NEXT_PUBLIC_API_URL=http://127.0.0.1:8080
|
||||
PORT=3000
|
||||
|
6
.github/workflows/analyze.yml
vendored
6
.github/workflows/analyze.yml
vendored
@ -16,12 +16,12 @@ jobs:
|
||||
language: ['javascript']
|
||||
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
|
||||
- name: 'Initialize CodeQL'
|
||||
uses: 'github/codeql-action/init@v1'
|
||||
uses: 'github/codeql-action/init@v2'
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: 'Perform CodeQL Analysis'
|
||||
uses: 'github/codeql-action/analyze@v1'
|
||||
uses: 'github/codeql-action/analyze@v2'
|
||||
|
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -10,12 +10,12 @@ jobs:
|
||||
build:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
uses: 'actions/setup-node@v3.5.1'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install'
|
||||
|
8
.github/workflows/lint.yml
vendored
8
.github/workflows/lint.yml
vendored
@ -10,12 +10,12 @@ jobs:
|
||||
lint:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
uses: 'actions/setup-node@v3.5.1'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install'
|
||||
@ -42,6 +42,6 @@ jobs:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
|
||||
- name: 'lint:docker'
|
||||
uses: 'hadolint/hadolint-action@v1.6.0'
|
||||
uses: 'hadolint/hadolint-action@v3.0.0'
|
||||
with:
|
||||
dockerfile: './Dockerfile'
|
||||
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
||||
release:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
@ -21,9 +21,9 @@ jobs:
|
||||
git_commit_gpgsign: true
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v2.4.0'
|
||||
uses: 'actions/setup-node@v3.5.1'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install'
|
||||
|
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
@ -10,12 +10,12 @@ jobs:
|
||||
test-unit:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
uses: 'actions/setup-node@v3.5.1'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install'
|
||||
@ -27,12 +27,12 @@ jobs:
|
||||
test-lighthouse:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
uses: 'actions/setup-node@v3.5.1'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install'
|
||||
@ -52,12 +52,12 @@ jobs:
|
||||
test-e2e:
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3.0.0'
|
||||
- uses: 'actions/checkout@v3.1.0'
|
||||
|
||||
- name: 'Use Node.js'
|
||||
uses: 'actions/setup-node@v3.0.0'
|
||||
uses: 'actions/setup-node@v3.5.1'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 'Install'
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -50,3 +50,7 @@ npm-debug.log*
|
||||
.lighthouseci
|
||||
.vercel
|
||||
*.hbs
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"urls": [
|
||||
"http://localhost:3000/",
|
||||
"http://localhost:3000/authentication/forgot-password",
|
||||
"http://localhost:3000/authentication/reset-password",
|
||||
"http://localhost:3000/authentication/signin",
|
||||
"http://localhost:3000/authentication/signup"
|
||||
"http://127.0.0.1:3000/",
|
||||
"http://127.0.0.1:3000/authentication/forgot-password",
|
||||
"http://127.0.0.1:3000/authentication/reset-password",
|
||||
"http://127.0.0.1:3000/authentication/signin",
|
||||
"http://127.0.0.1:3000/authentication/signup"
|
||||
]
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
"startServerReadyPattern": "ready on",
|
||||
"startServerReadyTimeout": 20000,
|
||||
"url": [
|
||||
"http://localhost:3000/",
|
||||
"http://localhost:3000/authentication/forgot-password",
|
||||
"http://localhost:3000/authentication/reset-password",
|
||||
"http://localhost:3000/authentication/signin",
|
||||
"http://localhost:3000/authentication/signup"
|
||||
"http://127.0.0.1:3000/",
|
||||
"http://127.0.0.1:3000/authentication/forgot-password",
|
||||
"http://127.0.0.1:3000/authentication/reset-password",
|
||||
"http://127.0.0.1:3000/authentication/signin",
|
||||
"http://127.0.0.1:3000/authentication/signup"
|
||||
],
|
||||
"numberOfRuns": 1
|
||||
},
|
||||
|
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
@ -3,8 +3,6 @@
|
||||
"editorconfig.editorconfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"divlo.vscode-styled-jsx-syntax",
|
||||
"divlo.vscode-styled-jsx-languageserver",
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"mikestead.dotenv",
|
||||
"davidanson.vscode-markdownlint",
|
||||
|
@ -16,6 +16,7 @@ All work on **Thream/website** happens directly on [GitHub](https://github.com/T
|
||||
- Suggest a new feature idea.
|
||||
- Correct spelling errors, improvements or additions to documentation files.
|
||||
- Improve structure/format/performance/refactor/tests of the code.
|
||||
- [Add translations](#add-a-translation).
|
||||
|
||||
## Pull Requests
|
||||
|
||||
@ -61,3 +62,15 @@ Scopes define what part of the code changed.
|
||||
git commit -m "feat(components): add Button"
|
||||
git commit -m "docs(readme): update installation process"
|
||||
```
|
||||
|
||||
## Add a translation
|
||||
|
||||
[Reference issue](https://github.com/Thream/website/issues/24)
|
||||
|
||||
Feel free to contribute to Thream and add new languages, we would appreciate your help!
|
||||
|
||||
To add a new language:
|
||||
|
||||
- `npm install`
|
||||
- `npm run generate`
|
||||
- Start editing JSON files with the translation in `locales/{{locale}}` (e.g: `locales/en`)
|
||||
|
18
Dockerfile
18
Dockerfile
@ -1,23 +1,21 @@
|
||||
FROM node:16.17.0 AS dependencies
|
||||
FROM node:18.12.1 AS dependencies
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./package*.json ./
|
||||
RUN npm install
|
||||
|
||||
FROM node:16.17.0 AS builder
|
||||
FROM node:18.12.1 AS builder
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./ ./
|
||||
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
|
||||
RUN npm run build
|
||||
|
||||
FROM node:16.17.0 AS runner
|
||||
FROM node:18.12.1 AS runner
|
||||
WORKDIR /usr/src/app
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
COPY --from=builder /usr/src/app/.next/standalone ./
|
||||
COPY --from=builder /usr/src/app/.next/static ./.next/static
|
||||
COPY --from=builder /usr/src/app/public ./public
|
||||
COPY --from=builder /usr/src/app/.next ./.next
|
||||
COPY --from=builder /usr/src/app/i18n.json ./i18n.json
|
||||
COPY --from=builder /usr/src/app/locales ./locales
|
||||
COPY --from=builder /usr/src/app/pages ./pages
|
||||
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||
RUN npx next telemetry disable
|
||||
CMD ["node_modules/.bin/next", "start", "--port", "${PORT}"]
|
||||
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
|
||||
CMD ["node", "server.js"]
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
Thream's website to stay close with your friends and communities.
|
||||
|
||||
It uses [Thream/api](https://github.com/Thream/api) [v1.2.0](https://github.com/Thream/api/releases/tag/v1.2.0).
|
||||
It uses [Thream/api](https://github.com/Thream/api) [v1.2.3](https://github.com/Thream/api/releases/tag/v1.2.3).
|
||||
|
||||
## ⚙️ Getting Started
|
||||
|
||||
@ -61,7 +61,7 @@ docker compose up --build
|
||||
|
||||
#### Services started
|
||||
|
||||
- website : `http://localhost:3000`
|
||||
- website : `http://127.0.0.1:3000`
|
||||
|
||||
## 💡 Contributing
|
||||
|
||||
|
@ -22,8 +22,8 @@ const ChannelMemo: React.FC<ChannelProps> = (props) => {
|
||||
const { member } = useGuildMember()
|
||||
|
||||
return (
|
||||
<Link href={`/application/${path.guildId}/${channel.id}`}>
|
||||
<a
|
||||
<Link
|
||||
href={`/application/${path.guildId}/${channel.id}`}
|
||||
className={classNames(
|
||||
'group relative my-3 mx-3 flex items-center justify-between overflow-hidden rounded-lg py-2 text-sm transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-600',
|
||||
{
|
||||
@ -31,10 +31,7 @@ const ChannelMemo: React.FC<ChannelProps> = (props) => {
|
||||
}
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className='max-[315px] ml-2 mr-4 break-all'
|
||||
data-cy='channel-name'
|
||||
>
|
||||
<span className='max-[315px] ml-2 mr-4 break-all' data-cy='channel-name'>
|
||||
# {channel.name}
|
||||
</span>
|
||||
{member.isOwner && (
|
||||
@ -50,7 +47,6 @@ const ChannelMemo: React.FC<ChannelProps> = (props) => {
|
||||
<CogIcon height={20} width={20} />
|
||||
</IconButton>
|
||||
)}
|
||||
</a>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
@ -23,12 +23,12 @@ export const CreateGuild: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
const router = useRouter()
|
||||
|
||||
const { handleUseForm, fetchState, message, errors } = useForm(schema as any)
|
||||
const { handleUseForm, fetchState, message, errors } = useForm(schema)
|
||||
const { getFirstErrorTranslation } = useFormTranslation()
|
||||
|
||||
const { authentication } = useAuthentication()
|
||||
|
||||
const onSubmit: HandleUseFormCallback<any> = async (formData) => {
|
||||
const onSubmit: HandleUseFormCallback<typeof schema> = async (formData) => {
|
||||
try {
|
||||
const { data } = await authentication.api.post<
|
||||
any,
|
||||
|
@ -28,20 +28,24 @@ export const GuildLeftSidebar: React.FC<GuildLeftSidebarProps> = (props) => {
|
||||
<Divider />
|
||||
<div className='mb-1 flex items-center justify-center space-x-6 p-2'>
|
||||
{member.isOwner && (
|
||||
<Link href={`/application/${path.guildId}/channels/create`} passHref>
|
||||
<a data-cy='link-add-channel'>
|
||||
<Link
|
||||
href={`/application/${path.guildId}/channels/create`}
|
||||
passHref
|
||||
data-cy='link-add-channel'
|
||||
>
|
||||
<IconButton className='h-10 w-10' title='Add a Channel'>
|
||||
<PlusIcon />
|
||||
</IconButton>
|
||||
</a>
|
||||
</Link>
|
||||
)}
|
||||
<Link href={`/application/${path.guildId}/settings`} passHref>
|
||||
<a data-cy='link-settings-guild'>
|
||||
<Link
|
||||
href={`/application/${path.guildId}/settings`}
|
||||
passHref
|
||||
data-cy='link-settings-guild'
|
||||
>
|
||||
<IconButton className='h-7 w-7' title='Settings'>
|
||||
<CogIcon />
|
||||
</IconButton>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,10 +47,10 @@ export const GuildSettings: React.FC = () => {
|
||||
errors,
|
||||
setFetchState,
|
||||
setMessage
|
||||
} = useForm(schema as any)
|
||||
} = useForm(schema)
|
||||
const { getFirstErrorTranslation } = useFormTranslation()
|
||||
|
||||
const onSubmit: HandleUseFormCallback<any> = async (formData) => {
|
||||
const onSubmit: HandleUseFormCallback<typeof schema> = async (formData) => {
|
||||
try {
|
||||
await authentication.api.put(`/guilds/${guild.id}`, formData)
|
||||
setInputValues(formData as unknown as any)
|
||||
@ -206,7 +206,7 @@ export const GuildSettings: React.FC = () => {
|
||||
message={
|
||||
message != null
|
||||
? t(message)
|
||||
: getFirstErrorTranslation(errors.email)
|
||||
: getFirstErrorTranslation(errors.name)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
@ -14,7 +14,6 @@ const MemberMemo: React.FC<MemberProps> = (props) => {
|
||||
|
||||
return (
|
||||
<Link href={`/application/users/${member.user.id}`}>
|
||||
<a>
|
||||
<div className='flex cursor-pointer items-center overflow-hidden py-2 px-6 pr-10 hover:bg-gray-300 dark:hover:bg-gray-900'>
|
||||
<div className='flex min-w-[50px] rounded-full'>
|
||||
<Image
|
||||
@ -42,7 +41,6 @@ const MemberMemo: React.FC<MemberProps> = (props) => {
|
||||
{member.user.status != null && member.user.status}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ import { useState, useRef } from 'react'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import date from 'date-and-time'
|
||||
import type { MotionProps } from 'framer-motion'
|
||||
import { motion } from 'framer-motion'
|
||||
|
||||
import type { MessageWithMember } from '../../../../models/Message'
|
||||
import { MessageText } from './MessageText'
|
||||
@ -13,7 +11,7 @@ import { useAuthentication } from '../../../../tools/authentication'
|
||||
import { MessageOptions } from './MessageOptions'
|
||||
import { EditMessage } from './EditMessage'
|
||||
|
||||
export interface MessageProps extends MotionProps {
|
||||
export interface MessageProps {
|
||||
message: MessageWithMember
|
||||
}
|
||||
|
||||
@ -58,22 +56,11 @@ export const Message: React.FC<MessageProps> = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
layout
|
||||
initial='initial'
|
||||
animate='animate'
|
||||
exit='exit'
|
||||
<div
|
||||
data-cy={`message-${message.id}`}
|
||||
className='group flex w-full p-4 transition hover:bg-gray-200 dark:hover:bg-gray-900'
|
||||
transition={{ type: 'spring', stiffness: 500, damping: 60 }}
|
||||
variants={{
|
||||
initial: { x: -100, opacity: 0 },
|
||||
animate: { x: 0, opacity: 1 },
|
||||
exit: { opacity: 0 }
|
||||
}}
|
||||
>
|
||||
<Link href={`/application/users/${message.member.user.id}`}>
|
||||
<a>
|
||||
<div className='mr-4 flex h-12 w-12 flex-shrink-0 items-center justify-center'>
|
||||
<div className='h-10 w-10 drop-shadow-md'>
|
||||
<Image
|
||||
@ -91,19 +78,16 @@ export const Message: React.FC<MessageProps> = (props) => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
<div className='relative w-full whitespace-pre-wrap break-words break-all'>
|
||||
<div className='flex w-max items-center'>
|
||||
<Link href={`/application/users/${message.member.user.id}`}>
|
||||
<a>
|
||||
<span
|
||||
data-cy='message-member-user-name'
|
||||
className='font-bold text-gray-900 dark:text-gray-200'
|
||||
>
|
||||
{message.member.user.name}
|
||||
</span>
|
||||
</a>
|
||||
</Link>
|
||||
<span
|
||||
data-cy='message-date'
|
||||
@ -140,6 +124,6 @@ export const Message: React.FC<MessageProps> = (props) => {
|
||||
<Loader />
|
||||
)}
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import InfiniteScroll from 'react-infinite-scroll-component'
|
||||
import { AnimatePresence } from 'framer-motion'
|
||||
|
||||
import { Loader } from '../../design/Loader'
|
||||
import { Message } from './Message'
|
||||
@ -30,7 +29,6 @@ export const Messages: React.FC = () => {
|
||||
id='messages'
|
||||
className='scrollbar-firefox-support flex w-full flex-1 flex-col-reverse overflow-y-auto transition-all'
|
||||
>
|
||||
<AnimatePresence>
|
||||
<InfiniteScroll
|
||||
scrollableTarget='messages'
|
||||
className='messages-list !overflow-x-hidden'
|
||||
@ -44,7 +42,6 @@ export const Messages: React.FC = () => {
|
||||
return <Message key={message.id} message={message} />
|
||||
})}
|
||||
</InfiniteScroll>
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -23,11 +23,12 @@ export const PopupGuildCard: React.FC<PopupGuildCardProps> = (props) => {
|
||||
<p className='mt-6 px-8 text-center text-sm text-gray-200'>
|
||||
{description}
|
||||
</p>
|
||||
<Link href={link.href}>
|
||||
<a className='mb-6 flex h-10 w-4/5 items-center justify-center self-center rounded-2xl bg-green-400 font-bold tracking-wide text-white transition duration-200 ease-in-out hover:bg-green-600'>
|
||||
<Link
|
||||
href={link.href}
|
||||
className='mb-6 flex h-10 w-4/5 items-center justify-center self-center rounded-2xl bg-green-400 font-bold tracking-wide text-white transition duration-200 ease-in-out hover:bg-green-600'
|
||||
>
|
||||
{link.icon}
|
||||
{link.text}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,7 +16,6 @@ export const UserProfile: React.FC<UserProfileProps> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className='relative flex h-full flex-col items-center justify-center'>
|
||||
<div className='transition'>
|
||||
<div className='max-w-[1000px] px-12'>
|
||||
@ -100,12 +99,5 @@ export const UserProfile: React.FC<UserProfileProps> = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style jsx global>{`
|
||||
#application-page-content {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
`}</style>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -312,8 +312,8 @@ export const UserSettings: React.FC = () => {
|
||||
<Language className='!top-12' />
|
||||
<div className='ml-auto flex'>
|
||||
<SwitchTheme />
|
||||
<Link href={`/application/users/${user.id}`}>
|
||||
<a
|
||||
<Link
|
||||
href={`/application/users/${user.id}`}
|
||||
className='group ml-3 flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-slate-200 transition-colors hover:bg-slate-300 dark:bg-slate-700 hover:dark:bg-slate-800'
|
||||
title='Preview Public Profile'
|
||||
>
|
||||
@ -321,7 +321,6 @@ export const UserSettings: React.FC = () => {
|
||||
height={20}
|
||||
className='opacity-50 transition-opacity group-hover:opacity-100'
|
||||
/>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -139,11 +139,9 @@ export const Authentication: React.FC<AuthenticationProps> = (props) => {
|
||||
: '/authentication/signup'
|
||||
}
|
||||
>
|
||||
<a>
|
||||
{mode === 'signup'
|
||||
? t('authentication:already-have-an-account')
|
||||
: t('authentication:dont-have-an-account')}
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
</AuthenticationForm>
|
||||
|
@ -1,17 +1,24 @@
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import Link from 'next/link'
|
||||
|
||||
export interface ErrorPageProps {
|
||||
import type { FooterProps } from './Footer'
|
||||
import { Footer } from './Footer'
|
||||
import { Header } from './Header'
|
||||
|
||||
export interface ErrorPageProps extends FooterProps {
|
||||
statusCode: number
|
||||
message: string
|
||||
}
|
||||
|
||||
export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
|
||||
const { message, statusCode } = props
|
||||
const { message, statusCode, version } = props
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className='flex h-screen flex-col pt-0'>
|
||||
<Header />
|
||||
<main className='flex min-w-full flex-1 flex-col items-center justify-center'>
|
||||
<h1 className='my-6 text-4xl font-semibold'>
|
||||
{t('errors:error')}{' '}
|
||||
<span
|
||||
@ -23,31 +30,16 @@ export const ErrorPage: React.FC<ErrorPageProps> = (props) => {
|
||||
</h1>
|
||||
<p className='text-center text-lg'>
|
||||
{message}{' '}
|
||||
<Link href='/'>
|
||||
<a className='text-green-800 hover:underline dark:text-green-400'>
|
||||
<Link
|
||||
href='/'
|
||||
className='text-green-800 hover:underline dark:text-green-400'
|
||||
>
|
||||
{t('errors:return-to-home-page')}
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<style jsx global>
|
||||
{`
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-width: 100vw;
|
||||
flex: 1;
|
||||
}
|
||||
#__next {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 0;
|
||||
height: 100vh;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</main>
|
||||
<Footer version={version} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -15,10 +15,11 @@ export const Footer: React.FC<FooterProps> = (props) => {
|
||||
return (
|
||||
<footer className='flex flex-col items-center justify-center border-t-2 border-gray-600 bg-white py-6 text-lg dark:border-gray-400 dark:bg-black'>
|
||||
<p>
|
||||
<Link href='/'>
|
||||
<a className='text-green-800 hover:underline dark:text-green-400'>
|
||||
<Link
|
||||
href='/'
|
||||
className='text-green-800 hover:underline dark:text-green-400'
|
||||
>
|
||||
Thream
|
||||
</a>
|
||||
</Link>{' '}
|
||||
| {t('common:all-rights-reserved')}
|
||||
</p>
|
||||
|
@ -9,9 +9,9 @@ export const Header: React.FC = () => {
|
||||
<header className='sticky top-0 z-50 flex w-full justify-center border-b-2 border-gray-600 bg-white px-6 py-2 dark:border-gray-400 dark:bg-black'>
|
||||
<div className='container flex justify-between'>
|
||||
<Link href='/'>
|
||||
<a>
|
||||
<div className='flex items-center justify-center'>
|
||||
<Image
|
||||
priority
|
||||
quality={100}
|
||||
width={60}
|
||||
height={60}
|
||||
@ -22,7 +22,6 @@ export const Header: React.FC = () => {
|
||||
Thream
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
<div className='flex justify-between'>
|
||||
<Language />
|
||||
|
78
components/Header/SwitchTheme.tsx
Normal file
78
components/Header/SwitchTheme.tsx
Normal file
@ -0,0 +1,78 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import classNames from 'clsx'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
||||
export const SwitchTheme: React.FC = () => {
|
||||
const [mounted, setMounted] = useState(false)
|
||||
const { theme, setTheme } = useTheme()
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true)
|
||||
}, [])
|
||||
|
||||
if (!mounted) {
|
||||
return null
|
||||
}
|
||||
|
||||
const handleClick = (): void => {
|
||||
setTheme(theme === 'dark' ? 'light' : 'dark')
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className='flex items-center'
|
||||
data-cy='switch-theme-click'
|
||||
onClick={handleClick}
|
||||
>
|
||||
<div className='relative inline-block cursor-pointer touch-pan-x select-none border-0 bg-transparent p-0'>
|
||||
<div className='h-[24px] w-[50px] rounded-[30px] bg-[#4d4d4d] p-0 text-white transition-all duration-200 ease-in-out'>
|
||||
<div
|
||||
data-cy='switch-theme-dark'
|
||||
className={classNames(
|
||||
'absolute top-0 bottom-0 left-[8px] mt-auto mb-auto h-[10px] w-[14px] leading-[0] transition-opacity duration-[250ms] ease-in-out',
|
||||
{
|
||||
'opacity-100': theme === 'dark',
|
||||
'opacity-0': theme === 'light'
|
||||
}
|
||||
)}
|
||||
>
|
||||
<span className='relative flex h-[10px] w-[10px] items-center justify-center'>
|
||||
🌜
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
data-cy='switch-theme-light'
|
||||
className={classNames(
|
||||
'absolute right-[10px] top-0 bottom-0 mt-auto mb-auto h-[10px] w-[10px] leading-[0]',
|
||||
{
|
||||
'opacity-100': theme === 'light',
|
||||
'opacity-0': theme === 'dark'
|
||||
}
|
||||
)}
|
||||
>
|
||||
<span className='relative flex h-[10px] w-[10px] items-center justify-center'>
|
||||
🌞
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={classNames(
|
||||
'absolute top-[1px] box-border h-[22px] w-[22px] rounded-[50%] bg-[#fafafa] text-white transition-all duration-[250ms] ease-in-out',
|
||||
{
|
||||
'left-[27px]': theme === 'dark',
|
||||
'left-0': theme === 'light'
|
||||
}
|
||||
)}
|
||||
style={{ border: '1px solid #4d4d4d' }}
|
||||
/>
|
||||
<input
|
||||
data-cy='switch-theme-input'
|
||||
type='checkbox'
|
||||
aria-label='Dark mode toggle'
|
||||
className='absolute m-[-1px] h-[1px] w-[1px] overflow-hidden border-0 p-0'
|
||||
defaultChecked
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
||||
export const SwitchTheme: React.FC = () => {
|
||||
const [mounted, setMounted] = useState(false)
|
||||
const { theme, setTheme } = useTheme()
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true)
|
||||
}, [])
|
||||
|
||||
if (!mounted) {
|
||||
return null
|
||||
}
|
||||
|
||||
const handleClick = (): void => {
|
||||
setTheme(theme === 'dark' ? 'light' : 'dark')
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className='flex items-center'
|
||||
data-cy='switch-theme-click'
|
||||
onClick={handleClick}
|
||||
>
|
||||
<div className='toggle-theme-button relative inline-block cursor-pointer bg-transparent'>
|
||||
<div className='toggle-track'>
|
||||
<div
|
||||
data-cy='switch-theme-dark'
|
||||
className='toggle-track-check absolute'
|
||||
>
|
||||
<span className='toggle_Dark relative flex items-center justify-center'>
|
||||
🌜
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
data-cy='switch-theme-light'
|
||||
className='toggle-track-x absolute'
|
||||
>
|
||||
<span className='toggle_Light relative flex items-center justify-center'>
|
||||
🌞
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className='toggle-thumb absolute' />
|
||||
<input
|
||||
data-cy='switch-theme-input'
|
||||
type='checkbox'
|
||||
aria-label='Dark mode toggle'
|
||||
className='toggle-screenreader-only absolute overflow-hidden'
|
||||
defaultChecked
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style jsx>
|
||||
{`
|
||||
.toggle-theme-button {
|
||||
touch-action: pan-x;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
user-select: none;
|
||||
}
|
||||
.toggle-track {
|
||||
width: 50px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
border-radius: 30px;
|
||||
background-color: #4d4d4d;
|
||||
transition: all 0.2s ease;
|
||||
color: #fff;
|
||||
}
|
||||
.toggle-track-check {
|
||||
width: 14px;
|
||||
height: 10px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
line-height: 0;
|
||||
left: 8px;
|
||||
opacity: ${theme === 'dark' ? 1 : 0};
|
||||
transition: opacity 0.25s ease;
|
||||
}
|
||||
.toggle-track-x {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
line-height: 0;
|
||||
right: 10px;
|
||||
opacity: ${theme === 'dark' ? 0 : 1};
|
||||
}
|
||||
.toggle_Dark,
|
||||
.toggle_Light {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.toggle-thumb {
|
||||
left: ${theme === 'dark' ? '27px' : '0px'};
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border: 1px solid #4d4d4d;
|
||||
border-radius: 50%;
|
||||
background-color: #fafafa;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.25s ease;
|
||||
top: 1px;
|
||||
color: #fff;
|
||||
}
|
||||
.toggle-screenreader-only {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
padding: 0;
|
||||
width: 1px;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</>
|
||||
)
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from './SwitchTheme'
|
@ -1,20 +0,0 @@
|
||||
export const ScrollableBody: React.FC<React.PropsWithChildren<{}>> = (
|
||||
props
|
||||
) => {
|
||||
const { children } = props
|
||||
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
<style jsx global>{`
|
||||
body {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--scroll-bar-color) var(--scroll-bar-bg-color);
|
||||
z-index: 1000;
|
||||
height: calc(100vh - 64px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
`}</style>
|
||||
</>
|
||||
)
|
||||
}
|
@ -14,8 +14,11 @@ export const IconLink: React.FC<React.PropsWithChildren<IconLinkProps>> = (
|
||||
const { children, selected, href, title, className } = props
|
||||
|
||||
return (
|
||||
<Link href={href}>
|
||||
<a className='group relative flex w-full justify-center' title={title}>
|
||||
<Link
|
||||
href={href}
|
||||
className='group relative flex w-full justify-center'
|
||||
title={title}
|
||||
>
|
||||
<div
|
||||
className={classNames('group flex w-full justify-center', className)}
|
||||
>
|
||||
@ -31,7 +34,6 @@ export const IconLink: React.FC<React.PropsWithChildren<IconLinkProps>> = (
|
||||
></span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
@ -35,22 +35,18 @@ export const Input: React.FC<InputProps> = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className='flex flex-col'>
|
||||
<div
|
||||
className={classNames('mt-6 mb-2 flex justify-between', className)}
|
||||
>
|
||||
<div className={classNames('mt-6 mb-2 flex justify-between', className)}>
|
||||
<label className='pl-1' htmlFor={name}>
|
||||
{label}
|
||||
</label>
|
||||
{type === 'password' && showForgotPassword ? (
|
||||
<Link href='/authentication/forgot-password'>
|
||||
<a
|
||||
<Link
|
||||
href='/authentication/forgot-password'
|
||||
className='text-center font-headline text-xs text-green-800 hover:underline dark:text-green-400 sm:text-sm'
|
||||
data-cy='forgot-password-link'
|
||||
>
|
||||
{t('authentication:forgot-password')}
|
||||
</a>
|
||||
</Link>
|
||||
) : null}
|
||||
</div>
|
||||
@ -67,7 +63,10 @@ export const Input: React.FC<InputProps> = (props) => {
|
||||
<div
|
||||
data-cy='password-eye'
|
||||
onClick={handlePassword}
|
||||
className='password-eye absolute cursor-pointer bg-[#f1f1f1] bg-cover'
|
||||
style={{
|
||||
backgroundImage: `url('/images/svg/icons/input/${inputType}.svg')`
|
||||
}}
|
||||
className='absolute top-3 right-4 z-10 h-5 w-5 cursor-pointer bg-[#f1f1f1] bg-cover'
|
||||
/>
|
||||
)}
|
||||
<FormState
|
||||
@ -77,19 +76,5 @@ export const Input: React.FC<InputProps> = (props) => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style jsx>
|
||||
{`
|
||||
.password-eye {
|
||||
top: 12px;
|
||||
right: 16px;
|
||||
z-index: 1;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-image: url('/images/svg/icons/input/${inputType}.svg');
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
39
components/design/Loader/Loader.module.css
Normal file
39
components/design/Loader/Loader.module.css
Normal file
@ -0,0 +1,39 @@
|
||||
@keyframes progressSpinnerRotate {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes progressSpinnerDash {
|
||||
0% {
|
||||
stroke-dasharray: 1, 200;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
50% {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: -35px;
|
||||
}
|
||||
100% {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: -124px;
|
||||
}
|
||||
}
|
||||
|
||||
.progressSpinnerSvg {
|
||||
animation: progressSpinnerRotate 2s linear infinite;
|
||||
height: 100%;
|
||||
transform-origin: center center;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.progressSpinnerCircle {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: 0;
|
||||
stroke: #27b05e;
|
||||
animation: progressSpinnerDash 1.5s ease-in-out infinite;
|
||||
stroke-linecap: round;
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
import styles from './Loader.module.css'
|
||||
|
||||
export interface LoaderProps {
|
||||
width?: number
|
||||
height?: number
|
||||
@ -9,10 +11,14 @@ export const Loader: React.FC<LoaderProps> = (props) => {
|
||||
|
||||
return (
|
||||
<div className={props.className}>
|
||||
<div data-cy='progress-spinner' className='progress-spinner'>
|
||||
<svg className='progress-spinner-svg' viewBox='25 25 50 50'>
|
||||
<div
|
||||
data-cy='progress-spinner'
|
||||
className='relative my-0 mx-auto before:block before:pt-[100%] before:content-none'
|
||||
style={{ width: `${width}px`, height: `${height}px` }}
|
||||
>
|
||||
<svg className={styles.progressSpinnerSvg} viewBox='25 25 50 50'>
|
||||
<circle
|
||||
className='progress-spinner-circle'
|
||||
className={styles.progressSpinnerCircle}
|
||||
cx='50'
|
||||
cy='50'
|
||||
r='20'
|
||||
@ -22,60 +28,6 @@ export const Loader: React.FC<LoaderProps> = (props) => {
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<style jsx>
|
||||
{`
|
||||
.progress-spinner {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
width: ${width}px;
|
||||
height: ${height}px;
|
||||
}
|
||||
.progress-spinner::before {
|
||||
content: '';
|
||||
display: block;
|
||||
padding-top: 100%;
|
||||
}
|
||||
.progress-spinner-svg {
|
||||
animation: progress-spinner-rotate 2s linear infinite;
|
||||
height: 100%;
|
||||
transform-origin: center center;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
}
|
||||
.progress-spinner-circle {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: 0;
|
||||
stroke: #27b05e;
|
||||
animation: progress-spinner-dash 1.5s ease-in-out infinite;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
@keyframes progress-spinner-rotate {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes progress-spinner-dash {
|
||||
0% {
|
||||
stroke-dasharray: 1, 200;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
50% {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: -35px;
|
||||
}
|
||||
100% {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: -124px;
|
||||
}
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
.buttonGoogle {
|
||||
color: #000;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
.buttonMedia {
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
.button:focus {
|
||||
box-shadow: 0 0 0 2px #27b05e;
|
||||
}
|
@ -3,6 +3,7 @@ import Image from 'next/image'
|
||||
import classNames from 'clsx'
|
||||
|
||||
import type { ProviderOAuth } from '../../../models/OAuth'
|
||||
import styles from './SocialMediaButton.module.css'
|
||||
|
||||
export type SocialMedia = ProviderOAuth
|
||||
|
||||
@ -52,27 +53,21 @@ export const SocialMediaButton: React.FC<SocialMediaButtonProps> = (props) => {
|
||||
}, [socialMedia])
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
{...rest}
|
||||
className={classNames(className, 'button', givenClassName)}
|
||||
style={{ background: socialMediaColor }}
|
||||
className={classNames(
|
||||
className,
|
||||
styles.button,
|
||||
{
|
||||
[styles.buttonGoogle]: socialMedia === 'Google',
|
||||
[styles.buttonMedia]: socialMedia !== 'Google'
|
||||
},
|
||||
givenClassName
|
||||
)}
|
||||
>
|
||||
<SocialMediaChildren socialMedia={socialMedia} />
|
||||
</button>
|
||||
|
||||
<style jsx>
|
||||
{`
|
||||
.button {
|
||||
background: ${socialMediaColor};
|
||||
color: ${socialMedia === 'Google' ? '#000' : '#fff'};
|
||||
border: ${socialMedia === 'Google' ? '1px solid #000' : 'none'};
|
||||
}
|
||||
.button:focus {
|
||||
box-shadow: 0 0 0 2px #27b05e;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@ -88,23 +83,20 @@ export const SocialMediaLink: React.FC<SocialMediaLinkProps> = (props) => {
|
||||
}, [socialMedia])
|
||||
|
||||
return (
|
||||
<>
|
||||
<a {...rest} className={classNames(className, 'link', givenClassName)}>
|
||||
<a
|
||||
{...rest}
|
||||
style={{ background: socialMediaColor }}
|
||||
className={classNames(
|
||||
className,
|
||||
styles.button,
|
||||
{
|
||||
[styles.buttonGoogle]: socialMedia === 'Google',
|
||||
[styles.buttonMedia]: socialMedia !== 'Google'
|
||||
},
|
||||
givenClassName
|
||||
)}
|
||||
>
|
||||
<SocialMediaChildren socialMedia={socialMedia} />
|
||||
</a>
|
||||
|
||||
<style jsx>
|
||||
{`
|
||||
.link {
|
||||
background: ${socialMediaColor};
|
||||
color: ${socialMedia === 'Google' ? '#000' : '#fff'};
|
||||
border: ${socialMedia === 'Google' ? '1px solid #000' : 'none'};
|
||||
}
|
||||
.link:focus {
|
||||
box-shadow: 0 0 0 2px #27b05e;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -19,11 +19,9 @@ let server: Mockttp | null = null
|
||||
export default defineConfig({
|
||||
fixturesFolder: false,
|
||||
video: false,
|
||||
downloadsFolder: undefined,
|
||||
screenshotOnRunFailure: false,
|
||||
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:3000',
|
||||
baseUrl: 'http://127.0.0.1:3000',
|
||||
supportFile: false,
|
||||
setupNodeEvents(on, config) {
|
||||
on('task', {
|
||||
@ -62,7 +60,6 @@ export default defineConfig({
|
||||
return config
|
||||
}
|
||||
},
|
||||
|
||||
component: {
|
||||
devServer: {
|
||||
framework: 'next',
|
||||
|
@ -5,7 +5,7 @@ services:
|
||||
build:
|
||||
context: './'
|
||||
ports:
|
||||
- '${PORT}:${PORT}'
|
||||
- '${PORT-3000}:${PORT-3000}'
|
||||
environment:
|
||||
PORT: ${PORT}
|
||||
PORT: ${PORT-3000}
|
||||
env_file: './.env'
|
||||
|
5
next-env.d.ts
vendored
5
next-env.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
@ -5,16 +5,16 @@ const nextPWA = require('next-pwa')({
|
||||
const nextTranslate = require('next-translate')
|
||||
|
||||
/** @type {import("next").NextConfig} */
|
||||
module.exports = nextTranslate(
|
||||
nextPWA({
|
||||
const nextConfig = {
|
||||
reactStrictMode: false,
|
||||
output: 'standalone',
|
||||
images: {
|
||||
domains: [
|
||||
'api.thream.divlo.fr',
|
||||
'thream-api.herokuapp.com',
|
||||
'file-uploads-api.thream.divlo.fr',
|
||||
...(process.env.NODE_ENV !== 'production' ? ['localhost'] : [])
|
||||
...(process.env.NODE_ENV !== 'production' ? ['127.0.0.1'] : [])
|
||||
]
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = nextTranslate(nextPWA(nextConfig))
|
||||
|
8266
package-lock.json
generated
8266
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
84
package.json
84
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thream/website",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -23,91 +23,89 @@
|
||||
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\"",
|
||||
"lint:staged": "lint-staged",
|
||||
"test:unit": "cypress run --component",
|
||||
"test:html-w3c-validator": "start-server-and-test \"start\" \"http://localhost:3000\" \"html-w3c-validator\"",
|
||||
"test:html-w3c-validator": "start-server-and-test \"start\" \"http://127.0.0.1:3000\" \"html-w3c-validator\"",
|
||||
"test:lighthouse": "lhci autorun",
|
||||
"test:e2e": "start-server-and-test \"start\" \"http://localhost:3000\" \"cypress run\"",
|
||||
"test:dev": "start-server-and-test \"dev\" \"http://localhost:3000\" \"cypress open\"",
|
||||
"test:e2e": "start-server-and-test \"start\" \"http://127.0.0.1:3000\" \"cypress run\"",
|
||||
"test:dev": "start-server-and-test \"dev\" \"http://127.0.0.1:3000\" \"cypress open\"",
|
||||
"release": "semantic-release",
|
||||
"deploy": "vercel",
|
||||
"postinstall": "husky install"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/montserrat": "4.5.12",
|
||||
"@fontsource/montserrat": "4.5.13",
|
||||
"@fontsource/roboto": "4.5.8",
|
||||
"@heroicons/react": "1.0.6",
|
||||
"@sinclair/typebox": "0.24.34",
|
||||
"axios": "0.26.1",
|
||||
"@sinclair/typebox": "0.25.13",
|
||||
"axios": "1.2.1",
|
||||
"clsx": "1.2.1",
|
||||
"date-and-time": "2.4.1",
|
||||
"emoji-mart": "3.0.1",
|
||||
"framer-motion": "7.2.1",
|
||||
"katex": "0.16.2",
|
||||
"next": "12.2.5",
|
||||
"katex": "0.16.4",
|
||||
"next": "13.0.6",
|
||||
"next-pwa": "5.6.0",
|
||||
"next-themes": "0.2.0",
|
||||
"next-translate": "1.5.0",
|
||||
"next-themes": "0.2.1",
|
||||
"next-translate": "1.6.0",
|
||||
"pretty-bytes": "6.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-component-form": "3.1.0",
|
||||
"react-component-form": "3.1.1",
|
||||
"react-dom": "18.2.0",
|
||||
"react-infinite-scroll-component": "6.1.0",
|
||||
"react-markdown": "8.0.3",
|
||||
"react-responsive": "8.2.0",
|
||||
"react-markdown": "8.0.4",
|
||||
"react-responsive": "9.0.2",
|
||||
"react-swipeable": "7.0.0",
|
||||
"react-syntax-highlighter": "15.5.0",
|
||||
"react-textarea-autosize": "8.3.4",
|
||||
"react-textarea-autosize": "8.4.0",
|
||||
"read-pkg": "7.1.0",
|
||||
"rehype-katex": "6.0.2",
|
||||
"remark-breaks": "3.0.2",
|
||||
"remark-gfm": "3.0.1",
|
||||
"remark-math": "5.1.1",
|
||||
"sharp": "0.30.7",
|
||||
"socket.io-client": "4.5.1",
|
||||
"sharp": "0.31.2",
|
||||
"socket.io-client": "4.5.4",
|
||||
"unified": "10.1.2",
|
||||
"unist-util-visit": "4.1.1",
|
||||
"universal-cookie": "4.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "17.1.2",
|
||||
"@commitlint/config-conventional": "17.1.0",
|
||||
"@lhci/cli": "0.9.0",
|
||||
"@commitlint/cli": "17.3.0",
|
||||
"@commitlint/config-conventional": "17.3.0",
|
||||
"@lhci/cli": "0.10.0",
|
||||
"@saithodev/semantic-release-backmerge": "2.1.2",
|
||||
"@semantic-release/git": "10.0.1",
|
||||
"@types/emoji-mart": "3.0.9",
|
||||
"@types/hast": "2.3.4",
|
||||
"@types/katex": "0.14.0",
|
||||
"@types/node": "18.7.14",
|
||||
"@types/react": "18.0.18",
|
||||
"@types/node": "18.11.14",
|
||||
"@types/react": "18.0.26",
|
||||
"@types/react-responsive": "8.0.5",
|
||||
"@types/react-syntax-highlighter": "15.5.5",
|
||||
"@types/unist": "2.0.6",
|
||||
"@typescript-eslint/eslint-plugin": "5.36.1",
|
||||
"@typescript-eslint/parser": "5.36.1",
|
||||
"autoprefixer": "10.4.8",
|
||||
"cypress": "10.7.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.46.1",
|
||||
"@typescript-eslint/parser": "5.46.1",
|
||||
"autoprefixer": "10.4.13",
|
||||
"cypress": "12.1.0",
|
||||
"editorconfig-checker": "4.0.2",
|
||||
"eslint": "8.23.0",
|
||||
"eslint-config-conventions": "4.0.0",
|
||||
"eslint-config-next": "12.2.5",
|
||||
"eslint": "8.29.0",
|
||||
"eslint-config-conventions": "6.0.0",
|
||||
"eslint-config-next": "13.0.6",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-prettier": "4.2.1",
|
||||
"eslint-plugin-promise": "6.0.1",
|
||||
"eslint-plugin-unicorn": "43.0.2",
|
||||
"html-w3c-validator": "1.2.0",
|
||||
"husky": "8.0.1",
|
||||
"lint-staged": "13.0.3",
|
||||
"eslint-plugin-promise": "6.1.1",
|
||||
"eslint-plugin-unicorn": "45.0.2",
|
||||
"html-w3c-validator": "1.2.1",
|
||||
"husky": "8.0.2",
|
||||
"lint-staged": "13.1.0",
|
||||
"markdownlint-cli2": "0.5.1",
|
||||
"mockttp": "2.7.0",
|
||||
"plop": "3.1.1",
|
||||
"postcss": "8.4.16",
|
||||
"prettier": "2.7.1",
|
||||
"prettier-plugin-tailwindcss": "0.1.13",
|
||||
"postcss": "8.4.20",
|
||||
"prettier": "2.8.1",
|
||||
"prettier-plugin-tailwindcss": "0.2.1",
|
||||
"semantic-release": "19.0.5",
|
||||
"serve": "14.0.1",
|
||||
"start-server-and-test": "1.14.0",
|
||||
"tailwindcss": "3.1.8",
|
||||
"typescript": "4.8.2",
|
||||
"vercel": "28.2.0"
|
||||
"start-server-and-test": "1.15.2",
|
||||
"tailwindcss": "3.2.4",
|
||||
"typescript": "4.9.4",
|
||||
"vercel": "28.8.0"
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,7 @@ import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
import { ErrorPage } from '../components/ErrorPage'
|
||||
import { Head } from '../components/Head'
|
||||
import { Header } from '../components/Header'
|
||||
import type { FooterProps } from '../components/Footer'
|
||||
import { Footer } from '../components/Footer'
|
||||
|
||||
const Error404: NextPage<FooterProps> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
@ -14,12 +12,11 @@ const Error404: NextPage<FooterProps> = (props) => {
|
||||
return (
|
||||
<>
|
||||
<Head title='Thream | 404' />
|
||||
|
||||
<Header />
|
||||
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
|
||||
<ErrorPage statusCode={404} message={t('errors:page-not-found')} />
|
||||
</main>
|
||||
<Footer version={version} />
|
||||
<ErrorPage
|
||||
statusCode={404}
|
||||
message={t('errors:page-not-found')}
|
||||
version={version}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import { ErrorPage } from '../components/ErrorPage'
|
||||
import { Head } from '../components/Head'
|
||||
import { Header } from '../components/Header'
|
||||
import type { FooterProps } from '../components/Footer'
|
||||
import { Footer } from '../components/Footer'
|
||||
|
||||
const Error500: NextPage<FooterProps> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
@ -16,10 +15,11 @@ const Error500: NextPage<FooterProps> = (props) => {
|
||||
<Head title='Thream | 500' />
|
||||
|
||||
<Header />
|
||||
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
|
||||
<ErrorPage statusCode={500} message={t('errors:server-error')} />
|
||||
</main>
|
||||
<Footer version={version} />
|
||||
<ErrorPage
|
||||
statusCode={500}
|
||||
message={t('errors:server-error')}
|
||||
version={version}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react'
|
||||
import type { AppProps } from 'next/app'
|
||||
import type { AppType } from 'next/app'
|
||||
import { ThemeProvider } from 'next-themes'
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
|
||||
@ -15,7 +15,7 @@ import '@fontsource/roboto/700.css'
|
||||
|
||||
import { cookies } from '../tools/cookies'
|
||||
|
||||
const Application = ({ Component, pageProps }: AppProps): JSX.Element => {
|
||||
const Application: AppType = ({ Component, pageProps }) => {
|
||||
const { lang } = useTranslation()
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -15,7 +15,6 @@ import { Input } from '../../components/design/Input'
|
||||
import { Button } from '../../components/design/Button'
|
||||
import { FormState } from '../../components/design/FormState'
|
||||
import { authenticationFromServerSide } from '../../tools/authentication'
|
||||
import { ScrollableBody } from '../../components/ScrollableBody'
|
||||
import { userSchema } from '../../models/User'
|
||||
import { api } from '../../tools/api'
|
||||
import { useFormTranslation } from '../../hooks/useFormTranslation'
|
||||
@ -60,7 +59,7 @@ const ForgotPassword: NextPage<FooterProps> = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollableBody>
|
||||
<>
|
||||
<Head title={`Thream | ${t('authentication:forgot-password')}`} />
|
||||
<Header />
|
||||
<Main>
|
||||
@ -71,7 +70,7 @@ const ForgotPassword: NextPage<FooterProps> = (props) => {
|
||||
</Button>
|
||||
<p className='mt-3 font-headline text-sm text-green-800 hover:underline dark:text-green-400'>
|
||||
<Link href='/authentication/signin'>
|
||||
<a>{t('authentication:already-know-password')}</a>
|
||||
{t('authentication:already-know-password')}
|
||||
</Link>
|
||||
</p>
|
||||
</AuthenticationForm>
|
||||
@ -86,7 +85,7 @@ const ForgotPassword: NextPage<FooterProps> = (props) => {
|
||||
/>
|
||||
</Main>
|
||||
<Footer version={version} />
|
||||
</ScrollableBody>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@ import { Input } from '../../components/design/Input'
|
||||
import { Button } from '../../components/design/Button'
|
||||
import { authenticationFromServerSide } from '../../tools/authentication'
|
||||
import { AuthenticationForm } from '../../components/Authentication'
|
||||
import { ScrollableBody } from '../../components/ScrollableBody'
|
||||
import { api } from '../../tools/api'
|
||||
import { userSchema } from '../../models/User'
|
||||
import { useFormTranslation } from '../../hooks/useFormTranslation'
|
||||
@ -55,7 +54,7 @@ const ResetPassword: NextPage<FooterProps> = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollableBody>
|
||||
<>
|
||||
<Head title={`Thream | ${t('authentication:reset-password')}`} />
|
||||
<Header />
|
||||
<Main>
|
||||
@ -81,7 +80,7 @@ const ResetPassword: NextPage<FooterProps> = (props) => {
|
||||
/>
|
||||
</Main>
|
||||
<Footer version={version} />
|
||||
</ScrollableBody>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -7,19 +7,18 @@ import { Header } from '../../components/Header'
|
||||
import type { FooterProps } from '../../components/Footer'
|
||||
import { Footer } from '../../components/Footer'
|
||||
import { authenticationFromServerSide } from '../../tools/authentication'
|
||||
import { ScrollableBody } from '../../components/ScrollableBody'
|
||||
|
||||
const Signin: NextPage<FooterProps> = (props) => {
|
||||
const { version } = props
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<ScrollableBody>
|
||||
<>
|
||||
<Head title={`Thream | ${t('authentication:signin')}`} />
|
||||
<Header />
|
||||
<Authentication mode='signin' />
|
||||
<Footer version={version} />
|
||||
</ScrollableBody>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -7,19 +7,18 @@ import { Header } from '../../components/Header'
|
||||
import type { FooterProps } from '../../components/Footer'
|
||||
import { Footer } from '../../components/Footer'
|
||||
import { authenticationFromServerSide } from '../../tools/authentication'
|
||||
import { ScrollableBody } from '../../components/ScrollableBody'
|
||||
|
||||
const Signup: NextPage<FooterProps> = (props) => {
|
||||
const { version } = props
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<ScrollableBody>
|
||||
<>
|
||||
<Head title={`Thream | ${t('authentication:signup')}`} />
|
||||
<Header />
|
||||
<Authentication mode='signup' />
|
||||
<Footer version={version} />
|
||||
</ScrollableBody>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -11,29 +11,27 @@ import type { FooterProps } from '../components/Footer'
|
||||
import { Footer } from '../components/Footer'
|
||||
import { SocialMediaLink } from '../components/design/SocialMediaButton'
|
||||
import { ButtonLink } from '../components/design/Button'
|
||||
import { ScrollableBody } from '../components/ScrollableBody'
|
||||
|
||||
const Home: NextPage<FooterProps> = (props) => {
|
||||
const { t } = useTranslation()
|
||||
const { version } = props
|
||||
|
||||
return (
|
||||
<ScrollableBody>
|
||||
<>
|
||||
<Head />
|
||||
<Header />
|
||||
<Main>
|
||||
<div className='flex w-4/5 flex-col items-center'>
|
||||
<div className='max-w-xs'>
|
||||
<Link href='/authentication/signup'>
|
||||
<a>
|
||||
<Image
|
||||
quality={100}
|
||||
width={351}
|
||||
height={341}
|
||||
src='/images/svg/design/home.svg'
|
||||
alt={"Thream's chat app"}
|
||||
priority
|
||||
/>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
<div className='text-center'>
|
||||
@ -55,7 +53,7 @@ const Home: NextPage<FooterProps> = (props) => {
|
||||
/>
|
||||
</div>
|
||||
<div className='mt-8 flex items-center justify-center space-x-4 text-center'>
|
||||
<Link href='/authentication/signup' passHref>
|
||||
<Link href='/authentication/signup' passHref legacyBehavior>
|
||||
<ButtonLink data-cy='get-started'>
|
||||
{t('home:get-started')}
|
||||
</ButtonLink>
|
||||
@ -72,7 +70,7 @@ const Home: NextPage<FooterProps> = (props) => {
|
||||
</div>
|
||||
</Main>
|
||||
<Footer version={version} />
|
||||
</ScrollableBody>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -12,9 +12,18 @@
|
||||
@apply flex h-screen flex-col;
|
||||
}
|
||||
|
||||
#application-page-content {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-white font-headline text-black dark:bg-black dark:text-white;
|
||||
overflow: hidden;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--scroll-bar-color) var(--scroll-bar-bg-color);
|
||||
z-index: 1000;
|
||||
height: calc(100vh - 64px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.h-full-without-header {
|
||||
|
@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
const tailwindConfig = {
|
||||
content: [
|
||||
'./pages/**/*.{js,ts,jsx,tsx}',
|
||||
'./components/**/*.{js,ts,jsx,tsx}'
|
||||
@ -31,3 +32,5 @@ module.exports = {
|
||||
},
|
||||
plugins: []
|
||||
}
|
||||
|
||||
module.exports = tailwindConfig
|
||||
|
@ -1,13 +1,13 @@
|
||||
import axios from 'axios'
|
||||
|
||||
export const API_VERSION = '1.2.0'
|
||||
export const API_VERSION = '1.2.3'
|
||||
|
||||
export const API_DEFAULT_PORT = 8080
|
||||
|
||||
export const API_URL =
|
||||
process.env.NEXT_PUBLIC_API_URL != null
|
||||
? process.env.NEXT_PUBLIC_API_URL
|
||||
: `http://localhost:${API_DEFAULT_PORT}`
|
||||
: `http://127.0.0.1:${API_DEFAULT_PORT}`
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: API_URL,
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"$schema": "https://openapi.vercel.sh/vercel.json",
|
||||
"github": {
|
||||
"enabled": false
|
||||
}
|
||||
|
Reference in New Issue
Block a user