Skip to content
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

feat: home-yls #220

Merged
merged 7 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/home/components/QuickLink/QuickLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';

import { LogClick } from '@yourssu/logging-system-react';

import { useGetUserData } from '@/home/hooks/useGetUserData.ts';

interface QuickLinkProps {
icon: { icon: string; link: string };
order: string;
children: React.ReactElement;
}

export const QuickLink = ({ icon, order, children }: QuickLinkProps) => {
const { data: currentUser } = useGetUserData();
const userId = currentUser?.email || '';

const logParams = {
userId,
version: 1,
event: {
platform: 'web',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YLS 문서 보시면 timestamp랑 platform은 yls 내부에서 처리한다고 적혀있는데, 요렇게 platform 또 넣어줄 필요 없어용

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헙 yls 문서 잘못 보고 event쪽은 다 직접 처리 하는 것으로 착각했네요 수정하겠습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name: 'quickLinkItemClicked',
screen: 'Home',
params: {
link: icon.link,
order,
},
},
};

return <LogClick params={logParams}>{children}</LogClick>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BlogIcon from '@/assets/home/blog.svg';
import BrunchIcon from '@/assets/home/brunch.svg';
import InstagramIcon from '@/assets/home/instagram.svg';
import PpussungIcon from '@/assets/home/ppussung.svg';
import { QuickLink } from '@/home/components/QuickLink/QuickLink.tsx';

import { StyledIcon, StyledIconContainer, StyledLine } from './SocialNetworkService.style';

Expand All @@ -23,7 +24,9 @@ export const SocialNetworkService = () => {
<StyledIconContainer>
{ICON_LIST.map((icon, index) => (
<React.Fragment key={icon.icon}>
<StyledIcon to={icon.link} $image={icon.icon} />
<QuickLink icon={icon} order={String(index + 1)}>
<StyledIcon to={icon.link} $image={icon.icon} />
</QuickLink>
{ICON_LIST.length !== index + 1 && <StyledLine />}
</React.Fragment>
))}
Expand Down