File tree Expand file tree Collapse file tree
features/account/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use client' ;
22
3+ import Link from 'next/link' ;
34import { Button } from '@/components/ui/button' ;
45import { Card , CardContent , CardHeader , CardTitle } from '@/components/ui/card' ;
56import { Input } from '@/components/ui/input' ;
@@ -8,6 +9,7 @@ import { useAccountSettingsForms } from '@/features/account/settings/hooks';
89export default function AccountSettingsPage ( ) {
910 const {
1011 user,
12+ currentOrganization,
1113 profileForm,
1214 passwordForm,
1315 updateProfileMutation,
@@ -57,6 +59,23 @@ export default function AccountSettingsPage() {
5759 </ CardContent >
5860 </ Card >
5961
62+ { currentOrganization && (
63+ < Card >
64+ < CardHeader >
65+ < CardTitle className = 'text-base' > 所属大学</ CardTitle >
66+ </ CardHeader >
67+ < CardContent className = 'space-y-4' >
68+ < div >
69+ < p className = 'text-sm font-medium' > { currentOrganization . name } </ p >
70+ < p className = 'text-sm text-muted-foreground' > 大学のメンバーと招待を管理できます。</ p >
71+ </ div >
72+ < Button variant = 'outline' render = { < Link href = '/university/settings' /> } >
73+ 大学設定を開く
74+ </ Button >
75+ </ CardContent >
76+ </ Card >
77+ ) }
78+
6079 < Card >
6180 < CardHeader >
6281 < CardTitle className = 'text-base' > パスワード変更</ CardTitle >
Original file line number Diff line number Diff line change @@ -41,9 +41,16 @@ export default function DashboardPage() {
4141
4242 return (
4343 < div className = 'space-y-6' >
44- < div >
45- < h1 className = 'text-2xl font-bold' > ダッシュボード</ h1 >
46- { currentOrg && < p className = 'text-muted-foreground mt-1' > { currentOrg . name } </ p > }
44+ < div className = 'flex flex-wrap items-start justify-between gap-3' >
45+ < div >
46+ < h1 className = 'text-2xl font-bold' > ダッシュボード</ h1 >
47+ { currentOrg && < p className = 'text-muted-foreground mt-1' > { currentOrg . name } </ p > }
48+ </ div >
49+ { currentOrg && (
50+ < Button size = 'sm' variant = 'outline' render = { < Link href = '/university/settings' /> } >
51+ 大学設定
52+ </ Button >
53+ ) }
4754 </ div >
4855
4956 { isLoading ? (
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import { useAuth, useInvalidateMe } from '@/contexts/AuthContext';
66import { authClient } from '@/lib/auth/client' ;
77
88export function useAccountSettingsForms ( ) {
9- const { user } = useAuth ( ) ;
9+ const { user, organizations , activeOrganizationId } = useAuth ( ) ;
1010 const invalidateMe = useInvalidateMe ( ) ;
11+ const currentOrganization =
12+ organizations . find ( ( org ) => org . id === activeOrganizationId ) ?? organizations [ 0 ] ?? null ;
1113
1214 const updateProfileMutation = useMutation ( {
1315 mutationFn : async ( values : { name : string } ) => {
@@ -61,6 +63,7 @@ export function useAccountSettingsForms() {
6163
6264 return {
6365 user,
66+ currentOrganization,
6467 profileForm,
6568 passwordForm,
6669 updateProfileMutation,
You can’t perform that action at this time.
0 commit comments