Skip to content

Commit

Permalink
feat(client): 프로필 카드 컴포넌트에 포트폴리오, 이력서, 깃허브 입력 유무 표시 (#386)
Browse files Browse the repository at this point in the history
* feat(client): 프로필 카드 컴포넌트에 포트폴리오, 이력서, 깃허브 입력 유무 표시

* feat(client): 아이콘 마다 툴팁 추가
  • Loading branch information
SEOKKAMONI committed Apr 30, 2024
1 parent b27bd7f commit 7fcfee2
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 36 deletions.
3 changes: 3 additions & 0 deletions apps/client/public/assets/svgs/github_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps/client/public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion apps/client/public/vercel.svg

This file was deleted.

8 changes: 1 addition & 7 deletions apps/client/src/components/common/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ const Header = () => {
{!isLoading && (
<Stack direction="horizontal" align="center" spacing={12}>
{user.isLogin && (
<StyledNotificationButtonWrapper>
<NotificationButton hasNotification={user.hasNotification} />
</StyledNotificationButtonWrapper>
<NotificationButton hasNotification={user.hasNotification} />
)}
{user.isLogin ? (
<Button onClick={handleLogout} styleType="ghost" size="small">
Expand Down Expand Up @@ -69,7 +67,3 @@ const StyledHeader = styled.div`
background-color: ${theme.colors.white};
`}
`;

const StyledNotificationButtonWrapper = styled.div`
position: relative;
`;
72 changes: 60 additions & 12 deletions apps/client/src/components/profile/ProfileCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import styled from '@emotion/styled';
import { Stack, Text } from '@sickgyun/ui';
import { IconReviewStarFill, IconStoryArticleFill } from '@seed-design/icon';
import { colors } from '@sickgyun/design-token';
import { Stack, Text, Tooltip } from '@sickgyun/ui';
import { useOverlay } from '@toss/use-overlay';
import Image from 'next/image';
import ProfileDetailModal from '../ProfileDetailModal';
import type { GetProfileListResponse } from '@/hooks/api/profile/useGetProfileList';
import { useLogAnalyticsEvent } from '@/libs/logging';
import type { Major } from '@/types/profile';

type ProfileCardProps = {
name: string;
imageUrl: string;
cardinal: number;
major: Major;
profileId: number;
userId: number;
company?: string;
introduction?: string;
};
type ProfileCardProps = Omit<GetProfileListResponse, 'id'>;

const ProfileCard = ({
name,
Expand All @@ -26,6 +19,9 @@ const ProfileCard = ({
userId,
company,
introduction,
githubId,
portfolioUrl,
resumeUrl,
}: ProfileCardProps) => {
const overlay = useOverlay();
const { logClickEvent } = useLogAnalyticsEvent();
Expand Down Expand Up @@ -68,13 +64,59 @@ const ProfileCard = ({
</Text>
</Stack>
</Stack>
<StyledProfilePresenceCheck direction="horizontal" align="center" spacing={8}>
{portfolioUrl && (
<Tooltip content="포트폴리오" placement="bottom-end">
{({ ref }) => {
return (
<IconReviewStarFill
ref={ref}
width={20}
height={20}
color={colors.gray400}
/>
);
}}
</Tooltip>
)}
{resumeUrl && (
<Tooltip content="이력서" placement="bottom-end">
{({ ref }) => {
return (
<IconStoryArticleFill
ref={ref}
width={20}
height={20}
color={colors.gray400}
/>
);
}}
</Tooltip>
)}
{githubId && (
<Tooltip content="깃허브" placement="bottom-end">
{({ ref }) => {
return (
<Image
ref={ref}
src="/assets/svgs/github_icon.svg"
width={20}
height={20}
alt="Github Logo"
/>
);
}}
</Tooltip>
)}
</StyledProfilePresenceCheck>
</StyledProfileCard>
);
};

export default ProfileCard;

const StyledProfileCard = styled.div`
position: relative;
transition: all 0.25s ease;
padding: 16px;
border-radius: 8px;
Expand All @@ -90,3 +132,9 @@ const StyledProfileImage = styled(Image)`
border-radius: 8px;
object-fit: cover;
`;

const StyledProfilePresenceCheck = styled(Stack)`
position: absolute;
right: 16px;
bottom: 16px;
`;
3 changes: 3 additions & 0 deletions apps/client/src/components/profile/ProfileList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ const ProfileList = ({ major, isRecruited, cardinal }: ProfileListProps) => {
userId={profile.userId}
company={profile.company}
introduction={profile.introduction}
portfolioUrl={profile.portfolioUrl}
githubId={profile.githubId}
resumeUrl={profile.resumeUrl}
/>
))}
</StyledProfileList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const StyledProfileNavigationBar = styled.div`
${({ theme }) => css`
border-bottom: 1px solid ${theme.colors.gray200};
background-color: ${theme.colors.white};
z-index: ${theme.zIndex.component3};
`}
`;

Expand Down
14 changes: 8 additions & 6 deletions apps/client/src/hooks/api/profile/useGetProfileList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export type GetProfileListParams = {

export type GetProfileListResponse = {
id: number;
userId: number;
name: string;
admissionYear: number;
imageUrl: string;
major: Major;
introduction: string;
company: string;
isRecruited: boolean;
cardinal: number;
major: Major;
profileId: number;
userId: number;
company?: string;
introduction?: string;
githubId?: string;
portfolioUrl?: string;
resumeUrl?: string;
};

export const PROFILE_LIST_QUERY_KEY = 'profileList';
Expand Down
16 changes: 7 additions & 9 deletions packages/ui/src/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ const Tooltip = ({
});

return (
<>
<PositionWrapper strategy={strategy}>
{children({
ref: refs.setReference,
onOpen: openTooltip,
referenceProps: getReferenceProps(),
})}
</PositionWrapper>
<PositionWrapper strategy={strategy}>
{children({
ref: refs.setReference,
onOpen: openTooltip,
referenceProps: getReferenceProps(),
})}
<StyledCSSTransition
nodeRef={transitionRef}
in={isOpen}
Expand All @@ -134,7 +132,7 @@ const Tooltip = ({
</StyledTooltipItem>
</StyledTooltipItemWrapper>
</StyledCSSTransition>
</>
</PositionWrapper>
);
};

Expand Down

0 comments on commit 7fcfee2

Please sign in to comment.