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

채팅방 버그 수정 #575

Merged
merged 12 commits into from
Sep 26, 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
155 changes: 155 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"typescript": "^5.5.3",
"undici": "^6.19.5",
"webpack": "^5.92.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
},
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export default function App() {

useEffect(() => {
window.addEventListener('beforeunload', removeInviteCode);

return window.removeEventListener('beforeunload', removeInviteCode);
});
return () => {
window.removeEventListener('beforeunload', removeInviteCode);
};
}, []);

return (
<ThemeProvider theme={theme}>
Expand Down
Binary file removed frontend/src/common/assets/default_profile.png
Binary file not shown.
Binary file not shown.
Binary file removed frontend/src/common/assets/regret_cat.png
Binary file not shown.
Binary file added frontend/src/common/assets/regret_cat.webp
Binary file not shown.
9 changes: 0 additions & 9 deletions frontend/src/common/font.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import pretendardMediumWoff2 from './assets/fonts/woff2-subset/Pretendard-Medium
import pretendardRegularWoff2 from './assets/fonts/woff2-subset/Pretendard-Regular.subset.woff2';
import pretendardSemiboldWoff2 from './assets/fonts/woff2-subset/Pretendard-SemiBold.subset.woff2';
import pretendardThinWoff2 from './assets/fonts/woff2-subset/Pretendard-Thin.subset.woff2';
import pretendardVariableWoff2 from './assets/fonts/woff2/PretendardVariable.woff2';

const fonts = css`
@font-face {
Expand Down Expand Up @@ -76,14 +75,6 @@ const fonts = css`
font-display: swap;
src: url(${pretendardThinWoff2}) format('woff2');
}

@font-face {
font-family: 'Pretendard Variable';
font-weight: 45 920;
font-style: normal;
font-display: swap;
src: url(${pretendardVariableWoff2}) format('woff2-variations');
}
`;

export default fonts;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as S from './MissingFallback.style';

import { SerializedStyles, useTheme } from '@emotion/react';

import regretCat from '@_common/assets/regret_cat.png';
import regretCat from '@_common/assets/regret_cat.webp';

interface MissingFallbackProps {
text: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/UserPreview/UserPreview.style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react';
import defaultProfile from '@_common/assets/default_profile.png';
import defaultProfile from '@_common/assets/empty_profile.svg?url';

export const preview = ({
imageUrl,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.gif';
declare module '*.webp';
declare module '*.woff2' {
const src: string;
export default src;
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<meta property="og:site_name" content="모우다" />

<meta name="apple-mobile-web-app-title" content="모우다" />
<meta
name="viewport"
content="width=device-width, initial-scale= 1.0, viewport-fit=cover"
/>
<meta property="al:android:app_name" content="모우다" />
<meta http-equiv="Cache-Control" content="no-cache" />
</head>
Expand Down
26 changes: 16 additions & 10 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,28 @@ if (process.env.NODE_ENV === 'production' && process.env.SENTRY_DSN) {
});
}

async function enableMocking() {
if (process.env.MSW !== 'true') {
return;
const enableMocking = async () => {
if (process.env.NODE_ENV === 'development' && process.env.MSW === 'true') {
const { worker } = await import('./mocks/browser');
await worker.start();
}
};

const { worker } = await import('./mocks/browser');

return worker.start();
}

enableMocking().then(() => {
const renderApp = () => {
const rootElement = document.getElementById('root') as HTMLElement;
const root = createRoot(rootElement);

root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
});
};

// MSW가 개발 환경에서만 동작하도록 설정하고, 앱을 렌더링
const init = async () => {
await enableMocking();
renderApp();
};

init();
11 changes: 1 addition & 10 deletions frontend/src/layouts/ChattingRoomLayout/ChattingRoomLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as S from './ChattingRoomLayout.style';
import ChattingRoomFooter from './ChattingRoomFooter/ChattingRoomFooter';
import { PropsWithChildren } from 'react';
import StickyTriSectionHeader from '@_layouts/components/StickyTriSectionHeader/StickyTriSectionHeader';
import { useTheme } from '@emotion/react';

function ChattingRoomLayout(props: PropsWithChildren) {
const { children } = props;
Expand All @@ -19,15 +18,7 @@ function Header(props: PropsWithChildren) {

Header.Left = StickyTriSectionHeader.Left;
Header.Right = StickyTriSectionHeader.Right;
Header.Center = function Center(props: PropsWithChildren) {
const { children } = props;
const theme = useTheme();
return (
<StickyTriSectionHeader.Center>
<div css={S.headerCenter({ theme })}>{children}</div>
</StickyTriSectionHeader.Center>
);
};
Header.Center = StickyTriSectionHeader.Center;

ChattingRoomLayout.Header = Header;
ChattingRoomLayout.Footer = ChattingRoomFooter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export const item = css`
display: flex;
flex-direction: column;
align-items: center;

width: 7rem;
height: 100%;
`;

export const button = ({ theme }: { theme: Theme }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export const footer = ({ theme }: { theme: Theme }) => css`
justify-content: space-around;

padding: 1.3rem 0;
/* stylelint-disable */
padding-bottom: constant(safe-area-inset-bottom);
/* stylelint-enable */
padding-bottom: env(safe-area-inset-bottom);
Comment on lines +9 to +12
Copy link
Contributor

Choose a reason for hiding this comment

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

ios지원을 위해 넣군요!


background-color: ${theme.colorPalette.white[100]};
box-shadow: 0 -10px 15px rgb(0 0 0 / 20%);
Expand Down
Loading
Loading