diff --git a/frontend/app/rsbuild.config.ts b/frontend/app/rsbuild.config.ts index e202dfc..06a2ab0 100644 --- a/frontend/app/rsbuild.config.ts +++ b/frontend/app/rsbuild.config.ts @@ -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", }, diff --git a/frontend/app/src/App.css b/frontend/app/src/App.css index 525cd30..0ea3b83 100644 --- a/frontend/app/src/App.css +++ b/frontend/app/src/App.css @@ -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); } diff --git a/frontend/app/src/components/AuthModal.tsx b/frontend/app/src/components/AuthModal.tsx index 97e0899..b511168 100644 --- a/frontend/app/src/components/AuthModal.tsx +++ b/frontend/app/src/components/AuthModal.tsx @@ -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} > - + } + > setCurrent(e.key)} mode="horizontal" diff --git a/frontend/app/src/config/store.ts b/frontend/app/src/config/store.ts index 13048d0..9b97f32 100644 --- a/frontend/app/src/config/store.ts +++ b/frontend/app/src/config/store.ts @@ -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 diff --git a/frontend/app/src/config/style.ts b/frontend/app/src/config/style.ts index ef8f631..eef6e1c 100644 --- a/frontend/app/src/config/style.ts +++ b/frontend/app/src/config/style.ts @@ -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", }, }; diff --git a/frontend/app/src/pages/MainPage.tsx b/frontend/app/src/pages/MainPage.tsx index 98096de..1fe85ff 100644 --- a/frontend/app/src/pages/MainPage.tsx +++ b/frontend/app/src/pages/MainPage.tsx @@ -12,8 +12,9 @@ const MainPage = () => { {tr("Queuing has never been so simple")}

- - + +
+
); diff --git a/frontend/app/src/pages/styles.css b/frontend/app/src/pages/styles.css index 7090353..f4efc0e 100644 --- a/frontend/app/src/pages/styles.css +++ b/frontend/app/src/pages/styles.css @@ -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; } \ No newline at end of file diff --git a/frontend/app/src/slice/QueueApi.ts b/frontend/app/src/slice/QueueApi.ts new file mode 100644 index 0000000..e383158 --- /dev/null +++ b/frontend/app/src/slice/QueueApi.ts @@ -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; diff --git a/frontend/app/static/android-chrome-192x192.png b/frontend/app/static/android-chrome-192x192.png new file mode 100644 index 0000000..dc6a0c6 Binary files /dev/null and b/frontend/app/static/android-chrome-192x192.png differ diff --git a/frontend/app/static/android-chrome-512x512.png b/frontend/app/static/android-chrome-512x512.png new file mode 100644 index 0000000..20ee593 Binary files /dev/null and b/frontend/app/static/android-chrome-512x512.png differ diff --git a/frontend/app/static/apple-touch-icon.png b/frontend/app/static/apple-touch-icon.png new file mode 100644 index 0000000..e065bf0 Binary files /dev/null and b/frontend/app/static/apple-touch-icon.png differ diff --git a/frontend/app/static/favicon-16x16.png b/frontend/app/static/favicon-16x16.png new file mode 100644 index 0000000..bec6a3a Binary files /dev/null and b/frontend/app/static/favicon-16x16.png differ diff --git a/frontend/app/static/favicon-32x32.png b/frontend/app/static/favicon-32x32.png new file mode 100644 index 0000000..ba80ffd Binary files /dev/null and b/frontend/app/static/favicon-32x32.png differ diff --git a/frontend/app/static/favicon.ico b/frontend/app/static/favicon.ico new file mode 100644 index 0000000..4392604 Binary files /dev/null and b/frontend/app/static/favicon.ico differ