-
Notifications
You must be signed in to change notification settings - Fork 0
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
Mainページの作成 #8
Merged
Merged
Mainページの作成 #8
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ec167ca
feat: globals.css
pirotyyy cc362d5
feat: layout
pirotyyy 2ddcde8
feat: sidebar moc
pirotyyy b2e0d24
fix: fix sidebar
pirotyyy 5f7188a
feat: UserIcon
pirotyyy f8768c1
feat: Tag
pirotyyy 976b718
feat: User
pirotyyy 17061b3
feat: UserList
pirotyyy 44e91b3
feat: URLからの画像を表示させるための設定
pirotyyy 4ff349d
feat: set UserList to main page
pirotyyy 5e940e9
feat: add comment
pirotyyy 7289bab
feat: スクロール関連と微小なcssの修正
pirotyyy c74d1f0
feat: UserSeachForm
pirotyyy cce20a0
feat: UserSearchFormの設置
pirotyyy c15c316
feat: scrollbarを隠すやつ
pirotyyy 908653c
feat: CareerPreview
pirotyyy 2802ac3
refactor: remove div tag
pirotyyy ffc2f83
refactor: 見た目修正
pirotyyy be0637c
fix: url修正
pirotyyy 4744f11
Merge branch 'main' into feature/main-page
pirotyyy a17c7ac
fix: rename s/userData/UserData
pirotyyy 7125d76
feat: コメントUI作成
pirotyyy bdfdf83
chore: css微修正
pirotyyy 2b95dec
feat: outline css
pirotyyy 5dd1eec
fix: style
pirotyyy a86d851
feat: set arrow
pirotyyy c43f364
fix: page.tsxのdiv減らす
pirotyyy b34c550
fix: CareerPreview.tsxのdivの最適化
pirotyyy 573d78d
fix: UserListのcss修正
pirotyyy 5038eee
fix: UserSearchForm.tsxのcss修正
pirotyyy 707ea1f
fix: User.tsxのdiv最適化
pirotyyy 931e080
fix: sizeを変数に格納
pirotyyy 9ca834c
feat: userのテストデータを別ファイルに移す
pirotyyy 4b8fc1b
feat: material-iconのcssクラスを実装
pirotyyy 498479a
fix: hoverされた時にgrayになるバグを修正
pirotyyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
const nextConfig = { | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: 'storage.googleapis.com', | ||
port: '', | ||
pathname: '/dev-open-hacku-bucket/**' | ||
} | ||
] | ||
} | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use client"; | ||
|
||
import CareerPreview from "@/components/CareerPreview"; | ||
import Sidebar from "@/components/Sidebar"; | ||
import UserList from "@/components/UserList"; | ||
import UserSearchForm from "@/components/UserSearchForm"; | ||
import { useState } from "react"; | ||
import { UserData } from "../../../proto/typescript/pb_out/main"; | ||
|
||
const Main = () => { | ||
const [hoveredUser, setHoveredUser] = useState<UserData | null>(null); | ||
|
||
return ( | ||
<div className="h-screen w-screen grid grid-cols-10"> | ||
<div className="col-span-1"> | ||
<Sidebar /> | ||
</div> | ||
<div className="col-span-9"> | ||
<div className="grid grid-cols-5"> | ||
<div className="col-span-3 p-4 h-screen overflow-scroll hidden-scrollbar"> | ||
<UserSearchForm /> | ||
<UserList | ||
setHoveredUser={setHoveredUser} | ||
hoveredUser={hoveredUser} | ||
/> | ||
</div> | ||
<div className="col-span-2"> | ||
<CareerPreview user={hoveredUser} /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import { UserData } from "../../proto/typescript/pb_out/main"; | ||
import UserIcon from "./UserIcon"; | ||
|
||
interface Props { | ||
user: UserData | null; | ||
} | ||
|
||
const CareerPreview = (props: Props) => { | ||
const { user } = props; | ||
|
||
return ( | ||
<div className="pt-4 pr-4 pb-4 h-screen"> | ||
<div | ||
className={`h-full outline rounded flex justify-center items-center ${ | ||
user ? "outline-4 outline-blue-200" : "outline-2 outline-gray-200" | ||
}`} | ||
> | ||
{ | ||
// NOTE: ナジャさんの作成したコンポーネント置く。 | ||
// 仮にHoverしたユーザーの情報を表示させている。 | ||
} | ||
{user ? ( | ||
<div className="flex-row items-center"> | ||
<UserIcon iconImageHash={user.iconImageHash} size={128} /> | ||
<div className="text-center"> | ||
<span>{user.firstname + " " + user.lastname}</span> | ||
</div> | ||
</div> | ||
) : ( | ||
<p>any user not hovered</p> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CareerPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
const Sidebar = () => { | ||
return ( | ||
<div className="h-screen outline outline-2 outline-gray-200 ">Sidebar</div> | ||
); | ||
}; | ||
|
||
export default Sidebar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react"; | ||
|
||
interface Props { | ||
name: string; | ||
} | ||
|
||
const Tag = (props: Props) => { | ||
const { name } = props; | ||
return ( | ||
<div className="mr-2"> | ||
<span className="text-[12px] bg-orange-400 py-1 px-3 text-white rounded-2xl"> | ||
{name} | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Tag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
import { UserData } from "../../proto/typescript/pb_out/main"; | ||
import UserIcon from "./UserIcon"; | ||
import Tag from "./Tag"; | ||
|
||
interface Props { | ||
user: UserData; | ||
hovered: boolean; | ||
} | ||
|
||
/** | ||
* User Component | ||
* 一覧に表示するユーザー | ||
*/ | ||
const User = (props: Props) => { | ||
const { user, hovered } = props; | ||
const iconSize = 96; | ||
|
||
return ( | ||
<div | ||
className={`p-4 my-4 outline outline-2 rounded ${ | ||
hovered ? "outline-4 outline-blue-200" : "outline-gray-200" | ||
}`} | ||
> | ||
<div className="flex flex-row items-center"> | ||
<div className="mb-2 mr-4"> | ||
<UserIcon iconImageHash={user.iconImageHash} size={iconSize} /> | ||
</div> | ||
<div> | ||
<div className="text-2xl font-semibold">{user.username}</div> | ||
<div className="flex flex-row items-center"> | ||
{user.tag.map((tag) => { | ||
return <Tag name={tag.tagName} key={tag.tagId} />; | ||
})} | ||
</div> | ||
</div> | ||
</div> | ||
<div className="mt-2 relative px-4 py-4 flex items-center rounded bg-gray-100 before:content-[''] before:absolute before:top-[-40%] before:left-10 before:border-[12px] before:border-transparent before:border-b-gray-100"> | ||
<div className="mr-2 material-symbols-outlined">chat</div> | ||
<div>{user.statusMessage}</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default User; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Image from "next/image"; | ||
import React from "react"; | ||
|
||
interface Props { | ||
iconImageHash: string; | ||
size: number; | ||
} | ||
|
||
/** | ||
* UserIcon | ||
* ユーザーのアイコン | ||
*/ | ||
const UserIcon = (props: Props) => { | ||
const { iconImageHash, size } = props; | ||
|
||
return ( | ||
<div> | ||
<Image | ||
src={iconImageHash} | ||
alt="" | ||
width={size} | ||
height={size} | ||
className="rounded-full object-cover" | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"use client"; | ||
|
||
import React, { Dispatch, SetStateAction } from "react"; | ||
import User from "./User"; | ||
import { UserData } from "../../proto/typescript/pb_out/main"; | ||
import users from "@/constants/json/user-data.json"; // テストデータ読み込み | ||
|
||
interface Props { | ||
setHoveredUser: Dispatch<SetStateAction<null | UserData>>; | ||
hoveredUser: null | UserData; | ||
} | ||
|
||
/** | ||
* UserList Component | ||
* ユーザー一覧 | ||
*/ | ||
const UserList = (props: Props) => { | ||
const { setHoveredUser, hoveredUser } = props; | ||
|
||
return ( | ||
<div className="w-full py-4 items-center"> | ||
{users.map((user) => { | ||
return ( | ||
<div key={user.userId} className="flex flex-row items-center"> | ||
<div className="w-11/12" onMouseEnter={() => setHoveredUser(user)}> | ||
<User | ||
user={user} | ||
hovered={ | ||
hoveredUser ? hoveredUser.userId === user.userId : false | ||
} | ||
/> | ||
</div> | ||
{hoveredUser && hoveredUser.userId === user.userId ? ( | ||
<div className="w-1/12"> | ||
<span className="material-symbols-outlined material-icons text-8xl text-blue-200 "> | ||
arrow_right | ||
</span> | ||
</div> | ||
) : ( | ||
<div></div> | ||
)} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
|
||
// UserSeachForm | ||
// ユーザーを検索するところ | ||
const UserSearchForm = () => { | ||
return ( | ||
<div className="pb-4 h-max"> | ||
<p className="text-lg font-bold my-4">ユーザーを検索する</p> | ||
<input | ||
type="text" | ||
placeholder="キーワードで検索" | ||
className="p-2 mr-3 text-sm rounded-lg bg-gray-100" | ||
/> | ||
<button className="py-2 px-4 text-sm rounded-lg bg-blue-400 text-white "> | ||
検索 | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserSearchForm; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FLY(どっちでもOKです。)
ただの共有っす、こっちの書き方もアリかもです。