Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat home center #9

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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,017 changes: 1,643 additions & 374 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.11",
"@mui/material": "^5.14.11",
"@mui/icons-material": "^5.14.12",
"@mui/material": "^5.14.12",
"next": "latest",
"react": "latest",
"react-dom": "latest",
Expand All @@ -25,8 +25,11 @@
"autoprefixer": "latest",
"eslint": "latest",
"eslint-config-next": "latest",
"eslint-plugin-tailwind": "^0.2.1",
"eslint-plugin-tailwindcss": "^3.13.0",
"postcss": "latest",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.5",
"tailwindcss": "latest",
"typescript": "latest"
}
Expand Down
19 changes: 11 additions & 8 deletions src/components/Chat.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import React from "react";

import SearchBar from "./SearchBar";
import ChatBar from "./ChatBar";
const Chat = () => {
return (
<div className="hide-scrollbar h-screen w-full overflow-y-auto bg-chat">
Chat
<div className="mt-40">aaa</div>
<div className="mt-40">aaa</div>
<div className="mt-40">aaa</div>
<div className="mt-40">aaa</div>
<div className="mt-40">aaa</div>
<div className="hidden-scrollbar h-screen w-full overflow-y-scroll">
<SearchBar/>
{/* ここにチャットを表示するコンポーネントを作成
最新のチャットを表示するようにスクロール */}
<div className="m-40">aaa</div>
<div className="m-40">aaa</div>
<div className="m-40">aaa</div>
<div className="m-40">aaa</div>
<ChatBar/>
</div>
);
};
Expand Down
24 changes: 24 additions & 0 deletions src/components/ChatBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import SentimentSatisfiedAltIcon from '@mui/icons-material/SentimentSatisfiedAlt';

const ChatBar = () => {
return (
<div className="h-min bg-gray-200 px-2">
<div className="overflow-hidden rounded-lg">
<div className="flex">
<div className="w-full p-3">
<div className="relative">
<input
type="text"
className="h-14 w-full rounded-lg bg-white px-16 hover:cursor-pointer focus:outline-none"
></input>
<SentimentSatisfiedAltIcon className="absolute right-1 top-3 h-3/5 w-1/5 text-gray-400"></SentimentSatisfiedAltIcon>
</div>
</div>
</div>
</div>
</div>
);
}

export default ChatBar;
26 changes: 26 additions & 0 deletions src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import SearchIcon from "@mui/icons-material/Search";

const SearchBar = () => {
return (
// サイドバーとの幅,高さを揃えたい
<div className="h-min bg-gray-200 px-2">
<div className="overflow-hidden rounded-lg">
<div className="flex">
<div className="w-full p-3">
<div className="relative">
<SearchIcon className="absolute left-1 top-3 h-3/5 w-1/5 text-gray-400"></SearchIcon>
<input
type="text"
className="h-14 w-full rounded-lg bg-white px-16 hover:cursor-pointer focus:outline-none"
></input>
</div>
</div>
</div>
</div>
</div>

);
};

export default SearchBar;
25 changes: 0 additions & 25 deletions src/pages/chatHomeCenter.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +0,0 @@
import React from "react";

export default function chatHomeCenter() {
return (
<div className="py-20 h-screen bg-gray-300 px-2">
<div className="max-w-md mx-auto rounded-lg overflow-hidden md:max-w-xl">
<div className="md:flex">
<div className="w-full p-3">
<div className="relative">
<i className="absolute fa fa-search text-gray-400 top-5 left-4"></i>
<input
type="text"
className="bg-white h-14 w-full px-12 rounded-lg focus:outline-none hover:cursor-pointer"
name=""
></input>
<span className="absolute top-4 right-5 border-l pl-4">
<i className="fa fa-microphone text-gray-500 hover:text-green-500 hover:cursor-pointer"></i>
</span>
</div>
</div>
</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const inter = Inter({ subsets: ["latin"] });
export default function Home() {
return (
<div className="flex w-full ">
<Chat />
<Chat/>
</div>
);
}
14 changes: 8 additions & 6 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
}

/* スクロールバーを非表示にするスタイル */
.hide-scrollbar::-webkit-scrollbar {
width: 0.5em;
}
.hidden-scrollbar {
-ms-overflow-style: none; /* IE, Edge 対応 */
scrollbar-width: none; /* Firefox 対応 */
}
.hidden-scrollbar::-webkit-scrollbar {
/* Chrome, Safari 対応 */
display: none;
}

.hide-scrollbar::-webkit-scrollbar-thumb {
background-color: transparent;
}