Skip to content

Commit

Permalink
isMe 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaeyeon1 committed Nov 30, 2023
1 parent a5d7e06 commit a648c97
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ const page = ({ params }: { params: { blogName: string; categoryId: string; post
</BlackContainer>
</ThumbnailArea>
<DragAndDrop
post={post}
blogName={params.blogName}
footprintList={writeList}
isMe={sidebarData?.isMyPage}
rightContainer={
<Stack width={'100%'} bgcolor={userTheme === 'dark' ? 'transparent' : '#FCFAF1'} p={12}>
<MDEditor.Markdown source={post?.content} />
Expand Down
1 change: 1 addition & 0 deletions client/src/app/[blogName]/home/[categoryId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function page({ params }: { params: { blogName: string; categoryId: string } })
<DragAndDrop
blogName={params.blogName}
footprintList={writeList}
isMe={sidebarData?.isMyPage}
rightContainer={
<Stack width="100%">
<PostAreaComponent>
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/[blogName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { useRouter } from 'next/navigation';
const Home = ({ params }: { params: { blogName: string } }) => {
const [writeList, setWriteList] = useState<ISidebarContent[]>();
const { data: blogIdData } = usegetblogIdQuery({ blogUrl: params.blogName });

const { data: sidebarData } = useGetSidebarQuery({ blogId: blogIdData });
const { data: readMeData } = useGetReadMeQuery({ blogId: blogIdData });
const [readMe, setReadMe] = useState<{
Expand All @@ -34,6 +33,7 @@ const Home = ({ params }: { params: { blogName: string } }) => {
<DragAndDrop
blogName={params.blogName}
footprintList={writeList}
isMe={sidebarData?.isMyPage}
rightContainer={
<Stack spacing={3}>
<Stack direction="row" alignItems="center" justifyContent="space-between">
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/write/readme/[blogName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ReadMe = ({ params }: { params: { blogName: string } }) => {

const readmeSaveOnClick = () => {
const newReadMeBody = {
content: content,
readme: content,
};

putReadmeQuery.mutate(newReadMeBody);
Expand Down
13 changes: 6 additions & 7 deletions client/src/components/DND/DragAndDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import PageLink from '../PageLink/PageLink';
import Github from '../Github/Github';
import Button from '../Button/Button';
import CreateCategoryModal from './CreateCategoryModal';
import { IPostContent } from '@/types/dto';

type Footprint = {
categoryId: number;
Expand All @@ -31,10 +30,10 @@ interface DragAndDropProps {
rightContainer: ReactNode;
footprintList?: Footprint[];
categoryNumber?: string;
post?: IPostContent;
isMe?: boolean;
}

function DragAndDrop({ rightContainer, footprintList, blogName, post }: DragAndDropProps) {
function DragAndDrop({ rightContainer, footprintList, blogName, isMe }: DragAndDropProps) {
const [isBrowser, setIsBrowser] = useState(false);
const [categoryEditOpen, setCategoryEditOpen] = useState(false);
const [createCategoryOpen, setCreateCategoryOpen] = useState(false);
Expand All @@ -61,7 +60,7 @@ function DragAndDrop({ rightContainer, footprintList, blogName, post }: DragAndD
<CenterContent sx={{ zIndex: 200 }} bgcolor="themeColor.main">
<Stack gap={8} width="100%" height="100%" direction="row">
<Stack sx={{ transition: 'all .35s ease-in-out' }} position="relative" gap={8}>
{post?.isAuthor && (
{isMe && (
<Button
variant="outlined"
fullWidth
Expand Down Expand Up @@ -99,7 +98,7 @@ function DragAndDrop({ rightContainer, footprintList, blogName, post }: DragAndD
</Stack>
</Tooltip>
</PageLink>
{post?.isAuthor && (
{isMe && (
<Tooltip
onClick={() => {
setCategoryEditOpen(true);
Expand All @@ -113,7 +112,7 @@ function DragAndDrop({ rightContainer, footprintList, blogName, post }: DragAndD
)}
</Stack>
<Stack direction="row" alignItems="center" spacing={1}>
{post?.isAuthor && (
{isMe && (
<PageLink href={`/write/create/${category.categoryId}`}>
<Tooltip title="게시글 작성">
<IconButton sx={{ padding: '0px' }} size="small">
Expand Down Expand Up @@ -146,7 +145,7 @@ function DragAndDrop({ rightContainer, footprintList, blogName, post }: DragAndD
</Stack>
</PageLink>
) : (
post?.isAuthor && (
isMe && (
<Stack
onClick={() => {
setOpen(true);
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Header/SettingMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ function SettingMenu({ open, onClose, anchorEl }: ModalType & { anchorEl: null |
</PageLink>
</MenuItem>
<MenuItem onClick={() => setFriendOpen(true)}>친구</MenuItem>
<MenuItem>
{/* <MenuItem>
<PageLink
href="/scrap"
onClick={() => {
onClose();
}}>
스크랩
</PageLink>
</MenuItem>
</MenuItem> */}
{token && (
<PageLink
href="/login"
Expand Down
2 changes: 1 addition & 1 deletion client/src/types/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export interface IReadMeParams {

//리드미 put
export interface IReadMe {
content?: string;
readme?: string;
}

export interface IBlogIdParams {
Expand Down

0 comments on commit a648c97

Please sign in to comment.