-
Title
- {isEditMode?editable:readOnly}
+ return (
+
+ Title
+ {isEditMode ? editable : readOnly}
)
}
-export function EditableLogoImage({selectedRecord}:EditableProp){
-
+export function EditableLogoImage({ selectedRecord }: EditableProp) {
+
const [isEditMode, setIsEditMode] = useState(false)
const [isHashingImage, setIsHashingImage] = useState(false)
const [updatedLogoImageHash, setUpdatedLogoImageHash] = useState(selectedRecord.logoImageHash)
@@ -894,43 +988,43 @@ export function EditableLogoImage({selectedRecord}:EditableProp){
const urlPrefix = useUrlPrefix()
- const {paseto} = useAuthContext()
+ const { paseto } = useAuthContext()
const queryClient = useQueryClient()
- function toggleEdit(){
+ function toggleEdit() {
setIsEditMode(!isEditMode)
}
const readOnly = (
-
-
-
-
+
+
+
+
)
- const mutationHandler = async(updatedItem:any)=>{
- const {data} = await axios.patch(`${utils.NEXT_PUBLIC_NEW_API_URL}/${urlPrefix}/community`,updatedItem,{
- headers:{
- //@ts-ignore
- "Authorization": paseto
+ const mutationHandler = async (updatedItem: any) => {
+ const { data } = await axios.patch(`${utils.NEXT_PUBLIC_NEW_API_URL}/${urlPrefix}/community`, updatedItem, {
+ headers: {
+ //@ts-ignore
+ "Authorization": paseto
}
})
- return data;
+ return data;
}
const mutation = useMutation({
- mutationKey:['logoImage'],
+ mutationKey: ['logoImage'],
mutationFn: mutationHandler,
- onSuccess:()=>{
+ onSuccess: () => {
toggleEdit()
},
- onSettled:(data)=>{
+ onSettled: (data) => {
setUpdatedLogoImageHash(data?.data?.logoImageHash)
queryClient.invalidateQueries(['community'])
}
})
- async function onFinish(field:any){
+ async function onFinish(field: any) {
// hash it first
const logoRes = await field.logoImage
@@ -948,132 +1042,129 @@ export function EditableLogoImage({selectedRecord}:EditableProp){
mutation.mutate(payload)
}
- const {isLoading:isEditing} = mutation
+ const { isLoading: isEditing } = mutation
- const extractLogoImage = async(e: any) => {
+ const extractLogoImage = async (e: any) => {
console.log('Upload event:', e);
if (Array.isArray(e)) {
- return e;
+ return e;
}
- return e?.fileList;
-};
+ return e?.fileList;
+ };
const editable = (
)
- return(
-
-
Logo
- {isEditMode?editable:readOnly}
+ return (
+
+ Logo
+ {isEditMode ? editable : readOnly}
)
}
-interface DeleteProp{
+interface DeleteProp {
selectedRecord: Community
isOpen: boolean
- onCloseModal: ()=>void
- onDeleteRecord: ()=>void
+ onCloseModal: () => void
+ onDeleteRecord: () => void
isDeletingItem: boolean
}
-function DeleteRecordModal({selectedRecord, isOpen, isDeletingItem, onDeleteRecord, onCloseModal}:DeleteProp){
+function DeleteRecordModal({ selectedRecord, isOpen, isDeletingItem, onDeleteRecord, onCloseModal }: DeleteProp) {
- function onFinish(){
+ function onFinish() {
// call mutate function to delete record
onDeleteRecord()
}
const [form] = Form.useForm()
- return(
-
{}} onCancel={onCloseModal}>
- {/* */}
+ return (
+ { }} onCancel={onCloseModal}>
{`This action will remove this venue’s listing from the marketplace and will deactivate any DATs that are attached to it. Venue can be reactivated in the future
`}
-
-
-
-
-
+
+
+
+
+
{() => (
-
- )}
-
+
+ )}
+
-
+
-
+
)
}
@@ -1082,21 +1173,19 @@ function DeleteRecordModal({selectedRecord, isOpen, isDeletingItem, onDeleteReco
const filters = [
{
- id: '1',
- name: 'Active'
+ id: '1',
+ name: 'Active'
},
{
- id: '0',
- name: 'Inactive'
+ id: '0',
+ name: 'Inactive'
},
{
- id: '4',
- name: 'Drafts'
+ id: '4',
+ name: 'Drafts'
},
]
-
-
diff --git a/pages/organizations/communities/new.tsx b/pages/organizations/communities/new.tsx
index d2f1c8f3..3b0000c0 100644
--- a/pages/organizations/communities/new.tsx
+++ b/pages/organizations/communities/new.tsx
@@ -10,7 +10,7 @@ const {Text,Title} = Typography;
import {QuestionCircleOutlined,SelectOutlined,ArrowLeftOutlined, UploadOutlined, MinusOutlined,MinusCircleOutlined,InfoCircleOutlined,PlusCircleOutlined} from '@ant-design/icons'
-import router, { useRouter } from 'next/router';
+import router, { useRouter } from 'next/router';
import axios from 'axios';
import { useAuthContext } from '../../../context/AuthContext';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
@@ -308,7 +308,7 @@ function BasicForm({nextStep, isBankConnected}:BasicInfoProps){
-