Skip to content

Commit

Permalink
Merge pull request #44 from ShibeaRlz/feature/1069
Browse files Browse the repository at this point in the history
Feature/1069 chatroom復元
  • Loading branch information
usamaru33 authored Dec 14, 2024
2 parents 47e2119 + a8d1922 commit c476c15
Show file tree
Hide file tree
Showing 120 changed files with 2,869 additions and 816 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ jobs:
workdir: client
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: 'file'
filter_mode: 'added'
- name: stylelint
uses: reviewdog/action-stylelint@v1
with:
workdir: client
fail_on_error: 'true'
filter_mode: 'added'
reporter: github-pr-review # Change reporter.
stylelint_input: '**/*.scss'
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
docker/swagger/bundle:
docker run -v $(PWD):/spec --rm redocly/cli:latest bundle docs/swagger/root.swagger.yml --output=docs/swagger/generated.gen.swagger.yml

docker/swagger/validate:
docker run -v ${PWD}:/tmp --rm openapitools/openapi-generator-cli validate -i /tmp/docs/swagger/generated.gen.swagger.yml

run-local:
cd server && make run-local /&
cd client && yarn dev
3 changes: 3 additions & 0 deletions client/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"useExhaustiveDependencies": "off",
"noUnusedVariables": "error",
"noUnusedImports": "error"
},
"suspicious": {
"noArrayIndexKey": "off"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/app/community/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import ChatRooms from "@/features/chat/components/chat-rooms";
import ChatWindow from "@/features/chat/components/chat-window";
import ChatRooms from "@/features/chat/components/ChatRooms";
import ChatWindow from "@/features/chat/components/ChatWindow";
import { Room } from "@/features/chat/types/types";
import { useState } from "react";
import "./Page.scss";
Expand Down
6 changes: 0 additions & 6 deletions client/src/app/community/event/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Skeleton } from "@/components/ui/skeleton";
import { EventCard } from "@/features/event";
import { getEvents } from "@/features/event/hooks/get-events";
import { EventType } from "@/features/event/types/event";
import { Menubar } from "@/features/menubar/components/Menubar";
import { Popup } from "@/features/popup";
import { TagType } from "@/features/tags/types/tag";
import { useEffect, useState } from "react";
Expand Down Expand Up @@ -61,14 +60,12 @@ const EventPage = () => {
}, [invitedEvents]);

const handleEventClose = () => {
console.log("Event closed");
};

return (
<>
{/*<AuthProvider>*/}
{!loading && events.length > 0 && showPopup && <Popup cards={events} />}
<Menubar />
<div className={styles.inviteCheck}>
<InviteCheck size={500} />
</div>
Expand Down Expand Up @@ -103,9 +100,6 @@ const EventPage = () => {
publisher={event.community_info.name}
publisherIcon={event.community_info.img}
datetime={event.date}
tags={event.tag.map(tag => ({
name: tag.toString(),
}))}
imageUrl={event.img}
liked={false}
handleEventClose={handleEventClose}
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/community/event/setting/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "../../../styles/theme";
@use "@/styles/theme";

.background {
background-color: theme.$black;
Expand Down
110 changes: 5 additions & 105 deletions client/src/app/community/home/page.tsx
Original file line number Diff line number Diff line change
@@ -1,107 +1,7 @@
"use client";
import { CommunityHome } from "@/features/home/community";

import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { User } from "@/features/account/types/user";
import { UserCard } from "@/features/community-home/components/user-card";
import { GetUsers } from "@/features/community-home/hooks/gets-users";
import { Search } from "lucide-react";
import { useEffect, useState } from "react";
import styles from "./style.module.scss";
const CommunityHomePage = () => {
return <CommunityHome />;
};

export default function Home() {
const [users, setUsers] = useState<User[]>([]);
const [searchQuery, setSearchQuery] = useState("");
const [selectedUser, setSelectedUser] = useState<User[]>([]);
const [textAreaValue, setTextAreaValue] = useState("");

useEffect(() => {
GetUsers().then(users => {
setUsers(users);
});
}, []);

const filteredUsers = users.filter(user =>
user.name.toLowerCase().includes(searchQuery.toLowerCase()),
);

const handleCardClick = (user: User) => {
if (!selectedUser.includes(user)) {
setSelectedUser([...selectedUser, user]);
} else {
setSelectedUser(selectedUser.filter(selected => selected !== user));
}
};

const handleSubmit = () => {
//selectedUserのuuidをconsole.logで出力
selectedUser.map(user => console.log(user.uuid));
console.log(textAreaValue);
setTextAreaValue("");
};

return (
<>
<h1 className="text-2xl font-bold text-white mt-4 ml-10">ホーム</h1>
<div className="container mx-auto p-4">
<div className="flex justify-center mb-6">
<div className="w-full max-w-md relative">
<Input
type="text"
placeholder="ユーザー名で検索..."
value={searchQuery}
onChange={e => setSearchQuery(e.target.value)}
className="w-full pr-10"
/>
<div className="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-500">
<Search size={20} />
</div>
</div>
</div>

<ScrollArea className="h-96 w-full rounded-md border">
<div className="grid grid-cols-2 gap-2 p-4">
{filteredUsers.map(user => {
return (
<UserCard
key={user.name}
uuid={user.uuid}
username={user.name}
icon={user.img}
tags={user.tags}
detail={user.self}
university={user.mem1}
onClick={() => {
handleCardClick(user);
}}
/>
);
})}
</div>
</ScrollArea>
<div className="mt-4">
<div className="w-full h-full pointer-events-none">
<div className="p-2">
{selectedUser.map(user => (
<span key={user.uuid} className={`${styles.userName} ${styles.fadeIn}`}>
<Badge className="bg-white text-black border-blue-500">{user.name}</Badge>
</span>
))}
</div>
</div>
<textarea
className="w-full h-60 p-2 border rounded-md"
value={textAreaValue}
onChange={e => setTextAreaValue(e.target.value)}
placeholder="スカウトメッセージを入力してください..."
/>
<div className="flex justify-end mt-2">
<Button onClick={handleSubmit}>招待を送る</Button>
</div>
</div>
</div>
</>
);
}
export default CommunityHomePage;
2 changes: 1 addition & 1 deletion client/src/app/community/home/setting/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "../../../styles/theme";
@use "@/styles/theme";

.background {
background-color: theme.$black;
Expand Down
36 changes: 0 additions & 36 deletions client/src/app/community/home/style.module.scss

This file was deleted.

4 changes: 2 additions & 2 deletions client/src/app/community/profile/setting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { ProfileSetting } from "@/features/profile/components/ProfileSetting";

const ProfileSettingPage = () => {
return (
<>
<div>
<ProfileSetting type="community" />
</>
</div>
);
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/app/community/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SignUpDialog } from "@/features/signup/components/signup";
import { SignUpDialog } from "@/features/signup/components/Signup";
// import style from "./style.module.scss";

const SignupPage = () => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/community/signup/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "../../../styles/theme";
@use "@/styles/theme";

.body {
background-color: theme.$gray;
Expand Down
43 changes: 43 additions & 0 deletions client/src/app/community/signup/tags/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { TagCard } from "@/features/tags/components/TagCard";
import style from "./style.module.scss";

const RegisterTags = () => {
const mockData = {
message: "sign in successful",
tags: [
{
ID: 2,
color: "red",
Name: "st",
},
{
ID: 3,
color: "blue",
Name: "a",
},
{
ID: 5,
color: "green",
Name: "r",
},
{
ID: 1,
color: "gray",
Name: "hogehoge",
},
{
ID: 4,
color: "purple",
Name: "d",
},
],
};

return (
<div className={style.card}>
<TagCard type={"community"} />
</div>
);
};

export default RegisterTags;
Empty file.
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
"use client";

import { ProfileDetailCard } from "@/features/profile/components/Profile";
import { ChevronRight } from "lucide-react";
import Link from "next/link";
import { useSearchParams } from "next/navigation";
import { Suspense } from "react";
import style from "./style.module.scss";

const ProfileDetailPage = () => {
return (
<>
<p className={style.profile_overview}>ユーザー詳細</p>
<div className={style.profile_detail_card}>
<ProfileDetailCard />
<Suspense fallback={<div>Loading...</div>}>
<ProfileDetailContent />
</Suspense>
</div>
<Link href={"/community/home"} className={style.link_home}>
<ChevronRight size={36} strokeWidth={3} />
Expand All @@ -20,4 +23,11 @@ const ProfileDetailPage = () => {
);
};

export default ProfileDetailPage;
const ProfileDetailContent = () => {
const searchParams = useSearchParams();
const uuid = searchParams.get("uuid");

return <ProfileDetailCard uuid={uuid || ""} />;
};

export default ProfileDetailPage;
14 changes: 8 additions & 6 deletions client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ export default function RootLayout({
}>) {
return (
<html lang="ja">
<body className="min-h-screen">
<BackGroundColor>
<Menubar />
<main className="flex-grow">{children}</main>
<Toaster />
</BackGroundColor>
<body className="min-h-screen overflow-hidden">
<div className="overflow-auto h-screen">
<BackGroundColor>
<Menubar />
<main className="flex-grow">{children}</main>
<Toaster richColors />
</BackGroundColor>
</div>
</body>
</html>
);
Expand Down
9 changes: 8 additions & 1 deletion client/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
"use client";
import { useRouter } from "next/navigation";
import React from "react";

const Home = () => {
// return <HomeComponent />;
const router = useRouter();
React.useEffect(() => {
router.push("user/signin");
}, []);
return <></>;
};

Expand Down
4 changes: 2 additions & 2 deletions client/src/app/user/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import ChatRooms from "@/features/chat/components/chat-rooms";
import ChatWindow from "@/features/chat/components/chat-window";
import ChatRooms from "@/features/chat/components/ChatRooms";
import ChatWindow from "@/features/chat/components/ChatWindow";
import { Room } from "@/features/chat/types/types";
import { useState } from "react";
import "./Page.scss";
Expand Down
Loading

0 comments on commit c476c15

Please sign in to comment.