Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v2
- run: make prepare-deploy-web
- run: test `ls web/dist | wc -l` != 0
- run: test `ls web/out | wc -l` != 0

deploy-test-server:
name: Deploy Test (server)
Expand Down
8 changes: 4 additions & 4 deletions web/api/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import type {
SharedRoom,
UpdateRoom,
UserID,
} from "../../../common/types";
import { ErrUnauthorized, credFetch } from "../../firebase/auth/lib";
} from "~/common/types";
import { ErrUnauthorized, credFetch } from "~/firebase/auth/lib";
import endpoints from "../internal/endpoints";

/* TODO
import { UserID } from "../common/types";
import type { User } from "../common/types";
import { UserID } from "~/common/types";
import type { User } from "~/common/types";
*/

//// DM グループチャット 共通////
Expand Down
8 changes: 4 additions & 4 deletions web/api/chat/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { useCallback } from "react";
import { z } from "zod";
// import { useCallback, useEffect, useState } from "react";
import type { Message, RoomOverview } from "../../../common/types";
import { MessageSchema, RoomOverviewSchema } from "../../../common/zod/schemas";
import { type Hook, useCustomizedSWR } from "../../hooks/useCustomizedSWR";
import type { Message, RoomOverview } from "~/common/types";
import { MessageSchema, RoomOverviewSchema } from "~/common/zod/schemas";
import { type Hook, useCustomizedSWR } from "~/hooks/useCustomizedSWR";
import type { UserID } from "../internal/endpoints";
// import type { Hook } from "../share/types";
// import type { Hook } from "~/share/types";
import * as chat from "./chat";

const OverviewListSchema = z.array(RoomOverviewSchema);
Expand Down
6 changes: 3 additions & 3 deletions web/api/course.hook.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";
import type { Course } from "../../common/types";
import { CourseSchema } from "../../common/zod/schemas";
import { type Hook, useCustomizedSWR } from "../hooks/useCustomizedSWR";
import type { Course } from "~/common/types";
import { CourseSchema } from "~/common/zod/schemas";
import { type Hook, useCustomizedSWR } from "~/hooks/useCustomizedSWR";
import { getMyCourses } from "./course";

const CourseListSchema = z.array(CourseSchema);
Expand Down
4 changes: 2 additions & 2 deletions web/api/course.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Course, CourseID, Day } from "../../common/types";
import { credFetch } from "../firebase/auth/lib";
import type { Course, CourseID, Day } from "~/common/types";
import { credFetch } from "~/firebase/auth/lib";
import endpoints from "./internal/endpoints";

// TODO: migrate to safe functions
Expand Down
4 changes: 2 additions & 2 deletions web/api/internal/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CourseID, Day, GUID } from "../../../common/types";
import type { MessageID, ShareRoomID } from "../../../common/types";
import type { CourseID, Day, GUID } from "~/common/types";
import type { MessageID, ShareRoomID } from "~/common/types";

export const origin: string | null = process.env.NEXT_PUBLIC_API_ENDPOINT ?? "";
if (!origin) throw new Error("process.env.NEXT_PUBLIC_API_ENDPOINT not found!");
Expand Down
4 changes: 2 additions & 2 deletions web/api/internal/fetch-func.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Err, Ok, type Result } from "../../../common/lib/result";
import { Err, Ok, type Result } from "~/common/lib/result";

export async function safeFetch(
path: string,
Expand All @@ -15,7 +15,7 @@ export async function safeFetch(
}
}

import { getIdToken } from "../../firebase/auth/lib";
import { getIdToken } from "~/firebase/auth/lib";
import endpoints from "./endpoints";

type URL = string;
Expand Down
2 changes: 1 addition & 1 deletion web/api/match.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { credFetch } from "../firebase/auth/lib";
import { credFetch } from "~/firebase/auth/lib";
import endpoints from "./internal/endpoints";
import type { UserID } from "./internal/endpoints";

Expand Down
2 changes: 1 addition & 1 deletion web/api/request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { credFetch } from "../firebase/auth/lib";
import { credFetch } from "~/firebase/auth/lib";
import endpoints, { type UserID } from "./internal/endpoints";

//指定したユーザにリクエストを送る
Expand Down
12 changes: 6 additions & 6 deletions web/api/user.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { z } from "zod";
import type { GUID, UpdateUser, User, UserID } from "../../common/types.ts";
import { parseUser } from "../../common/zod/methods.ts";
import { UserIDSchema, UserSchema } from "../../common/zod/schemas.ts";
import { credFetch } from "../firebase/auth/lib.ts";
import { type Hook, useCustomizedSWR } from "../hooks/useCustomizedSWR.ts";
import { useAuthorizedData } from "../hooks/useData.ts";
import type { GUID, UpdateUser, User, UserID } from "~/common/types.ts";
import { parseUser } from "~/common/zod/methods.ts";
import { UserIDSchema, UserSchema } from "~/common/zod/schemas.ts";
import { credFetch } from "~/firebase/auth/lib.ts";
import { type Hook, useCustomizedSWR } from "~/hooks/useCustomizedSWR.ts";
import { useAuthorizedData } from "~/hooks/useData.ts";
import endpoints from "./internal/endpoints.ts";
import type { Hook as UseHook } from "./share/types.ts";

Expand Down
4 changes: 2 additions & 2 deletions web/app/chat/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box } from "@mui/material";
import BottomBar from "../../components/BottomBar";
import Header from "../../components/Header";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";

export default function ChatPageLayout({
children,
Expand Down
10 changes: 5 additions & 5 deletions web/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { Typography } from "@mui/material";
import { useSearchParams } from "next/navigation";
import { Suspense } from "react";
import { useRoomsOverview } from "../../api/chat/hooks";
import RoomList from "../../components/chat/RoomList";
import { RoomWindow } from "../../components/chat/RoomWindow";
import FullScreenCircularProgress from "../../components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "../../components/common/NavigateByAuthState";
import { useRoomsOverview } from "~/api/chat/hooks";
import RoomList from "~/components/chat/RoomList";
import { RoomWindow } from "~/components/chat/RoomWindow";
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";

function ChatListContent() {
const searchParams = useSearchParams();
Expand Down
8 changes: 4 additions & 4 deletions web/app/edit/courses/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { Box, Button, Typography } from "@mui/material";
import Link from "next/link";
import { useAboutMe } from "../../../api/user";
import FullScreenCircularProgress from "../../../components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "../../../components/common/NavigateByAuthState";
import EditableCoursesTable from "../../../components/course/EditableCoursesTable";
import { useAboutMe } from "~/api/user";
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import EditableCoursesTable from "~/components/course/EditableCoursesTable";

export default function EditCourses() {
const { state } = useAboutMe();
Expand Down
2 changes: 1 addition & 1 deletion web/app/edit/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box } from "@mui/material";
import Header from "../../components/Header";
import Header from "~/components/Header";

export default function EditPageLayout({
children,
Expand Down
20 changes: 10 additions & 10 deletions web/app/edit/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import type { SelectChangeEvent } from "@mui/material";
import { useRouter } from "next/navigation";
import { enqueueSnackbar } from "notistack";
import { useEffect, useState } from "react";
import { update, useAboutMe } from "../../../api/user";
import type { UpdateUser } from "../../../common/types";
import { UpdateUserSchema } from "../../../common/zod/schemas";
import FullScreenCircularProgress from "../../../components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "../../../components/common/NavigateByAuthState";
import { useAlert } from "../../../components/common/alert/AlertProvider";
import PhotoModal from "../../../components/config/PhotoModal";
import { PhotoPreviewButton } from "../../../components/config/PhotoPreview";
import UserAvatar from "../../../components/human/avatar";
import { facultiesAndDepartments } from "../../signup/data";
import { update, useAboutMe } from "~/api/user";
import { facultiesAndDepartments } from "~/app/signup/data";
import type { UpdateUser } from "~/common/types";
import { UpdateUserSchema } from "~/common/zod/schemas";
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import { useAlert } from "~/components/common/alert/AlertProvider";
import PhotoModal from "~/components/config/PhotoModal";
import { PhotoPreviewButton } from "~/components/config/PhotoPreview";
import UserAvatar from "~/components/human/avatar";

export default function EditProfile() {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion web/app/faq/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ArrowBack } from "@mui/icons-material";
import { Box, IconButton, Typography } from "@mui/material";
import { useRouter } from "next/navigation";
import Header from "../../components/Header";
import Header from "~/components/Header";

export default function FAQ() {
const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions web/app/friends/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box } from "@mui/material";
import BottomBar from "../../components/BottomBar";
import Header from "../../components/Header";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";

export default function FriendsPageLayout({
children,
Expand Down
6 changes: 3 additions & 3 deletions web/app/friends/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import { Box, Tab, Tabs } from "@mui/material";
import { useState } from "react";
import { NavigateByAuthState } from "../../components/common/NavigateByAuthState";
import Matchings from "../../components/match/matching";
import Requests from "../../components/match/requests";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import Matchings from "~/components/match/matching";
import Requests from "~/components/match/requests";

export default function Friends() {
const [open, setOpen] = useState(0);
Expand Down
4 changes: 2 additions & 2 deletions web/app/home/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box } from "@mui/material";
import BottomBar from "../../components/BottomBar";
import Header from "../../components/Header";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";

export default function HomePageLayout({
children,
Expand Down
12 changes: 6 additions & 6 deletions web/app/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import CloseIcon from "@mui/icons-material/Close";
import FavoriteIcon from "@mui/icons-material/Favorite";
import { Box, Button } from "@mui/material";
import { useCallback, useEffect, useState } from "react";
import request from "../../api/request";
import request from "~/api/request";

import shadows from "@mui/material/styles/shadows";
import { motion, useAnimation } from "framer-motion";
import { useMyID, useRecommended } from "../../api/user";
import { Card } from "../../components/Card";
import { DraggableCard } from "../../components/DraggableCard";
import FullScreenCircularProgress from "../../components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "../../components/common/NavigateByAuthState";
import { useMyID, useRecommended } from "~/api/user";
import { Card } from "~/components/Card";
import { DraggableCard } from "~/components/DraggableCard";
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";

export default function Home() {
const { data: recommended, error } = useRecommended();
Expand Down
8 changes: 4 additions & 4 deletions web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import "@fontsource/roboto/300.css";
import "@fontsource/roboto/400.css";
import "@fontsource/roboto/500.css";
import "@fontsource/roboto/700.css";
import BanLandscape from "../components/BanLandscape";
import { AlertProvider } from "../components/common/alert/AlertProvider";
import { ModalProvider } from "../components/common/modal/ModalProvider";
import AuthProvider from "../firebase/auth/AuthProvider";
import BanLandscape from "~/components/BanLandscape";
import { AlertProvider } from "~/components/common/alert/AlertProvider";
import { ModalProvider } from "~/components/common/modal/ModalProvider";
import AuthProvider from "~/firebase/auth/AuthProvider";

const theme = createTheme({
palette: {
Expand Down
16 changes: 8 additions & 8 deletions web/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { Box, Button, Link, Typography } from "@mui/material";
import { GoogleAuthProvider, signInWithPopup } from "firebase/auth";
import { useRouter } from "next/navigation";
import { useSnackbar } from "notistack";
import * as user from "../../api/user";
import { getByGUID } from "../../api/user";
import type { GUID } from "../../common/types";
import Header from "../../components/Header";
import { auth } from "../../firebase/config";
import * as user from "~/api/user";
import { getByGUID } from "~/api/user";
import type { GUID } from "~/common/types";
import Header from "~/components/Header";
import { auth } from "~/firebase/config";
import "./style.css";
import { useState } from "react";
import { CourseMateIcon } from "../../components/common/CourseMateIcon";
import FullScreenCircularProgress from "../../components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "../../components/common/NavigateByAuthState";
import { CourseMateIcon } from "~/components/common/CourseMateIcon";
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";

const provider = new GoogleAuthProvider();
const ALLOW_ANY_MAIL_ADDR =
Expand Down
4 changes: 2 additions & 2 deletions web/app/settings/aboutUs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GitHub, Language } from "@mui/icons-material";
import XIcon from "@mui/icons-material/X";
import { Box, Link, Typography } from "@mui/material";
import { NavigateByAuthState } from "../../../components/common/NavigateByAuthState";
import TopNavigation from "../../../components/common/TopNavigation";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import TopNavigation from "~/components/common/TopNavigation";

export default function AboutUs() {
return (
Expand Down
4 changes: 2 additions & 2 deletions web/app/settings/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Button, Typography } from "@mui/material";
import { NavigateByAuthState } from "../../../components/common/NavigateByAuthState";
import TopNavigation from "../../../components/common/TopNavigation";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import TopNavigation from "~/components/common/TopNavigation";

export default function Contact() {
return (
Expand Down
4 changes: 2 additions & 2 deletions web/app/settings/delete/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { useSnackbar } from "notistack";
import { useCallback } from "react";
import { deleteAccount } from "../../../api/user";
import { useAlert } from "../../../components/common/alert/AlertProvider";
import { deleteAccount } from "~/api/user";
import { useAlert } from "~/components/common/alert/AlertProvider";

export default function DeleteAccount() {
const router = useRouter();
Expand Down
4 changes: 2 additions & 2 deletions web/app/settings/disclaimer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Typography } from "@mui/material";
import { NavigateByAuthState } from "../../../components/common/NavigateByAuthState";
import TopNavigation from "../../../components/common/TopNavigation";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import TopNavigation from "~/components/common/TopNavigation";

export default function Disclaimer() {
return (
Expand Down
4 changes: 2 additions & 2 deletions web/app/settings/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box } from "@mui/material";
import BottomBar from "../../components/BottomBar";
import Header from "../../components/Header";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";

export default function SettingsPageLayout({
children,
Expand Down
4 changes: 2 additions & 2 deletions web/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
ListItemText,
} from "@mui/material";
import Link from "next/link";
import LogOutButton from "../../components/LogOutButton";
import { NavigateByAuthState } from "../../components/common/NavigateByAuthState";
import LogOutButton from "~/components/LogOutButton";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";

export default function Settings() {
return (
Expand Down
10 changes: 5 additions & 5 deletions web/app/settings/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import EditIcon from "@mui/icons-material/Edit";
import { Box, Button, Typography } from "@mui/material";
import Link from "next/link";
import { useState } from "react";
import { useAboutMe } from "../../../api/user";
import { Card } from "../../../components/Card";
import FullScreenCircularProgress from "../../../components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "../../../components/common/NavigateByAuthState";
import TopNavigation from "../../../components/common/TopNavigation";
import { useAboutMe } from "~/api/user";
import { Card } from "~/components/Card";
import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
import TopNavigation from "~/components/common/TopNavigation";

export default function SettingsProfile() {
const { state } = useAboutMe();
Expand Down
6 changes: 3 additions & 3 deletions web/app/signup/functions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getAuth } from "firebase/auth";
import type { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
import type { EnqueueSnackbar } from "notistack";
import * as userAPI from "../../api/user";
import type { GUID, User } from "../../common/types";
import type { UpdateUser } from "../../common/types";
import * as userAPI from "~/api/user";
import type { GUID, User } from "~/common/types";
import type { UpdateUser } from "~/common/types";

type Dependencies = {
router: AppRouterInstance;
Expand Down
4 changes: 2 additions & 2 deletions web/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useSnackbar } from "notistack";
import { useState } from "react";

import { useRouter } from "next/navigation";
import type { Step1User } from "../../../common/zod/types";
import Header from "../../components/Header";
import type { Step1User } from "~/common/zod/types";
import Header from "~/components/Header";
import { register } from "./functions";
import Step1 from "./steps/step1_profile";
import Step2, { type Step2Data } from "./steps/step2_img";
Expand Down
Loading