Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
renoyang66 committed Nov 3, 2024
1 parent 18470e2 commit 3950176
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 36 deletions.
10 changes: 5 additions & 5 deletions app/spaces/[spaceid]/adminevents/[eventid]/Tabs/Ticket/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const Ticket = ({ event }: PropTypes) => {
const [ticketAddresses, setTicketAddresses] = useState<Array<string>>([]);
const initialWhitelist = ['0x0000000000000000000000000000000000000000'];

const regAndAccess = event?.regAndAccess.edges?.[0]?.node;
const regAndAccess = event?.regAndAccess?.edges?.[0]?.node;
const queryClient = useQueryClient();

const updateEventContract = async (
Expand Down Expand Up @@ -467,8 +467,8 @@ const Ticket = ({ event }: PropTypes) => {
refetch={readFromContract}
setBlockClickModal={setBlockClickModal}
eventContracts={
event?.regAndAccess.edges[0].node.scrollPassTickets
? event?.regAndAccess.edges[0].node.scrollPassTickets
event?.regAndAccess?.edges?.[0]?.node.scrollPassTickets
? event?.regAndAccess?.edges?.[0]?.node.scrollPassTickets
: []
}
onClose={handleClose}
Expand Down Expand Up @@ -518,8 +518,8 @@ const Ticket = ({ event }: PropTypes) => {
onToggle={handleOpen}
event={event!}
eventContracts={
event?.regAndAccess.edges[0].node.scrollPassTickets
? event?.regAndAccess.edges[0].node.scrollPassTickets
event?.regAndAccess?.edges?.[0]?.node.scrollPassTickets
? event?.regAndAccess?.edges?.[0]?.node.scrollPassTickets
: []
}
/>
Expand Down
8 changes: 2 additions & 6 deletions app/spaces/[spaceid]/events/[eventid]/tabs/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import {
SwipeableDrawer,
useTheme,
} from '@mui/material';
import {
EventName,
EventAbout,
EventDetail,
} from '@/components/event';
import { EventName, EventAbout, EventDetail } from '@/components/event';
import { ZuButton } from '@/components/core';
import { XMarkIcon } from '@/components/icons';
import {
Expand Down Expand Up @@ -241,7 +237,7 @@ const About: React.FC<IAbout> = ({ eventData, setEventData, setVerify }) => {
<Verify
setIsVerify={setIsVerify}
eventContractID={
eventData?.regAndAccess.edges[0].node
eventData?.regAndAccess?.edges?.[0]?.node
.scrollPassContractFactoryID
}
setFilteredResults={setFilteredResults}
Expand Down
48 changes: 24 additions & 24 deletions components/event/EventApplication/ApplicationForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const ApplicationForm: React.FC<ApplicationFormProps> = ({
</AccordionSummary>
<AccordionDetails>
<RadioGroup>
{event.regAndAccess.edges[0].node.scrollPassTickets?.map(
{event.regAndAccess?.edges?.[0]?.node.scrollPassTickets?.map(
(contract, index) => (
<FormControlLabel
key={index}
Expand Down Expand Up @@ -234,29 +234,29 @@ export const ApplicationForm: React.FC<ApplicationFormProps> = ({
</Stack>
</Stack>
<Stack spacing="20px">
{JSON.parse(event.regAndAccess.edges[0].node.applicationForm).map(
(item: QuestionItem, index: number) => (
<Stack key={index} spacing="10px" width="100%">
<Typography
sx={{
fontSize: 16,
fontWeight: 700,
lineHeight: '1.2',
}}
>
{item.question}
</Typography>
<TextField
multiline
rows={4}
fullWidth
placeholder="Enter your answer here"
variant="outlined"
{...register(`question_${index}`)}
/>
</Stack>
),
)}
{JSON.parse(
event.regAndAccess?.edges?.[0]?.node.applicationForm ?? '',
).map((item: QuestionItem, index: number) => (
<Stack key={index} spacing="10px" width="100%">
<Typography
sx={{
fontSize: 16,
fontWeight: 700,
lineHeight: '1.2',
}}
>
{item.question}
</Typography>
<TextField
multiline
rows={4}
fullWidth
placeholder="Enter your answer here"
variant="outlined"
{...register(`question_${index}`)}
/>
</Stack>
))}
</Stack>
</Stack>
<Typography
Expand Down
4 changes: 3 additions & 1 deletion components/event/Sponsor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export const SponsorAgree: React.FC<IProps> = ({
address: TICKET_FACTORY_ADDRESS as Address,
abi: TICKET_FACTORY_ABI as Abi,
functionName: 'getTickets',
args: [event?.regAndAccess.edges[0].node.scrollPassContractFactoryID],
args: [
event?.regAndAccess?.edges?.[0]?.node.scrollPassContractFactoryID,
],
})) as Array<string>;
setTicketAddresses(getTicketAddresses);

Expand Down

0 comments on commit 3950176

Please sign in to comment.