File tree Expand file tree Collapse file tree 5 files changed +61
-21
lines changed Expand file tree Collapse file tree 5 files changed +61
-21
lines changed Original file line number Diff line number Diff line change 1
1
import { FC } from 'react' ;
2
2
import DialogButton from '@/components/common/DialogButton' ;
3
- import IconUserPlus from '@/assets/icons/IconUserPlus ' ;
3
+ import { IconUserPlus } from '@/assets/icons' ;
4
4
import UserInviteDialog from '@/components/common/UserInviteDialog' ;
5
5
6
- const AddCalendarPage : FC = ( ) => {
6
+ export const UserInvite : FC = ( ) => {
7
7
return (
8
8
< div >
9
9
멤버 초대하기 *
10
- < DialogButton
11
- classname = { 'userInvite bg-base-200 hover:bg-base-300' }
12
- name = { < IconUserPlus /> }
13
- title = { '멤버 찾기' }
14
- desc = { '' }
15
- children = { < UserInviteDialog /> }
16
- />
10
+ < ul className = "flex gap-2" >
11
+ < li >
12
+ < DialogButton
13
+ classname = { 'userInvite bg-base-200 hover:bg-base-300' }
14
+ name = { < IconUserPlus /> }
15
+ title = { '멤버 찾기' }
16
+ desc = { '' }
17
+ children = { < UserInviteDialog /> }
18
+ />
19
+ </ li >
20
+ </ ul >
17
21
</ div >
18
22
) ;
19
23
} ;
20
24
21
- export default AddCalendarPage ;
25
+ export default UserInvite ;
Original file line number Diff line number Diff line change 1
1
import InputForm from './InputForm.tsx' ;
2
2
import { searchUser } from '../../apis/authApis.ts' ;
3
3
import { FC , useState } from 'react' ;
4
- import IconSearch from '@/assets/icons/IconSearch.tsx ' ;
4
+ import { IconSearch } from '@/assets/icons' ;
5
5
import UserInviteList from './UserInviteList.tsx' ;
6
6
7
7
const UserInvite : FC = ( ) => {
@@ -13,8 +13,16 @@ const UserInvite: FC = () => {
13
13
} ;
14
14
15
15
const onSearchClick = ( ) => {
16
- searchUser ( email ) . then ( ( value ) => {
17
- setList ( value . map ( ( { user_nickname, id } ) => < UserInviteList user_nickname = { user_nickname } id = { id } /> ) ) ;
16
+ searchUser ( email ) . then ( ( nickNames ) => {
17
+ if ( ! nickNames . length ) {
18
+ alert ( '해당 닉네임을 찾을 수 없습니다.' ) ;
19
+ return ;
20
+ }
21
+ setList (
22
+ nickNames . map ( ( { user_nickname, id } ) => {
23
+ return < UserInviteList user_nickname = { user_nickname } id = { id } /> ;
24
+ } ) ,
25
+ ) ;
18
26
return list ;
19
27
} ) ;
20
28
} ;
Original file line number Diff line number Diff line change 1
1
import { FC } from 'react' ;
2
- import IconPlus from '@/assets/icons/IconPlus.tsx ' ;
2
+ import { IconPlus } from '@/assets/icons' ;
3
3
4
4
interface Props {
5
5
user_nickname : any ;
6
6
id : string ;
7
7
}
8
8
9
- const UserPlusList : FC < Props > = ( { user_nickname, id } ) => {
9
+ const UserInviteList : FC < Props > = ( { user_nickname, id } ) => {
10
10
return (
11
11
< li key = { id } className = "border-b" >
12
- < button className = "ju btn block flex w-full justify-between border-none bg-transparent" onClick = { onPlusClick } >
12
+ < button className = "ju btn block flex w-full justify-between border-none bg-transparent" onClick = { onClick } >
13
13
{ user_nickname }
14
14
< IconPlus />
15
15
</ button >
16
16
</ li >
17
17
) ;
18
18
} ;
19
19
20
- const onPlusClick = ( ) => {
21
- console . log ( 'aa' ) ;
22
- } ;
20
+ const onClick = ( ) => { } ;
23
21
24
- export default UserPlusList ;
22
+ export default UserInviteList ;
Original file line number Diff line number Diff line change
1
+ import { FC } from 'react' ;
2
+ import { IconClose , IconLeaf } from '@/assets/icons' ;
3
+ import DialogButton from './DialogButton' ;
4
+
5
+ interface Props {
6
+ user_nickname : any ;
7
+ id : any ;
8
+ }
9
+
10
+ const UserInvited : FC < Props > = ( { user_nickname, id } ) => {
11
+ return (
12
+ < li key = { id } >
13
+ < DialogButton
14
+ classname = { 'userInvite bg-white hover:bg-base-100 relative' }
15
+ name = {
16
+ < div >
17
+ < IconClose style = { 'absolute top-px right-px' } />
18
+ < IconLeaf />
19
+ < p > { user_nickname } </ p >
20
+ </ div >
21
+ }
22
+ title = { '' }
23
+ desc = { '해당 멤버를 삭제 하시겠습니까?' }
24
+ children = { '' }
25
+ />
26
+ </ li >
27
+ ) ;
28
+ } ;
29
+
30
+ export default UserInvited ;
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const router = createBrowserRouter([
48
48
element : < TextInputForm /> ,
49
49
} ,
50
50
{
51
- path : 'UserInvite ' ,
51
+ path : 'userInvite ' ,
52
52
element : < UserInvite /> ,
53
53
} ,
54
54
] ,
You can’t perform that action at this time.
0 commit comments