-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from 42Where/feature/tooltips
[#104] 툴팁 추가 및 타입, UX 개선 (Feature/tooltips)
- Loading branch information
Showing
27 changed files
with
2,073 additions
and
1,276 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,40 @@ | ||
import Group from '@/types/Group'; | ||
import Image from 'next/image'; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from '@/components/ui/tooltip'; | ||
import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu'; | ||
|
||
export default function GroupSettingBtn({ | ||
curGroup, | ||
groups, | ||
}: { | ||
curGroup: Group; | ||
groups: Group[]; | ||
}) { | ||
return !groups.find((group) => group.groupId === curGroup.groupId) | ||
?.isInEdit ? ( | ||
<DropdownMenuTrigger className='absolute size-10 rounded-lg flex justify-center items-center right-[50px] md:right-[64px] top-[8px] md:top-[16px] hover:bg-gray-200'> | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<Image | ||
src='/Icons/pencil.svg' | ||
alt='pencil' | ||
width={24} | ||
height={24} | ||
/> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p className='font-gsansMd text-[#4A6282] text-l lg:text-xl'> | ||
그룹 설정 | ||
</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
</DropdownMenuTrigger> | ||
) : null; | ||
} |
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,41 +1,57 @@ | ||
import { Button } from '../ui/button'; | ||
import React from 'react'; | ||
import User from '@/types/User'; | ||
import { User, SearchedUser } from '@/types/User'; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from '@/components/ui/tooltip'; | ||
|
||
export default function LocationBtn({ | ||
user, | ||
searchedUser, | ||
isMyProfile, | ||
}: { | ||
user: User; | ||
searchedUser?: any; | ||
user: SearchedUser | User; | ||
isMyProfile?: boolean; | ||
}) { | ||
const [location, setLocation] = React.useState<string>(''); | ||
React.useEffect(() => { | ||
if (searchedUser) { | ||
if (searchedUser.location) { | ||
setLocation(searchedUser.location); | ||
} else if (searchedUser.inOrOut || searchedUser.inCluster) { | ||
setLocation('개포'); | ||
} else { | ||
setLocation('퇴근'); | ||
} | ||
} else if (user.location) { | ||
if ('location' in user && user.location) { | ||
setLocation(user.location); | ||
} else if (user.inCluster || user.inOrOut) { | ||
} else if ( | ||
('inCluster' in user && user.inCluster) || | ||
('inOrOut' in user && user.inOrOut) | ||
) { | ||
setLocation('개포'); | ||
} else { | ||
setLocation('퇴근'); | ||
} | ||
}, [user, searchedUser]); | ||
}, [user]); | ||
return ( | ||
<Button | ||
className={`rounded-full ${ | ||
location !== '퇴근' | ||
? 'bg-[#132743]' | ||
: 'bg-white hover:bg-white text-[#132743] border-2 border-[#132743]' | ||
} h-6 md:h-8 px-2 md:px-3 md:text-xl font-gsansMd`} | ||
> | ||
{location} | ||
</Button> | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<Button | ||
className={`rounded-full | ||
${!isMyProfile && 'cursor-default'} | ||
${ | ||
location !== '퇴근' | ||
? 'bg-[#132743]' | ||
: 'bg-white hover:bg-white text-[#132743] border-2 border-[#132743]' | ||
} h-6 md:h-8 px-2 md:px-3 md:text-xl font-gsansMd`} | ||
> | ||
{location} | ||
</Button> | ||
</TooltipTrigger> | ||
{isMyProfile && ( | ||
<TooltipContent> | ||
<p className='font-gsansMd text-[#4A6282] text-l lg:text-xl'> | ||
내 위치 변경 | ||
</p> | ||
</TooltipContent> | ||
)} | ||
</Tooltip> | ||
</TooltipProvider> | ||
); | ||
} |
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,44 @@ | ||
import Cookies from 'js-cookie'; | ||
import { useRouter } from 'next/router'; | ||
import Image from 'next/image'; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from '@/components/ui/tooltip'; | ||
|
||
export default function LogoutBtn() { | ||
const router = useRouter(); | ||
return ( | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<div | ||
className='size-10 lg:size-14 rounded-lg flex justify-center items-center hover:bg-gray-200' | ||
role='button' | ||
tabIndex={0} | ||
onClick={() => { | ||
Cookies.remove('accessToken'); | ||
Cookies.remove('refreshToken'); | ||
router.push('/login'); | ||
}} | ||
> | ||
<Image | ||
src='/Icons/signOut.svg' | ||
alt='search' | ||
width={40} | ||
height={40} | ||
className='rounded-lg hover:bg-gray-200 lg:size-[40px] size-[30px]' | ||
/> | ||
</div> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p className='font-gsansMd text-[#4A6282] text-l lg:text-xl'> | ||
로그아웃 | ||
</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
); | ||
} |
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,30 @@ | ||
import Image from 'next/image'; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from '@/components/ui/tooltip'; | ||
|
||
export default function MySettingBtn() { | ||
return ( | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<Image | ||
src='/Icons/setting.svg' | ||
alt='setting' | ||
width={60} | ||
height={60} | ||
className='rounded-lg hover:bg-gray-200 lg:size-[60px] size-[50px] cursor-pointer' | ||
/> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p className='font-gsansMd text-[#4A6282] text-l lg:text-xl'> | ||
내 정보 설정 | ||
</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
); | ||
} |
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 @@ | ||
import Image from 'next/image'; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from '@/components/ui/tooltip'; | ||
|
||
export default function SearchBtn() { | ||
return ( | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<div | ||
className='size-10 lg:size-14 rounded-lg flex justify-center items-center hover:bg-gray-200' | ||
role='button' | ||
tabIndex={0} | ||
> | ||
<Image | ||
src='/Icons/search.svg' | ||
alt='search' | ||
width={40} | ||
height={40} | ||
className='rounded-lg hover:bg-gray-200 lg:size-[40px] size-[30px]' | ||
/> | ||
</div> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p className='font-gsansMd text-[#4A6282] text-l lg:text-xl'> | ||
유저 검색 | ||
</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
); | ||
} |
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
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
Oops, something went wrong.