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

๐Ÿšจ Hotfix: QA 1์ฐจ ๋ฐ˜์˜ #37

Merged
merged 2 commits into from
Nov 25, 2022
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
8 changes: 8 additions & 0 deletions src/application/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ export const getSrcByType = (content: Scrap | Category) => {
return content.file_url;
}
};

export const getValidURL = (url: string) => {
try {
return new URL(url);
} catch (err) {
return '';
}
};
4 changes: 2 additions & 2 deletions src/application/utils/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export const MAGAZINE_THUMBNAILS = [0, 0, 0, 0].map(() => ({
}));

export const PROFILE = {
src: '/picture/mock.png',
src: '',
name: '์ต๋ช…',
date: '2022.11.26',
description: '์ง„์ •ํ•œ ๋‚˜์˜ ๋ชจ์Šต์„ ๋‹ด์€ ๋‚˜๋งŒ์˜ ๋ฐ”์ด๋ธ”',
hashtags: ['#ํฌํด์šฉ๋„', '#์ž๋ฃŒ๋ชจ์Œ', '#ํŒจ์…˜ํ”ผํ”Œ'],
hashtags: ['#๋‰ด๋น„', '#์ž๋ฃŒ๋ชจ์Œ', '#ํŒจ์…˜ํ”ผํ”Œ'],
};

export const MEMO = `์‚ฌ๋žŒ์—๊ฒŒ๋Š” ์ €๋งˆ๋‹ค์˜ ๋ฐ”๋‹ค๊ฐ€ ์žˆ๊ณ  ์‚ฌ๋žŒ์—๊ฒŒ๋Š” ์ €๋งˆ๋‹ค์˜ ํŒŒ๋„๊ฐ€ ์žˆ๊ธฐ ๋งˆ๋ จ์ด์ง€. ์šฐ๋ฆฌ๋Š” ํ•œ๋‚ฑ ์‚ฌ๋žŒ์ด๋ผ์„œ ์ผ๋ ์˜€๊ณ  ๊ณ ์ž‘ ์‚ฌ๋žŒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ธ€์ฝ์ผ ์ˆ˜๋ฐ–์—๋Š” ์—†์—ˆ๋˜ ๊ฑฐ์•ผ. ์šฐ๋ฆฌ๋Š” ์„œ๋กœ ๋ชจ๋“  ์ด๋“ค์—๊ฒŒ ํƒ€์ธ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‚ด๋ฆฌ๋Š” ๋น„์— ์˜ท๊นƒ์„ ์ –์–ด์•ผ ํ–ˆ์œผ๋ฉฐ ๊ทธ๋งˆ์ €๋„ ์‚ฌ๋žŒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ทธ ๋น—์†์„ ์™ธ๋กœ์ด ๊ฑธ์„ ์ˆ˜ ๋ฐ–์— ์—†์—ˆ๋˜ ๊ฑฐ์•ผ.
Expand Down
28 changes: 16 additions & 12 deletions src/components/category/List/CategoryContentListMultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@ interface Props extends Partial<Category> {
const CategoryContentListMultiSelect = ({ name, id = 0, onSubmit }: Props) => {
const { categories: scraps, fetchNextPage } = useGetContentByCategory({ id });

const pickSet = useRef(new Set<EditPage>());
const pickSet = useRef(new Set<number>());
const ref = useIntersectionObserver({ callback: fetchNextPage });
const { replace } = useToast();

return (
<form
onSubmit={(e) => {
e.preventDefault();
pickSet.current.size && onSubmit?.(Array.from(pickSet.current));
pickSet.current.size &&
onSubmit?.(
Array.from(pickSet.current).map((id) => ({
scrap_id: scraps[id].id,
text: '',
src: getSrcByType(scraps[id]),
placeholder: scraps[id].content,
})),
);
}}
>
<span
Expand Down Expand Up @@ -62,30 +70,26 @@ const CategoryContentListMultiSelect = ({ name, id = 0, onSubmit }: Props) => {
padding-bottom: 10px;
`}
>
{scraps.map((scrap) => (
{scraps.map((scrap, idx) => (
<Photo
custom={css`
aspect-ratio: 1/1;
`}
onClick={() =>
pickSet.current.add({
scrap_id: scrap.id,
src: getSrcByType(scrap),
text: '',
placeholder: scrap.content,
})
}
onClick={() => {
pickSet.current.has(idx) ? pickSet.current.delete(idx) : pickSet.current.add(idx);
}}
key={scrap.id}
blur={<PhotoSelect enabled />}
src={getSrcByType(scrap)}
text={scrap.content}
/>
))}
์ค‘
<span ref={ref} />
</div>
</div>

<ActiveButton active>๋‹ค์Œ </ActiveButton>
<ActiveButton active>๋‹ค์Œ</ActiveButton>
</form>
);
};
Expand Down
3 changes: 0 additions & 3 deletions src/components/common/Navigation/BottomNavigationBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const BottomNavigationBase = ({ children }: BottomNavigationBaseProps) => {
max-width: 440px;
padding-top: 12px;
box-shadow: 0px -10px 20px rgba(0, 0, 0, 0.03);
@supports (padding-bottom: env(safe-area-inset-bottom)) {
padding-bottom: env(safe-area-inset-bottom);
}
`}
>
{children(({ ...rest }: ButtonHTMLAttributes<HTMLButtonElement>) => (
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/Photo/RoundPhoto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ const RoundPhoto = ({ src, width, height, custom }: RoundPhotoProps) => {
return (
<span
css={[
css`
(theme) => css`
position: relative;
overflow: hidden;
border-radius: 50%;
width: ${width};
height: ${height};
background: ${theme.color.gray10};
`,
custom,
]}
Expand Down
2 changes: 1 addition & 1 deletion src/components/magazine/MagazineList/MainMagazine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const MainMagazine = ({ magazines }: MainMagazineProps) => {
overflow-x: scroll;
width: 100%;
gap: 10px;
margin-bottom: 48px;
margin-bottom: 5vh;
`}
>
{magazines.map((magazine) => (
Expand Down
7 changes: 5 additions & 2 deletions src/components/magazine/NoMagazine/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@ const NoMagazine = () => {
<div
css={(theme) => css`
display: flex;
padding-top: 2vh;
flex-direction: column;
flex: 1;
justify-content: center;
align-items: center;
height: 155px;
gap: 20px;
${theme.font.M_POINT_14};
color: ${theme.color.gray06};
`}
>
<span
css={css`
position: relative;
transform: translateX(-4px);
height: 10vh;
width: 155px;
`}
>
<Image src={'/picture/warn.svg'} width={63} height={85} />
<Image src={'/picture/warn.svg'} layout="fill" objectFit={'contain'} />
</span>
<span>์ €์žฅ๋œ ๋งค๊ฑฐ์ง„์ด ์—†์Šต๋‹ˆ๋‹ค</span>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/scrap/UploadButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const UploadButton = () => {
padding: 12px 18px;
justify-content: space-between;
align-items: center;
color: ${theme.color.black02};
${theme.font.R_BODY_13};
line-height: 1;
`}
Expand Down
9 changes: 7 additions & 2 deletions src/containers/AppLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ const CSSWrapper = css`
min-height: 100vh;
display: flex;
justify-content: center;

@supports (-webkit-touch-callout: none) {
//noinspection CssInvalidPropertyValue
min-height: -webkit-fill-available;
}
`;

const CSSAppLayout = (isBlack: boolean) => (theme: Theme) =>
Expand Down Expand Up @@ -62,10 +67,10 @@ const CSSSideBanner = css`
left: 5%;
}
@media screen and (max-width: 1150px) {
left: 0%;
left: 0;
}
@media screen and (max-width: 1000px) {
width: 0%;
width: 0;
}

position: fixed;
Expand Down
3 changes: 1 addition & 2 deletions src/containers/ErrorBoundary/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const StyledWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
padding: 24px 16px;
height: 100vh;
height: 100%;
`;

const StyledTitle = styled.b`
Expand Down
7 changes: 6 additions & 1 deletion src/containers/magazine/PageViewContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Image from 'next/image';
import Link from 'next/link';
import React from 'react';

import { getValidURL } from '@/application/utils/helper';
import { PAGES } from '@/application/utils/mock';
import Photo from '@/components/common/Photo';

Expand All @@ -23,7 +24,11 @@ const PageViewContainer = ({ pages = PAGES }: Props) => {
<ol css={CSSCarouselContainer}>
{pages.map((page, idx) => (
<li key={page.page_id} id={`${idx}`} css={CSSCarouselItem}>
<Photo src={page.file_url || page.contents} height={'45vh'} />
<Photo
src={page.file_url || getValidURL(page.contents).toString()}
text={page.contents}
height={'45vh'}
/>
<p css={CSSPageContent}>{page.text}</p>
<div css={CSSSnapper} />
<div css={CSSCarouselHandle}>
Expand Down
13 changes: 8 additions & 5 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@ const App = ({ Component, pageProps }: AppProps<PageProps>) => {
<>
<Head>
<title>ํ”ผํฌ๋žฉ | pickRAP</title>
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1.0, user-scalable=0,viewport-fit=cover"
/>
</Head>
<QueryClientProvider hydrateState={pageProps.hydrateState}>
<RecoilRoot initializeState={recoilInitializer}>
<ToastProvider>
<ThemeProvider theme={theme}>
<GlobalStyle />
<ErrorBoundary fallback={ErrorPage}>
<AppLayout blackBackground={['/']}>
<AppLayout blackBackground={['/']}>
<ErrorBoundary fallback={ErrorPage}>
<Component {...pageProps} />
</AppLayout>
</ErrorBoundary>
</ErrorBoundary>
</AppLayout>
<ToastPortal />
</ThemeProvider>
</ToastProvider>
Expand Down
36 changes: 18 additions & 18 deletions src/pages/auth/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,31 @@ const SignIn: NextPage = () => {
}
};
return (
<>
<div
css={css`
display: flex;
height: 100%;
flex-direction: column;
justify-content: center;
`}
>
<div
css={css`
width: 100%;
display: flex;
flex-direction: column;
position: relative;
height: 60%;
//padding-top: 6vh;
`}
>
<div
<span
css={css`
height: 119px;
text-align: center;
margin-bottom: 40px;
`}
/>
<Image src={'/logo/black_pickrap.svg'} width={164} height={39} priority />
<div
css={css`
height: 50px;
`}
/>
>
<Image src={'/logo/black_pickrap.svg'} width={164} height={39} priority />
</span>

<AuthForm onSubmit={handleSubmit} errFormMsg={errMsg}>
<AuthForm.Input name={'email'} placeholder={'์•„์ด๋”” ๋˜๋Š” ์ด๋ฉ”์ผ'} value={email} handleChange={handleEmail} />
Expand All @@ -66,11 +70,7 @@ const SignIn: NextPage = () => {
value={password}
handleChange={handlePassword}
/>
<span
css={css`
height: 8px;
`}
/>

<CheckBox checked>์ž๋™ ๋กœ๊ทธ์ธ</CheckBox>
<span
css={css`
Expand Down Expand Up @@ -112,16 +112,16 @@ const SignIn: NextPage = () => {
css={css`
width: 100%;
display: flex;
height: 33%;
flex-direction: column-reverse;
position: relative;
gap: 12px;
margin-top: 8vh;
`}
>
<NaverButton />
<KakaoButton />
</div>
</>
</div>
);
};

Expand Down
19 changes: 10 additions & 9 deletions src/pages/auth/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,23 @@ const SignUp: NextPage = () => {
}
};
return (
<>
<div
css={css`
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
`}
>
<div
css={css`
height: 55%;
width: 100%;
display: flex;
flex-direction: column;
position: relative;
padding-bottom: 10vh;
`}
>
<div
css={css`
margin-top: 63px;
`}
></div>
<div>
<AuthForm errInput={errInput} onSubmit={handleSubmit} errFormMsg={errForm}>
<AuthForm.Input
Expand Down Expand Up @@ -108,7 +110,6 @@ const SignUp: NextPage = () => {
<div
css={css`
width: 100%;
height: 30%;
display: flex;
flex-direction: column-reverse;
position: relative;
Expand All @@ -118,7 +119,7 @@ const SignUp: NextPage = () => {
<NaverButton />
<KakaoButton />
</div>
</>
</div>
);
};

Expand Down
3 changes: 1 addition & 2 deletions src/pages/magazine/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ const ShowMagazine: NextPage = () => {
setMagazineInfo({
...magazine,
start_number: (magazine?.page_list.length || 0) + 2,
page_list:
magazine?.page_list.map((m) => ({ src: m.file_url || m.contents, text: m.text, scrap_id: m.page_id })) || [],
page_list: magazine?.page_list.map((m) => ({ src: m.file_url, text: m.text, scrap_id: m.page_id })) || [],
});
router.push(`/magazine/edit/${id}`);
},
Expand Down
9 changes: 5 additions & 4 deletions src/pages/magazine/upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { css } from '@emotion/react';
import type { NextPage } from 'next';
import Image from 'next/image';
import { useRouter } from 'next/router';
import React, { useMemo, useState } from 'react';
import React, { useMemo } from 'react';

import { useSaveMagazine } from '@/application/hooks/api/magazine';
import useToast from '@/application/hooks/common/useToast';
Expand Down Expand Up @@ -36,9 +36,10 @@ const UploadMagazine: NextPage = () => {
const resetEditPage = useEditPageReset();

const handleBack = () => {
router.replace('/magazine');
resetMagazineInfo();
resetEditPage();
router.replace('/magazine').then(() => {
resetMagazineInfo();
resetEditPage();
});
};

const handleComplete = () => {
Expand Down
Loading