Skip to content

Commit

Permalink
Merge pull request #178 from Team-TIFY/dev
Browse files Browse the repository at this point in the history
[Deploy]: QA 2차 빌드
  • Loading branch information
eugene028 authored Nov 26, 2023
2 parents 97fcc31 + 3085da4 commit a0158ec
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 93 deletions.
138 changes: 74 additions & 64 deletions src/components/atoms/Navigationbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,71 +1,93 @@
import styled from '@emotion/styled'
import { theme } from '@styles/theme'
import { useNavigate } from 'react-router-dom'
import { useState, useRef } from 'react'
import { useState } from 'react'
import { Text } from '../Text'
import Svg from '../Svg'
import NavigationMy from '@assets/icons/NavigationMy'
import NavigationToday from '@assets/icons/NavigationToday'
import NavigationFriends from '@assets/icons/NavigationFriends'
import { motion } from 'framer-motion'
import { useLocation } from 'react-router-dom'

export const Navigationbar = () => {
const navigate = useNavigate()
const [select, setSelect] = useState<number>(1)
const navRef = useRef<any>([])
const { pathname } = useLocation()
const [selected, setSelect] = useState<number>(
pathname === '/' ? 1 : pathname === '/profile' ? 2 : 0,
)
const navigationData = [
{
title: '프렌즈',
url: '/friends',
icon: <NavigationFriends />,
},
{
title: '위클리',
url: '/',
icon: <NavigationToday />,
},
{
title: '마이',
url: '/profile',
icon: <NavigationMy />,
},
]
const handleClick = (index: number) => {
if (select === index) return
navRef.current[select].classList.remove('active')
navRef.current[select].classList.add('active')
setSelect(index)
}

return (
<NavContainer>
<Wrapper>
<NavBorder select={select} />
<NavBtn
className={select === 0 ? 'active' : ''}
onClick={() => {
handleClick(0)
navigate('/friends')
}}
ref={(elem) => (navRef.current[0] = elem)}
>
<Svg children={<NavigationFriends />} />
<Text className="text" typo="Caption_10" color="purple_200">
프렌즈
</Text>
</NavBtn>
<NavBtn
className={select === 1 ? 'active' : ''}
onClick={() => {
handleClick(1)
navigate('/')
}}
ref={(elem) => (navRef.current[1] = elem)}
>
<Svg children={<NavigationToday />} />
<Text className="text" typo="Caption_10" color="purple_200">
위클리
</Text>
</NavBtn>
<NavBtn
className={select === 2 ? 'active' : ''}
onClick={() => {
handleClick(2)
navigate('/profile')
}}
ref={(elem) => (navRef.current[2] = elem)}
>
<Svg children={<NavigationMy />} />
<Text className="text" typo="Caption_10" color="purple_200">
마이
</Text>
</NavBtn>
{navigationData.map((data, index) => {
return (
<NavBtn
key={index}
onClick={() => {
handleClick(index)
navigate(data.url)
}}
>
<NavBorder
initial={{ opacity: 0, x: 0 }}
animate={{
opacity: index === selected ? 1 : 0,
}}
transition={{ duration: 0.5 }}
/>
<Svg
children={data.icon}
style={{
paddingBottom: `${index === selected ? '30px' : '0px'}`,
zIndex: '30',
}}
/>
<motion.div
initial={{ opacity: 1, x: 0 }}
style={{
bottom: '7px',
position: 'absolute',
display: `${selected === index ? 'block' : 'none'}`,
}}
whileTap={{ scale: 1.2 }}
animate={{
opacity: index === selected ? 1 : 0,
x: index === selected ? 0 : selected < index ? -54 : +54,
}}
transition={{ duration: 0.5 }}
>
<Text className="text" typo="Caption_10" color="purple_200">
{navigationData[selected].title}
</Text>
</motion.div>
</NavBtn>
)
})}
</Wrapper>
</NavContainer>
)
}

const NavContainer = styled.nav`
position: absolute;
bottom: 40px;
Expand All @@ -89,12 +111,6 @@ const Wrapper = styled.div`
border: 1px solid ${theme.palette.gray_800};
filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.12))
drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.24));
.active {
padding-bottom: 10px;
& > h1 {
display: block;
}
}
`
const NavBtn = styled.button`
cursor: pointer;
Expand All @@ -104,22 +120,16 @@ const NavBtn = styled.button`
justify-content: center;
align-items: center;
border-radius: 50%;
position: relative;
background-color: transparent;
& .text {
display: none;
}
`

const NavBorder = styled.div<{ select: number }>`
const NavBorder = styled(motion.div)`
position: absolute;
width: 45px;
height: 35px;
border-radius: 50% 50% 0px 0px;
width: 52px;
height: 52px;
border-radius: 50%;
background-color: ${theme.palette.background};
border-top: 1px solid ${theme.palette.gray_800};
margin-bottom: 30px;
filter: drop-shadow(0px 0px 0px rgba(0, 0, 0, 0.24));
left: 27px;
left: ${({ select }) => 25 + select * 52.5}px;
top: -12px;
`
40 changes: 27 additions & 13 deletions src/components/atoms/RoundButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Text } from '../Text'
import Loading from '@components/atoms/Loading'
import { FlexBox } from '@components/layouts/FlexBox'
import Svg from '../Svg'
import { useState } from 'react'
import RightChevron from '@assets/icons/RightChevron'

type ButtonVariant =
Expand Down Expand Up @@ -141,8 +142,10 @@ export const RoundButton = ({
fullWidth = false,
width,
isLoading,
onClick,
...props
}: Props) => {
const [isClicked, setIsClicked] = useState(false)
const renderRoundButton = () => {
if (variant === 'xlargeRound') {
return (
Expand Down Expand Up @@ -178,31 +181,40 @@ export const RoundButton = ({
)
} else {
return (
<>
<Text typo={`${BUTTON_SHAPE_TYPE[variant].typo}`} as="span">
<FlexBox>{children}</FlexBox>
</Text>
</>
<Text typo={`${BUTTON_SHAPE_TYPE[variant].typo}`} as="span">
<FlexBox>{children}</FlexBox>
</Text>
)
}
}

return (
<StyledButton
width={width}
variant={variant}
fullWidth={fullWidth}
{...props}
>
{isLoading ? <Loading /> : renderRoundButton()}
</StyledButton>
<>
<StyledButton
width={width}
variant={variant}
fullWidth={fullWidth}
isClicked={isClicked}
onClick={(e) => {
if (onClick) onClick()
setIsClicked(true)
setTimeout(() => {
setIsClicked(false)
}, 1000) // 1초 후 isClicked를 false로 설정하여 원래 크기로 돌아가도록 합니다.
}}
{...props}
>
{isLoading ? <Loading /> : renderRoundButton()}
</StyledButton>
</>
)
}

const StyledButton = styled.button<{
variant: ButtonVariant
width?: number
fullWidth?: boolean
isClicked?: boolean
}>`
display: flex;
justify-content: center;
Expand All @@ -222,6 +234,8 @@ const StyledButton = styled.button<{
background-color: ${({ variant }) => `${BUTTON_COLOR_TYPE.default[variant]}`};
border-radius: ${({ variant }) => `${BUTTON_SHAPE_TYPE[variant].radius}px`};
color: ${({ variant }) => `${TEXT_COLOR_TYPE.default[variant]}`};
transform: ${({ variant, isClicked }) =>
variant === 'mediumRound' ? (isClicked ? 'scale(1.2)' : 'scale(1)') : ''};
&:hover {
background-color: ${({ variant }) => `${BUTTON_COLOR_TYPE.hover[variant]}`};
Expand Down
1 change: 0 additions & 1 deletion src/components/atoms/Tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ interface TagProps {
}

export const Tag = ({ index, children }: TagProps) => {
console.log(index)
return (
<Wrapper
variant={TAG_COLOR_TYPE[index].variant}
Expand Down
4 changes: 3 additions & 1 deletion src/components/funnel/OneAnswerStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const OneAnswerStep = ({
)
const [answer, setAnswer] = useState<string>('')
const [step, setStepAnswer] = useRecoilState(answerState)

const [disabled, setDisabled] = useState<boolean>(true)
const handleAnswerValue = (e: React.MouseEvent<HTMLButtonElement>) => {
setDisabled(false)
setAnswer(e.currentTarget.value)
}
const submitAnswer = () => {
Expand Down Expand Up @@ -99,6 +100,7 @@ const OneAnswerStep = ({
style={{ position: 'absolute', bottom: '32px' }}
variant="mediumRound"
onClick={submitAnswer}
disabled={disabled}
>
다음
</RoundButton>
Expand Down
1 change: 1 addition & 0 deletions src/libs/hooks/useAuthMutate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const useAuthMutate = ({ idToken }: KakaoCodeResponse) => {
accessToken: loginData.accessToken,
userProfile: {
id: loginData.userId,
email: data.email,
userId: data.userId,
userName: data.userName,
imageUrl: data.thumbnail,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/home/Redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export const Redirect = () => {

const kakaoTokenMutation = useMutation(AuthApi.KAKAO_TOKEN, {
onSuccess: (data: KakaoCodeResponse) => {
console.log(data.idToken)
console.log(data.accessToken)
setToken(data)
},
})
Expand Down
1 change: 0 additions & 1 deletion src/pages/onboarding/details/selectInfo/SelectFavor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export function SelectFavor() {
const gotoReg = () => {
if (btnColor) {
const { favor, ...rest } = info
console.log(auth.userProfile)
OnboardingApi.PUT_ONBOARD_STATUS({
userId: auth.userProfile.id,
data: rest,
Expand Down
4 changes: 0 additions & 4 deletions src/pages/profile/EditUserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ const EditUserInfo = () => {

const { parseDate, getFormattedDate } = useGetDate()

useEffect(() => {
console.log(info.birth)
}, [info.birth])

useEffect(() => {
if (!profileStateData.isEdit) {
setUserName(auth.userProfile.userName)
Expand Down
4 changes: 0 additions & 4 deletions src/pages/searchTaste/BFMOI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ const BFMOI = () => {
setStepAnswer({ ...step, categoryName: 'BFMOI' })
}, [])

useEffect(() => {
console.log(step)
}, [step])

return (
<Funnel>
<Funnel.Step name="MultiAnswer1">
Expand Down
1 change: 0 additions & 1 deletion src/pages/settingPage/WriteForCustomer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ const WriteForCustomer = () => {
// 문의접수 api 호출해서 의견 넘기기
}
}
console.log(showOptions)

useEffect(() => {
if (isWritten.content && isWritten.title && isWritten.email) {
Expand Down
1 change: 0 additions & 1 deletion src/utils/apis/user/UserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const UserApi = {
const response = await axiosApi.get(
`/users/${userId}/tags?smallCategory=${smallCategory}`,
)
console.log(response.data)
return response.data.data
},

Expand Down
2 changes: 1 addition & 1 deletion src/utils/apis/user/UserType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export type SelectedProps = {
active: boolean
name: SubCategoryName
value: SubCategoryType
count: number
count?: number
}[]

export interface UserNewTasteCategory {
Expand Down

0 comments on commit a0158ec

Please sign in to comment.