-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' of github.com:xi-effect/xi.app into staging
- Loading branch information
Showing
13 changed files
with
93 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useCallback } from 'react'; | ||
import { AddCommunityModal } from 'pkg.modal.add-community'; | ||
import { InviteCommunityModal } from 'pkg.modal.invite-community'; | ||
import { CategoryCreate } from 'pkg.modal.category-create'; | ||
import { CommunityChannelCreate } from 'pkg.community.channel-create'; | ||
import { CommunitySettingsModal } from './components/Community/CommunitySettingsModal'; | ||
import { useCommunityStore } from './store/communityStore'; | ||
import { | ||
CATEGORY_CREATE, | ||
CHANNEL_CREATE, | ||
INVITE_COMMUNITY, | ||
ADD_COMMUNITY, | ||
OPEN_COMMUNITY_SETTINGS, | ||
} from './store/modalConst'; | ||
|
||
export const ModalsProvider = ({ children }: { children: React.ReactNode }) => { | ||
const { modal, setModal } = useCommunityStore(); | ||
|
||
const closeModal = useCallback(() => setModal(null), []); | ||
|
||
return ( | ||
<> | ||
<CommunitySettingsModal open={modal === OPEN_COMMUNITY_SETTINGS} onOpenChange={closeModal} /> | ||
<CategoryCreate open={modal === CATEGORY_CREATE} onOpenChange={closeModal} /> | ||
<CommunityChannelCreate open={modal === CHANNEL_CREATE} onOpenChange={closeModal} /> | ||
<InviteCommunityModal open={modal === INVITE_COMMUNITY} onOpenChange={closeModal} /> | ||
<AddCommunityModal open={modal === ADD_COMMUNITY} setModal={setModal} /> | ||
{children} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
packages/pkg.navigation/components/Community/CommunityMenu.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
packages/pkg.navigation/components/Community/CommunitySettingsModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Modal, ModalContent } from '@xipkg/modal'; | ||
import { CommunitySettings } from 'pkg.community.settings'; | ||
|
||
type CommunitySettingsModalT = { | ||
open: boolean; | ||
onOpenChange: () => void; | ||
}; | ||
|
||
export const CommunitySettingsModal = ({ open, onOpenChange }: CommunitySettingsModalT) => ( | ||
<Modal open={open} onOpenChange={onOpenChange}> | ||
<ModalContent variant="full" className="p-4 lg:p-6"> | ||
<CommunitySettings /> | ||
</ModalContent> | ||
</Modal> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export { CommunityItems } from './CommunityItems'; | ||
export { CommunityItemsSkeleton } from './CommunityItemsSkeleton'; | ||
export { CommunityMenu } from './CommunityMenu'; | ||
export { CommunityLink } from './CommunityLink'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export { CommunityItems } from './Community/CommunityItems'; | ||
export { CommunityMenu } from './Community/CommunityMenu'; | ||
export { BottomBar } from './BottomBar'; | ||
export { Menu } from './Menu'; | ||
export { ItemContextMenu } from './ItemContextMenu'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,11 @@ | ||
import { create } from 'zustand'; | ||
|
||
type CommunityStateT = { | ||
isOpenCommunitySettings: boolean; | ||
isInviteCommunityModalOpen: boolean; | ||
isAddCommunityModalOpen: boolean; | ||
isCategoryCreateOpen: boolean; | ||
isCommunityChannelCreateOpen: boolean; | ||
|
||
setIsOpenCommunitySettings: (isOpen: boolean) => void; | ||
setIsInviteCommunityModalOpen: (isOpen: boolean) => void; | ||
setIsAddCommunityModalOpen: (isOpen: boolean) => void; | ||
setIsCategoryCreateOpen: (isOpen: boolean) => void; | ||
setIsCommunityChannelCreateOpen: (isOpen: boolean) => void; | ||
modal: string | null; | ||
setModal: (modalType: string | null) => void; | ||
}; | ||
|
||
export const useCommunityStore = create<CommunityStateT>((set) => ({ | ||
isOpenCommunitySettings: false, | ||
isInviteCommunityModalOpen: false, | ||
isAddCommunityModalOpen: false, | ||
isCategoryCreateOpen: false, | ||
isCommunityChannelCreateOpen: false, | ||
|
||
setIsOpenCommunitySettings: (isOpen: boolean) => set({ isOpenCommunitySettings: isOpen }), | ||
setIsInviteCommunityModalOpen: (isOpen: boolean) => set({ isInviteCommunityModalOpen: isOpen }), | ||
setIsAddCommunityModalOpen: (isOpen: boolean) => set({ isAddCommunityModalOpen: isOpen }), | ||
setIsCategoryCreateOpen: (isOpen: boolean) => set({ isCategoryCreateOpen: isOpen }), | ||
setIsCommunityChannelCreateOpen: (isOpen: boolean) => | ||
set({ isCommunityChannelCreateOpen: isOpen }), | ||
modal: null, | ||
setModal: (modalType: string | null) => set({ modal: modalType }), | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const CATEGORY_CREATE = 'categoryCreate'; | ||
export const CHANNEL_CREATE = 'channelCreate'; | ||
export const INVITE_COMMUNITY = 'inviteCommunity'; | ||
export const ADD_COMMUNITY = 'addCommunity'; | ||
export const OPEN_COMMUNITY_SETTINGS = 'openCommunitySettings'; |