design changes

This commit is contained in:
2024-04-12 18:47:19 +03:00
parent 57965fc147
commit d6cfedfe06
14 changed files with 55 additions and 40 deletions

View File

@ -8,7 +8,7 @@ export default defineConfig({
port: 3000,
},
html: {
favicon: "./static/logo-square.png",
favicon: "./static/favicon-32x32.png",
title: "queueful!",
template: "./static/index.html",
},

View File

@ -1,7 +1,7 @@
body {
margin: 0;
color: #fff;
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-family: "Comfortaa", sans-serif;
background-image: linear-gradient(to bottom, #020917, #101725);
}

View File

@ -1,6 +1,10 @@
import { Form, Input, Menu, MenuProps, Modal, Spin } from "antd";
import "./styles.css";
import { KeyOutlined, UserAddOutlined } from "@ant-design/icons";
import {
KeyOutlined,
LoadingOutlined,
UserAddOutlined,
} from "@ant-design/icons";
import React, { useContext, useEffect, useState } from "react";
import {
TokenResponse,
@ -83,7 +87,10 @@ const AuthModal = (props: {
okText={current === "login" ? tr("Log in") : tr("Register")}
confirmLoading={isLoggingIn}
>
<Spin spinning={isLoggingIn || isRegistering}>
<Spin
spinning={isLoggingIn || isRegistering}
indicator={<LoadingOutlined style={{ fontSize: 36 }} spin />}
>
<Menu
onClick={(e) => setCurrent(e.key)}
mode="horizontal"

View File

@ -6,6 +6,7 @@ import {
} from "@reduxjs/toolkit";
import { setupListeners } from "@reduxjs/toolkit/query";
import { AuthApi, User } from "../slice/AuthApi";
import { QueueApi } from "../slice/QueueApi";
export type AuthDataType = {
token: string | null;
@ -43,6 +44,7 @@ export const store = configureStore({
reducer: {
// Add the generated reducer as a specific top-level slice
[AuthApi.reducerPath]: AuthApi.reducer,
[QueueApi.reducerPath]: QueueApi.reducer,
auth: createReducer(initialAuthDataState, (builder) => {
builder.addCase(updateToken, (state, action) => {
state.token = action.payload;
@ -81,7 +83,9 @@ export const store = configureStore({
// Adding the api middleware enables caching, invalidation, polling,
// and other useful features of `rtk-query`.
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(AuthApi.middleware),
getDefaultMiddleware()
.concat(AuthApi.middleware)
.concat(QueueApi.middleware),
});
// optional, but required for refetchOnFocus/refetchOnReconnect behaviors

View File

@ -1,35 +1,14 @@
import { ThemeConfig } from "antd";
export const theme: ThemeConfig = {
components: {
Modal: {
contentBg: "#001529",
},
Form: {
labelColor: "#77828c",
},
Input: {
activeBg: "#001c36",
},
Button: {
primaryColor: "#001529",
defaultHoverBg: "#001529",
defaultHoverColor: "white",
colorPrimaryBgHover: "#001529",
// colorPrimaryHover: "#001529",
},
Message: {
contentBg: "#001c36",
},
Popover: {
colorBgElevated: "#001c36",
},
},
token: {
colorText: "#ffffff",
colorBgContainer: "#001c36",
colorIcon: "#77828c",
colorPrimary: "#ffffff",
colorPrimaryHover: "#001529",
colorText: "white",
colorIcon: "white",
colorPrimary: "#00d8a4",
colorIconHover: "#00d8a4",
colorBgContainer: "#001d39",
colorBgBase: "#001529",
borderRadius: 5,
fontFamily: "Comfortaa",
},
};

View File

@ -12,8 +12,9 @@ const MainPage = () => {
{tr("Queuing has never been so simple")}
</p>
<div className="button-box">
<Button>{tr("Join a queue")}</Button>
<Button>{tr("Take a tour")}</Button>
<Button size="large">{tr("Join a queue")}</Button>
<div style={{ width: "3rem" }} />
<Button size="large">{tr("Take a tour")}</Button>
</div>
</div>
);

View File

@ -6,6 +6,7 @@
.main {
font-family: "Comfortaa", sans-serif;
padding: 3rem;
display: flex;
flex-flow: column;
justify-items: center;
@ -21,8 +22,7 @@
.button-box {
width: 100%;
display: flex;
align-self: center;
flex-flow: row;
justify-items: center;
align-content: space-around;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}

View File

@ -0,0 +1,24 @@
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
import { baseUrl } from "../config/baseUrl";
import { RootState } from "../config/store";
export const QueueApi = createApi({
reducerPath: "QueueApi",
baseQuery: fetchBaseQuery({
baseUrl: `${baseUrl}/queue`,
prepareHeaders: (headers, { getState }) => {
const token = (getState() as RootState).auth.token;
if (token) {
headers.set("authorization", `Bearer ${token}`);
}
return headers;
},
}),
endpoints: (builder) => ({
getQueues: builder.query({
query: () => "/",
}),
}),
});
export const { useGetQueuesQuery } = QueueApi;

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB