Skip to content

Commit

Permalink
feat: main일때 알림/쪽지 가려놓기 (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
leochoi98 authored Jul 31, 2024
1 parent 4fd961a commit e87015b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion apps/web-client/src/components/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { BarsIcon, HeaderBlock, HeaderIconBox, HeaderIcons, LogoImage } from './
import Menus from './Menus/Menus';
import { MENU } from '~/constants/menus';
import Notification from './Notification/Notification';
import { isDevelopment } from '~/lib/utils/isDevelopment';

const useStyles = createStyles(({ css }) => ({
avatarButton: css`
Expand Down Expand Up @@ -89,7 +90,7 @@ const Header = ({ member, onLogout }) => {
{isLogin && (
<div className={styles.menuInner}>
{/** Noti */}
<Notification />
{isDevelopment && <Notification />}
{/** Profile */}
<Dropdown menu={{ items: dropDownItems }}>
<Button shape="circle" className={styles.avatarButton}>
Expand Down
3 changes: 2 additions & 1 deletion apps/web-client/src/components/header/Menus/Menus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import LinkButton from '../../common/Buttons/LinkButton';
import { LeftHeaderMenu, MenuBlock, RightHeaderMenu } from './Menus.styles';
import { MENU } from '~/constants/menus';
import Notification from '../Notification/Notification';
import { isDevelopment } from '~/lib/utils/isDevelopment';

const useStyles = createStyles(({ css }) => ({
menuInner: css`
Expand Down Expand Up @@ -118,7 +119,7 @@ const Menus = ({
{isLogin && (
<div className={styles.menuInner}>
{/** Noti */}
<Notification />
{isDevelopment && <Notification />}
<Dropdown menu={{ items: dropDownItems }}>
<Button shape="circle" style={{ padding: 0, width: '40px', height: '40px' }}>
<Avatar src={profileImageURL} size={36} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from './MemberDetailContent.styles';
import { ConversationControllerService, MemberControllerService, MemberResponse, queryKey, useAppMutation, useAppSuspeneseQueries } from '~/lib/api-v2';
import { MENU } from '~/constants/menus';
import { isDevelopment } from '~/lib/utils/isDevelopment';

export default function MemberDetailContent({ loginId }: { loginId: string }) {
const history = useHistory();
Expand Down Expand Up @@ -52,7 +53,7 @@ export default function MemberDetailContent({ loginId }: { loginId: string }) {
const onMessageButtonClick = () => {
if (confirm(`${member.name}님과의 대화를 시작할까요?`)) {
mutate(undefined, {
onSuccess: ({id }) => {
onSuccess: ({ id }) => {
history.push(`/${MENU.MESSAGE}/${id}/${MENU.MESSAGE_FORM}`);
},
});
Expand All @@ -70,7 +71,7 @@ export default function MemberDetailContent({ loginId }: { loginId: string }) {
<Name>{member.name}</Name>
{member.isAdmin && <Status>PoolC임원</Status>}
{member.badge && <Avatar src={getFileUrl(member.badge.imageUrl)} size={60} />}
{member.loginID !== me.loginID && (
{isDevelopment && member.loginID !== me.loginID && (
<Tooltip title={`${member.name}님과 대화를 해보아요`}>
<Button shape="circle" icon={<MessageOutlined />} type="primary" onClick={onMessageButtonClick} />
</Tooltip>
Expand Down
1 change: 1 addition & 0 deletions apps/web-client/src/lib/utils/isDevelopment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isDevelopment = window.location.hostname === 'dev.poolc.org' || window.location.hostname.startsWith('localhost') || window.location.hostname.startsWith('127.0.0.1');
17 changes: 12 additions & 5 deletions apps/web-client/src/pages/my-page/MyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import MyPageGrassSection from '~/components/my-page/MyPageGrassSection';
import { queryClient } from '~/lib/utils/queryClient';
import { getProfileImageUrl } from '~/lib/utils/getProfileImageUrl';
import getFileUrl from '~/lib/utils/getFileUrl';
import { isDevelopment } from '~/lib/utils/isDevelopment';

const useStyles = createStyles(({ css }) => ({
whiteBlock: css`
Expand Down Expand Up @@ -107,11 +108,17 @@ export default function MyPage() {
icon: <StarTwoTone size={24} twoToneColor="#ffa94d" />,
link: `/${MENU.MY_PAGE}/${MENU.MY_PAGE_MY_SCRAPS}`,
},
{
title: '쪽지',
icon: <MessageTwoTone size={24} twoToneColor="#4dabf7" />,
link: `/${MENU.MESSAGE}`,
},
isDevelopment
? {
title: '쪽지',
icon: <MessageTwoTone size={24} twoToneColor="#4dabf7" />,
link: `/${MENU.MESSAGE}`,
}
: {
title: '쪽지',
icon: <MessageTwoTone size={24} twoToneColor="#4dabf7" />,
onClick: () => alert('서비스 준비중입니다.'),
},
];

const [{ data: myHour }, { data: me }, { data: badge }, { data: baekjoon }] = useAppQueries({
Expand Down

0 comments on commit e87015b

Please sign in to comment.