Skip to content

Commit

Permalink
feat: Merge branch 'main' into feat/#1699
Browse files Browse the repository at this point in the history
  • Loading branch information
simeunseo committed Dec 19, 2024
2 parents 56f4eab + ad956a2 commit c5c76d5
Show file tree
Hide file tree
Showing 12 changed files with 318 additions and 84 deletions.
10 changes: 8 additions & 2 deletions src/components/auth/oauth/OAuthCallback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { FC, useEffect, useState } from 'react';
Expand Down Expand Up @@ -43,8 +42,15 @@ const OAuthCallback: FC<OAuthCallbackProps> = ({ url }) => {
}

if (!accessToken) {
lastUnauthorized.setPath(url.href);
const returnUrl = new URLSearchParams(window.location.search).get('returnUrl');

if (returnUrl) {
lastUnauthorized.setPath(decodeURIComponent(returnUrl));
} else {
lastUnauthorized.setPath(url.href);
}
location.href = playgroundLink.login();

return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/coffeechat/Banner/CoffeeChatLottie.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import dynamic from 'next/dynamic';

const Lottie = dynamic(() => import('react-lottie'), { ssr: false });
import styled from '@emotion/styled';
import dynamic from 'next/dynamic';

import Responsive from '@/components/common/Responsive';
import { LoggingClick } from '@/components/eventLogger/components/LoggingClick';
import mobilePC from '@/public/lottie/coffee_MO.json';
import coffeePC from '@/public/lottie/coffee_PC.json';
import { PCTA_MID_MEDIA_QUERY } from '@/styles/mediaQuery';

const Lottie = dynamic(() => import('react-lottie'), { ssr: false });

function CoffeeChatLottie() {
const defaultDesktopOptions = {
loop: true,
Expand Down
19 changes: 11 additions & 8 deletions src/components/coffeechat/detail/OpenerProfile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { fonts } from '@sopt-makers/fonts';
import { IconMail } from '@sopt-makers/icons';
import { useDialog } from '@sopt-makers/ui';
import Link from 'next/link';
import ProfileIcon from 'public/icons/icon-profile.svg';

import { useGetCoffeechatDetail } from '@/api/endpoint/coffeechat/getCoffeechatDetail';
Expand All @@ -11,7 +13,6 @@ import RegisterCoffeechatButton from '@/components/coffeechat/detail/RegisterCof
import ShowCoffeechatToggle from '@/components/coffeechat/detail/ShowCoffeechatToggle';
import useModalState from '@/components/common/Modal/useModalState';
import { MOBILE_MEDIA_QUERY } from '@/styles/mediaQuery';
import { useDialog } from '@sopt-makers/ui';

interface OpenerProfileProps {
memberId: string;
Expand Down Expand Up @@ -40,13 +41,15 @@ export default function OpenerProfile({ memberId }: OpenerProfileProps) {
<>
{openerProfile && (
<OpenerProfileSection isMine={!!openerProfile.isMine}>
<ProfileImageBox>
{openerProfile.profileImage ? (
<ProfileImage src={openerProfile.profileImage} alt='프로필 이미지' />
) : (
<ProfileIcon />
)}
</ProfileImageBox>
<Link href={"/members/"+memberId}>
<ProfileImageBox>
{openerProfile.profileImage ? (
<ProfileImage src={openerProfile.profileImage} alt='프로필 이미지' />
) : (
<ProfileIcon />
)}
</ProfileImageBox>
</Link>
<ProfileInfoBox>
<ProfileHeader>
<Name>{openerProfile.name}</Name>
Expand Down
2 changes: 1 addition & 1 deletion src/components/coffeechat/page/CoffeechatUploadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function CoffeechatUploadPage({ uploadType, form, onSubmit }: Cof
aside={
<ProgressBox
uploadType={uploadType}
myInfoInprogress={!!(watch('memberInfo.career') && watch('memberInfo.introduction'))}
myInfoInprogress={!!watch('memberInfo.career')}
coffeechatInfoInprogress={
!!(
watch('coffeeChatInfo.sections') &&
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import styled from '@emotion/styled';
import { colors } from '@sopt-makers/colors';
import { fonts } from '@sopt-makers/fonts';
import { IconCheck, IconChevronDown } from '@sopt-makers/icons';
import { Button } from '@sopt-makers/ui';
import { useEffect, useState } from 'react';

import { zIndex } from '@/styles/zIndex';

interface Option {
label: string;
value: string;
}

interface BottomSheetSelectProps {
options: Option[];
value: string | string[] | null | undefined;
placeholder: string;
onChange: (value: string) => void;
}
const BottomSheetSelect = ({ options, value, placeholder, onChange }: BottomSheetSelectProps) => {
const [open, setOpen] = useState(false);
const [selectedValue, setSelectedValue] = useState(value);
const [temporaryValue, setTemporaryValue] = useState(value);

const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);

const handleOptionSelect = (value: string) => {
setTemporaryValue(value);
};

const handleConfirm = () => {
setSelectedValue(temporaryValue);
if (temporaryValue !== '') onChange(temporaryValue as string);

handleClose();
};

useEffect(() => {
if (open) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = '';
}

return () => {
document.body.style.overflow = '';
};
}, [open]);

return (
<Container>
<InputField onClick={handleOpen}>
{selectedValue !== null ? <p>{selectedValue}</p> : <p style={{ color: '#808087' }}>{placeholder}</p>}
<IconChevronDown
style={{
width: 20,
height: 20,
transform: open ? 'rotate(-180deg)' : '',
transition: 'all 0.5s',
}}
/>
</InputField>

{open && (
<>
<Overlay onClick={handleClose} />
<BottomSheet>
<OptionList>
{options.map((option) => (
<OptionItem key={option.value} onClick={() => handleOptionSelect(option.value)}>
{option.label}
{temporaryValue === option.value && <CheckedIcon />}
</OptionItem>
))}
</OptionList>
<Button size='lg' style={{ width: '100%' }} onClick={handleConfirm}>
확인
</Button>
</BottomSheet>
</>
)}
</Container>
);
};
export default BottomSheetSelect;

const Container = styled.div`
position: relative;
width: 100%;
`;

const InputField = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 10px;
background-color: ${colors.gray800};
cursor: pointer;
padding: 11px 16px;
${fonts.BODY_16_M};
`;

const Overlay = styled.div`
position: fixed;
top: 0;
left: 0;
z-index: ${zIndex.헤더};
background-color: rgb(15 15 18 / 80%);
width: 100%;
height: 100%;
`;

const BottomSheet = styled.section`
position: fixed;
bottom: 0;
z-index: ${zIndex.헤더};
margin-bottom: 12px;
border-radius: 16px;
background-color: ${colors.gray800};
padding: 16px;
width: calc(100% - 40px);
`;

const OptionList = styled.ul`
margin: 0 0 16px;
padding: 0;
max-height: 300px;
overflow-y: auto;
list-style: none;
`;

const OptionItem = styled.li`
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 4px;
cursor: pointer;
padding: 10px;
height: 44px;
${fonts.BODY_14_M}
`;

const CheckedIcon = styled(IconCheck)`
width: 24px;
height: 24px;
color: ${colors.success};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function ChipField({ field, errorMessage, chipList, isSingleSelec
</Chip>
</Responsive>
<Responsive only='mobile'>
<Chip size='md' active={isActive(field, chip)}>
<Chip size='sm' active={isActive(field, chip)}>
{chip}
</Chip>
</Responsive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SelectV2, TextArea } from '@sopt-makers/ui';
import { Controller, useFormContext } from 'react-hook-form';

import { COFFEECHAT_MOBILE_MEDIA_QUERY } from '@/components/coffeechat/mediaQuery';
import BottomSheetSelect from '@/components/coffeechat/upload/CoffeechatForm/BottomSheetSelect';
import ChipField from '@/components/coffeechat/upload/CoffeechatForm/ChipField';
import {
COFFECHAT_SECTION,
Expand Down Expand Up @@ -83,12 +84,7 @@ export default function CoffeechatInfoForm() {
value={field.value ?? ''}
maxLength={1000}
fixedHeight={189}
lineBreakPlaceholder={[
'• PM과 서비스기획자로 일하는 방법',
'• 포트폴리오 준비 및 작성 노하우',
'• 직무 전환 시 준비할 것들',
'• 당근, 토스, 넥슨, 하나은행, LG전자 면접 후기',
]}
lineBreakPlaceholder={['• PM과 서비스 기획자로 일하는 방법', '• 앱잼 전 미리 준비하면 좋은 것']}
isError={!!errors.coffeeChatInfo?.topic}
errorMessage={errors.coffeeChatInfo?.topic?.message}
onChange={(e) => field.onChange(e.target.value)}
Expand All @@ -100,12 +96,7 @@ export default function CoffeechatInfoForm() {
value={field.value ?? ''}
maxLength={1000}
fixedHeight={176}
lineBreakPlaceholder={[
'• PM과 서비스기획자로 일하는 방법',
'• 포트폴리오 준비 및 작성 노하우',
'• 직무 전환 시 준비할 것들',
'• 당근, 토스, 넥슨, 하나은행, LG전자 면접 후기',
]}
lineBreakPlaceholder={['• PM과 서비스 기획자로 일하는 방법', '• 앱잼 전 미리 준비하면 좋은 것']}
isError={!!errors.coffeeChatInfo?.topic}
errorMessage={errors.coffeeChatInfo?.topic?.message}
onChange={(e) => field.onChange(e.target.value)}
Expand All @@ -124,23 +115,33 @@ export default function CoffeechatInfoForm() {
name='coffeeChatInfo.meetingType'
control={control}
render={({ field }) => (
<div {...field}>
<SelectV2.Root
type='text'
visibleOptions={3}
defaultValue={MEETING_TYPE_OPTIONS.find((option) => option.value === field.value)}
onChange={(value) => field.onChange(value)}
>
<SelectV2.Trigger>
<SelectV2.TriggerContent placeholder={'진행 방식 선택'} />
</SelectV2.Trigger>
<SelectV2.Menu>
{MEETING_TYPE_OPTIONS.map((option) => (
<SelectV2.MenuItem key={option.value} option={option} />
))}
</SelectV2.Menu>
</SelectV2.Root>
</div>
<>
<Responsive only='desktop' {...field}>
<SelectV2.Root
type='text'
visibleOptions={3}
defaultValue={MEETING_TYPE_OPTIONS.find((option) => option.value === field.value)}
onChange={(value) => field.onChange(value)}
>
<SelectV2.Trigger>
<SelectV2.TriggerContent placeholder={'진행 방식 선택'} />
</SelectV2.Trigger>
<SelectV2.Menu>
{MEETING_TYPE_OPTIONS.map((option) => (
<SelectV2.MenuItem key={option.value} option={option} />
))}
</SelectV2.Menu>
</SelectV2.Root>
</Responsive>
<Responsive only='mobile' {...field}>
<BottomSheetSelect
options={[...MEETING_TYPE_OPTIONS]}
value={field.value}
placeholder='진행 방식 선택'
onChange={(value) => field.onChange(value)}
/>
</Responsive>
</>
)}
/>
</FormItem>
Expand Down
Loading

0 comments on commit c5c76d5

Please sign in to comment.