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

피드작성이 안떠요 #638

Merged
merged 1 commit into from
Dec 9, 2023
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
2 changes: 1 addition & 1 deletion src/api/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ export const fetchMyProfile = async () => {
};

export const fetchMeetingListOfUserAttend = async () => {
return api.get<PromiseResponse<GroupInfo[]>>('/user/v2/meeting/all');
return api.get<GroupInfo[]>('/user/v2/meeting/all');
};
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function FeedCreateWithSelectMeetingModal({ isModalOpened, handleModalClose }: C
{!isFetchAttendMeetingLoading && (
<FeedFormPresentation
userId={Number(me?.orgId)}
attendGroupsInfo={attendMeetingList?.data.data}
attendGroupsInfo={attendMeetingList?.data}
title="피드 작성"
handleDeleteImage={handleDeleteImage}
handleModalClose={handleModalClose}
Expand Down
22 changes: 17 additions & 5 deletions src/components/modal/FloatingButtonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,32 @@ import FeedIcon from '../../../public/assets/svg/floating_button_feed_icon.svg';
import GroupIcon from '../../../public/assets/svg/floating_button_group_icon.svg';
import NoJoinedGroupModal from './NoJoinedGroupModal';

const FloatingButtonModal = (props: { isActive: boolean }) => {
const { isActive } = props;
const FloatingButtonModal = (props: { isActive: boolean; handleOptionClose: () => void }) => {
const { isActive, handleOptionClose } = props;
const router = useRouter();
const overlay = useOverlay();
const { data: me } = useQueryMyProfile();
const queryClient = useQueryClient();
const { mutate: fetchUserAttendMeetingListMutate } = useMutation(fetchMeetingListOfUserAttend, {
onSuccess: data => {
queryClient.setQueryData(['fetchMeetingList', 'all'], data);
if (data.data.data.length === 0) {
overlay.open(({ isOpen, close }) => <NoJoinedGroupModal isModalOpened={isOpen} handleModalClose={close} />);
if (data.data.length === 0) {
overlay.open(({ isOpen, close }) => (
<NoJoinedGroupModal
isModalOpened={isOpen}
handleModalClose={() => {
close(), handleOptionClose();
}}
/>
));
} else {
overlay.open(({ isOpen, close }) => (
<FeedCreateWithSelectMeetingModal isModalOpened={isOpen} handleModalClose={close} />
<FeedCreateWithSelectMeetingModal
isModalOpened={isOpen}
handleModalClose={() => {
close(), handleOptionClose();
}}
/>
));
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/page/postList/FloatingButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function FloatingButton() {
<OptionOpenButton isActive={isActive} onClick={handleButtonClick}>
<Icon isActive={isActive} />
</OptionOpenButton>
<FloatingButtonModal isActive={isActive} />
<FloatingButtonModal isActive={isActive} handleOptionClose={handleOptionClose} />
</Container>
</>
);
Expand Down