Compare commits
7 Commits
dev
...
c55f7a972c
| Author | SHA1 | Date | |
|---|---|---|---|
| c55f7a972c | |||
| 5693701aa5 | |||
| d9f449f0b8 | |||
| 04da2b565a | |||
| 070edbfc42 | |||
|
|
a4480db444 | ||
| f2baf189e4 |
35
.gitea/workflows/build-and-push.yaml
Normal file
35
.gitea/workflows/build-and-push.yaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.nullptr.top
|
||||||
|
IMAGE_NAME: git.nullptr.top/liquidcode/liquidcode-frontend
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: liquidcode-ci-service
|
||||||
|
password: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|
||||||
|
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||||
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Build stage
|
||||||
|
FROM node:20-alpine AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build the application
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production stage
|
||||||
|
FROM node:20-alpine AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install a simple HTTP server to serve static files
|
||||||
|
RUN npm install -g serve
|
||||||
|
|
||||||
|
# Copy built application from build stage
|
||||||
|
COPY --from=build /app/dist ./dist
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["serve", "-s", "dist", "-l", "3000"]
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>LiquidCode</title>
|
<title>Vite + React + TS</title>
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<svg width="62" height="56" viewBox="0 0 62 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M16.7765 44.9299V16.6675C16.7765 7.46416 9.26353 0 0 0V44.9299C0.00729412 45.9589 0.153177 50.4447 3.64706 53.626C4.92353 54.7927 6.27294 55.4377 7.29412 55.8H23.3412C22.4221 55.4377 21.2113 54.7927 20.0588 53.626C16.9151 50.4447 16.7838 45.9589 16.7765 44.9299Z" fill="#0C8092"/>
|
|
||||||
<path d="M35.7412 44.9299V27.5377C35.7412 18.3343 28.2282 10.8701 18.9647 10.8701V44.9299C18.972 45.9589 19.1179 50.4447 22.6118 53.626C23.8882 54.7927 25.2376 55.4377 26.2588 55.8H42.3059C41.3868 55.4377 40.176 54.7927 39.0235 53.626C35.8798 50.4447 35.7485 45.9589 35.7412 44.9299Z" fill="#16A7C6"/>
|
|
||||||
<path d="M58.3529 53.626C54.8591 50.4447 54.7132 45.9589 54.7059 44.9299V39.1325C54.7059 29.9291 47.1929 22.4649 37.9294 22.4649V44.9299C37.9367 45.9589 38.0826 50.4447 41.5765 53.626C42.8529 54.7927 44.2024 55.4377 45.2235 55.8H62C60.9788 55.4377 59.6294 54.7927 58.3529 53.626Z" fill="#00DBD9"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 993 B |
1
public/vite.svg
Normal file
1
public/vite.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,6 +1,5 @@
|
|||||||
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
|
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
|
||||||
import axios from '../../axios';
|
import axios from '../../axios';
|
||||||
import { toastError } from '../../lib/toastNotification';
|
|
||||||
|
|
||||||
type Status = 'idle' | 'loading' | 'successful' | 'failed';
|
type Status = 'idle' | 'loading' | 'successful' | 'failed';
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@ export const registerUser = createAsyncThunk(
|
|||||||
});
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
return rejectWithValue(err.response?.data?.errors ? err.response?.data?.errors : {"error" : [err.response?.data]});
|
return rejectWithValue(err.response?.data?.errors);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -217,11 +216,6 @@ const authSlice = createSlice({
|
|||||||
builder.addCase(registerUser.rejected, (state, action) => {
|
builder.addCase(registerUser.rejected, (state, action) => {
|
||||||
state.status = 'failed';
|
state.status = 'failed';
|
||||||
state.register.errors = action.payload as Record<string, string[]>;
|
state.register.errors = action.payload as Record<string, string[]>;
|
||||||
Object.values(state.register.errors).forEach((messages) => {
|
|
||||||
messages.forEach((msg) => {
|
|
||||||
toastError(msg);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// ----------------- Login -----------------
|
// ----------------- Login -----------------
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const Login = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className=" relative pointer-events-auto">
|
<div className=" relative pointer-events-auto">
|
||||||
<div>
|
<div>
|
||||||
<div className="text-[35px] text-liquid-white font-bold h-[50px]">
|
<div className="text-[40px] text-liquid-white font-bold h-[50px]">
|
||||||
С возвращением
|
С возвращением
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[18px] text-liquid-light font-bold h-[23px]">
|
<div className="text-[18px] text-liquid-light font-bold h-[23px]">
|
||||||
@@ -100,8 +100,15 @@ const Login = () => {
|
|||||||
error={getErrorPasswordMessage()}
|
error={getErrorPasswordMessage()}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="flex justify-end mt-[10px] h-[20px]">
|
<div className="flex justify-end mt-[10px]">
|
||||||
|
<Link
|
||||||
|
to={''}
|
||||||
|
className={
|
||||||
|
'text-liquid-brightmain text-[16px] h-[20px] transition-all hover:underline '
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Забыли пароль?
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-[10px]">
|
<div className="mt-[10px]">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { registerUser } from '../../../redux/slices/auth';
|
|||||||
import { setMenuActivePage } from '../../../redux/slices/store';
|
import { setMenuActivePage } from '../../../redux/slices/store';
|
||||||
import { Balloon } from '../../../assets/icons/auth';
|
import { Balloon } from '../../../assets/icons/auth';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
// import { Checkbox } from '../../../components/checkbox/Checkbox';
|
import { Checkbox } from '../../../components/checkbox/Checkbox';
|
||||||
|
|
||||||
function isValidEmail(email: string): boolean {
|
function isValidEmail(email: string): boolean {
|
||||||
const pattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
const pattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||||
@@ -52,13 +52,12 @@ const Register = () => {
|
|||||||
const [password, setPassword] = useState<string>('');
|
const [password, setPassword] = useState<string>('');
|
||||||
const [confirmPassword, setConfirmPassword] = useState<string>('');
|
const [confirmPassword, setConfirmPassword] = useState<string>('');
|
||||||
const [submitClicked, setSubmitClicked] = useState<boolean>(false);
|
const [submitClicked, setSubmitClicked] = useState<boolean>(false);
|
||||||
const [politicChecked, setPoliticChecked] = useState<boolean>(true);
|
const [politicChecked, setPoliticChecked] = useState<boolean>(false);
|
||||||
|
|
||||||
const { status, jwt } = useAppSelector((state) => state.auth);
|
const { status, jwt } = useAppSelector((state) => state.auth);
|
||||||
// const { errors } = useAppSelector((state) => state.auth.register);
|
// const { errors } = useAppSelector((state) => state.auth.register);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setPoliticChecked(true);
|
|
||||||
dispatch(setMenuActivePage('account'));
|
dispatch(setMenuActivePage('account'));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ const Register = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className=" relative pointer-events-auto">
|
<div className=" relative pointer-events-auto">
|
||||||
<div>
|
<div>
|
||||||
<div className="text-[35px] text-liquid-white font-bold h-[50px]">
|
<div className="text-[40px] text-liquid-white font-bold h-[50px]">
|
||||||
Добро пожаловать
|
Добро пожаловать
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[18px] text-liquid-light font-bold h-[23px]">
|
<div className="text-[18px] text-liquid-light font-bold h-[23px]">
|
||||||
@@ -201,7 +200,7 @@ const Register = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div className=" flex items-center mt-[10px] h-[24px]">
|
<div className=" flex items-center mt-[10px] h-[24px]">
|
||||||
{/* <Checkbox
|
<Checkbox
|
||||||
onChange={(value: boolean) => {
|
onChange={(value: boolean) => {
|
||||||
setPoliticChecked(value);
|
setPoliticChecked(value);
|
||||||
}}
|
}}
|
||||||
@@ -216,13 +215,13 @@ const Register = () => {
|
|||||||
/>
|
/>
|
||||||
<span className="text-[14px] font-medium text-liquid-light h-[18px] ml-[10px]">
|
<span className="text-[14px] font-medium text-liquid-light h-[18px] ml-[10px]">
|
||||||
Я принимаю{' '}
|
Я принимаю{' '}
|
||||||
<Link to={'/home'} className={' underline'}>
|
{/* <Link to={'/home'} className={' underline'}>
|
||||||
политику конфиденциальности
|
политику конфиденциальности
|
||||||
</Link>
|
</Link> */}
|
||||||
<span className={' underline cursor-pointer'}>
|
<span className={' underline cursor-pointer'}>
|
||||||
политику конфиденциальности
|
политику конфиденциальности
|
||||||
</span>
|
</span>
|
||||||
</span> */}
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-[10px]">
|
<div className="mt-[10px]">
|
||||||
|
|||||||
@@ -14,15 +14,12 @@ import {
|
|||||||
} from '../../../redux/slices/contests';
|
} from '../../../redux/slices/contests';
|
||||||
import ModalCreateContest from './ModalCreate';
|
import ModalCreateContest from './ModalCreate';
|
||||||
import Filters from './Filter';
|
import Filters from './Filter';
|
||||||
import { toastWarning } from '../../../lib/toastNotification';
|
|
||||||
|
|
||||||
const Contests = () => {
|
const Contests = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const [modalActive, setModalActive] = useState<boolean>(false);
|
const [modalActive, setModalActive] = useState<boolean>(false);
|
||||||
|
|
||||||
const jwt = useAppSelector((state) => state.auth.jwt);
|
|
||||||
|
|
||||||
const { contests, status } = useAppSelector(
|
const { contests, status } = useAppSelector(
|
||||||
(state) => state.contests.fetchContests,
|
(state) => state.contests.fetchContests,
|
||||||
);
|
);
|
||||||
@@ -52,10 +49,6 @@ const Contests = () => {
|
|||||||
</div>
|
</div>
|
||||||
<SecondaryButton
|
<SecondaryButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!jwt){
|
|
||||||
toastWarning("Для создания контеста необходимо авторизоваться")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setModalActive(true);
|
setModalActive(true);
|
||||||
}}
|
}}
|
||||||
text="Создать контест"
|
text="Создать контест"
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
import { fetchMissions } from '../../../redux/slices/missions';
|
import { fetchMissions } from '../../../redux/slices/missions';
|
||||||
import ModalCreate from './ModalCreate';
|
import ModalCreate from './ModalCreate';
|
||||||
import Filters from './Filter';
|
import Filters from './Filter';
|
||||||
import { toastWarning } from '../../../lib/toastNotification';
|
|
||||||
|
|
||||||
export interface Mission {
|
export interface Mission {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -30,7 +29,6 @@ const Missions = () => {
|
|||||||
|
|
||||||
const missions = useAppSelector((state) => state.missions.missions);
|
const missions = useAppSelector((state) => state.missions.missions);
|
||||||
|
|
||||||
const jwt = useAppSelector((state) => state.auth.jwt);
|
|
||||||
const nameFilter = useAppSelector(
|
const nameFilter = useAppSelector(
|
||||||
(state) => state.store.missions.filterName,
|
(state) => state.store.missions.filterName,
|
||||||
);
|
);
|
||||||
@@ -62,11 +60,6 @@ const Missions = () => {
|
|||||||
</div>
|
</div>
|
||||||
<SecondaryButton
|
<SecondaryButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
||||||
if (!jwt){
|
|
||||||
toastWarning("Для загрузки задачи необходимо авторизоваться")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setModalActive(true);
|
setModalActive(true);
|
||||||
}}
|
}}
|
||||||
text="Добавить задачу"
|
text="Добавить задачу"
|
||||||
|
|||||||
Reference in New Issue
Block a user