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] 랜딩 페이지 시작하기 버튼을 카카오톡 로그인 버튼으로 교체 #267

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/components/features/KakaoLoginButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const KakaoLoginButton = ({ ...props }: ComponentPropsWithoutRef<'a'>) =>
<KakaoButtonContainer {...props}>
<FlexBox flexDir="row" alignItems="center" justifyContent="center" gap={8}>
<Icon name="kakaotalk2" size={18} />
카카오톡으로 로그인
카카오 계정으로 시작하기
</FlexBox>
</KakaoButtonContainer>
);
Expand Down
28 changes: 12 additions & 16 deletions src/pages/Landing.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { Navigate, useNavigate } from 'react-router-dom';
import { Navigate } from 'react-router-dom';

import { FixedBottomButton as FBB } from '@/components/common/FixedBottomButton';
import { FlexBox } from '@/components/common/FlexBox';
import { Icon } from '@/components/common/Icon';
import { LandingContentLayout } from '@/components/common/LandingContentLayout';
import { Body1 } from '@/components/common/Typography';
import { KakaoLoginButton } from '@/components/features/KakaoLoginButton';
import { useAuth } from '@/hooks/useAuth';
import { ENV } from '@/lib/env';
import { colors } from '@/styles/global';

/**
* @description 랜딩 페이지는 로그인하지 않은 사용자에게만 보여짐
*/
export const Landing = () => {
const { isAuthenticated } = useAuth();
const navigate = useNavigate();

if (isAuthenticated) {
return <Navigate to="/meeting" />;
Expand Down Expand Up @@ -75,21 +75,17 @@ export const Landing = () => {
</Body1>
</FlexBox>

<FixedBottomButton onClick={() => navigate('/login')}>시작하기</FixedBottomButton>
<StyledKakaoLoginButton href={`${ENV.API_BASE_URL}/auth/oauth2/kakao?redirect=/meeting`} />
</FlexBox>
);
};

const FixedBottomButton = styled(FBB)`
position: sticky;
background-color: ${colors.WH};
color: ${colors.purple};
font-weight: 800;

@media (hover: hover) and (pointer: fine) {
&:hover:not(:disabled) {
background-color: ${colors.GY5};
color: ${colors.purple};
}
}
const StyledKakaoLoginButton = styled(KakaoLoginButton)`
position: fixed;
bottom: 20px;
left: auto;
right: auto;
width: 100%;
max-width: 390px;
z-index: 999;
`;
Loading