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

Events Pages #220

Merged
merged 31 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6094221
major refactor of keypom utils and started work on nft drop manager
BenKurrek Feb 24, 2024
e196472
figma implemented for nft pages
BenKurrek Feb 24, 2024
2d9ff13
fix warnings
BenKurrek Feb 24, 2024
1d3f917
fixed mobile table css
BenKurrek Feb 24, 2024
209cc00
finished new caching logic and nft drops page
BenKurrek Feb 24, 2024
7566b4d
final commits
BenKurrek Feb 25, 2024
5ad1800
final css
BenKurrek Feb 25, 2024
8cae77c
switched placeholder for nft
BenKurrek Feb 25, 2024
779096e
abstracted all drops page and started working on all events page
BenKurrek Feb 26, 2024
99d6e9d
started work on events page
BenKurrek Feb 28, 2024
1679d62
loooaaddss of work
BenKurrek Feb 28, 2024
d6dde19
fixed warnings
BenKurrek Feb 28, 2024
bf7d1ba
added share button at top right of event page
BenKurrek Feb 28, 2024
2cec1bb
working on individual ticket page
BenKurrek Feb 29, 2024
8572b16
fixed small race condition in pagination logic
BenKurrek Feb 29, 2024
160c32b
first pass at finished css done
BenKurrek Feb 29, 2024
4c5137f
fixed small breadcrumb issue
BenKurrek Feb 29, 2024
d3d1590
fixing mobile layouts
BenKurrek Mar 2, 2024
720b17f
fix modal lags
BenKurrek Mar 3, 2024
548edac
fix build
BenKurrek Mar 3, 2024
da50d11
fixing mobile layout IDs, fixed centered actions
BenKurrek Mar 4, 2024
90ba248
check types
BenKurrek Mar 4, 2024
8c25252
finished first pass at ticket deletion
BenKurrek Mar 5, 2024
90c3100
started port to new interface and contracts
BenKurrek Mar 7, 2024
5446c52
more changes.......
BenKurrek Mar 7, 2024
4298cca
fully functioning deletion and consolidated event manager page into j…
BenKurrek Mar 7, 2024
0e215d6
encryption implemented
BenKurrek Mar 7, 2024
09ec847
final commit
BenKurrek Mar 7, 2024
fb6f578
change base contract and small bugfix
BenKurrek Mar 7, 2024
4b4a951
final changes
BenKurrek Mar 8, 2024
549d59e
build fixes
BenKurrek Mar 8, 2024
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
Binary file modified .DS_Store
Binary file not shown.
179 changes: 93 additions & 86 deletions src/components/AppModal/AppModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Input,
Box,
Center,
Spinner,
Text,
ModalCloseButton,
ModalOverlay,
} from '@chakra-ui/react';
import { CheckIcon, CloseIcon } from '@chakra-ui/icons';

Expand All @@ -28,107 +28,114 @@ export const AppModal = () => {
const [values, setValues] = useState({});
const [loading, setLoading] = useState(false);

const canClose = appModal.canClose !== undefined ? appModal.canClose : true;
return (
<Modal
isCentered
closeOnOverlayClick={appModal.closeOnOverlayClick || false}
closeOnEsc={canClose}
closeOnOverlayClick={canClose && (appModal.closeOnOverlayClick || false)}
isOpen={appModal.isOpen}
size={appModal.size || 'md'}
onClose={() => {
setAppModal({
isOpen: false,
});
if (canClose) {
setAppModal({ isOpen: false });
}
}}
>
<ModalOverlay />
<ModalContent p={{ base: '8', md: '16' }} textAlign="center" top={'-10rem'}>
<ModalHeader
alignItems="center"
display="flex"
flexDir="column"
fontSize={{ base: 'xl', md: '2xl' }}
pb="0"
>
{appModal.header && <h4>{appModal.header}</h4>}
</ModalHeader>
{appModal.closeButtonVisible && <ModalCloseButton />}
<ModalBody>
{appModal.isLoading && (
<Center>
<Spinner
color="blue.400"
h={{ base: '16', md: '20' }}
mb="6"
w={{ base: '16', md: '20' }}
/>
</Center>
)}
<ModalOverlay backdropFilter="blur(0px)" bg="blackAlpha.600" opacity="1" />
{appModal.modalContent !== undefined ? (
appModal.modalContent
) : (
<ModalContent p={{ base: '4', md: '8' }} textAlign="center" top={'-5rem'}>
<ModalHeader
alignItems="center"
display="flex"
flexDir="column"
fontSize={{ base: 'xl', md: '2xl' }}
pb="0"
>
{appModal.header && <h4>{appModal.header}</h4>}
</ModalHeader>
{appModal.closeButtonVisible && <ModalCloseButton />}
<ModalBody>
{appModal.isLoading && (
<Center>
<Spinner
color="blue.400"
h={{ base: '16', md: '20' }}
mb="6"
w={{ base: '16', md: '20' }}
/>
</Center>
)}

{appModal.isSuccess && (
<Center>
<RoundIcon icon={<CheckIcon color="blue.400" />} mb="6" />
</Center>
)}
{appModal.isSuccess && (
<Center>
<RoundIcon icon={<CheckIcon color="blue.400" />} mb="6" />
</Center>
)}

{appModal.isError && (
<Center>
<RoundIcon icon={<CloseIcon color="blue.400" />} mb="6" />
</Center>
)}
{appModal.isError && (
<Center>
<RoundIcon icon={<CloseIcon color="blue.400" />} mb="6" />
</Center>
)}

{appModal.message && <Text my={2}>{appModal.message}</Text>}
{appModal.message && <Text my={2}>{appModal.message}</Text>}

{appModal.bodyComponent !== undefined && <Box>{appModal.bodyComponent}</Box>}
{appModal.bodyComponent !== undefined && <Box>{appModal.bodyComponent}</Box>}

{appModal.inputs && appModal.inputs.length > 0 && (
<>
{appModal.inputs.map(({ placeholder, valueKey }, i) => (
<Input
key={i}
placeholder={placeholder}
type="text"
onChange={(e) => {
setValues({
...values,
...{ [valueKey]: e.target.value },
});
}}
/>
))}
</>
)}
</ModalBody>
{appModal.inputs && appModal.inputs.length > 0 && (
<>
{appModal.inputs.map(({ placeholder, valueKey }, i) => (
<Input
key={i}
placeholder={placeholder}
type="text"
onChange={(e) => {
setValues({
...values,
...{ [valueKey]: e.target.value },
});
}}
/>
))}
</>
)}
</ModalBody>

{appModal.options && appModal.options.length > 0 && (
<ModalFooter>
<ButtonGroup justifyContent="center" w="full">
{appModal.options.map(({ label, func, buttonProps, lazy }, i) => (
<Button
key={i}
isLoading={loading}
onClick={async () => {
if (lazy) {
setAppModal({ isOpen: false });
{appModal.options && appModal.options.length > 0 && (
<ModalFooter>
<ButtonGroup justifyContent="space-between" w="full">
{appModal.options.map(({ label, func, buttonProps, lazy }, i) => (
<Button
key={i}
isLoading={loading}
onClick={async () => {
if (lazy) {
setAppModal({ isOpen: false });
if (func) {
await func(values);
}
return;
}
setLoading(true);
if (func) {
await func(values);
}
return;
}
setLoading(true);
if (func) {
await func(values);
}
setLoading(false);
setAppModal({ isOpen: false });
}}
{...buttonProps}
>
{label}
</Button>
))}
</ButtonGroup>
</ModalFooter>
)}
</ModalContent>
setLoading(false);
setAppModal({ isOpen: false });
}}
{...buttonProps}
>
{label}
</Button>
))}
</ButtonGroup>
</ModalFooter>
)}
</ModalContent>
)}
</Modal>
);
};
26 changes: 26 additions & 0 deletions src/components/AppModal/CompletionModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ModalContent, VStack, Text, Progress, Button } from '@chakra-ui/react';

interface CompletionModalContentProps {
onClose: () => void;
completionMessage?: string;
}

const CompletionModalContent = ({
onClose,
completionMessage = 'Deletion complete.',
}: CompletionModalContentProps) => (
<ModalContent padding={6}>
<VStack align="stretch" spacing={4}>
<Text fontSize="lg" fontWeight="semibold">
Deletion Complete
</Text>
<Progress hasStripe isAnimated value={100} />
<Text>{completionMessage}</Text>
<Button autoFocus={false} variant="secondary" width="full" onClick={onClose}>
Close
</Button>
</VStack>
</ModalContent>
);

export default CompletionModalContent;
32 changes: 32 additions & 0 deletions src/components/AppModal/ConfirmDeletionModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ModalContent, VStack, Text, HStack, Button } from '@chakra-ui/react';

interface ConfirmDeletionModalProps {
onConfirm: () => void;
onCancel: () => void;
confirmMessage?: string;
}

const ConfirmDeletionModal = ({
onConfirm,
onCancel,
confirmMessage = 'Are you sure you want to delete this item? This action cannot be undone.',
}: ConfirmDeletionModalProps) => (
<ModalContent padding={6}>
<VStack align="stretch" spacing={4}>
<Text fontSize="lg" fontWeight="semibold">
Confirm Deletion
</Text>
<Text>{confirmMessage}</Text>
<HStack justify="space-between">
<Button colorScheme="red" onClick={onConfirm}>
Delete
</Button>
<Button variant="ghost" onClick={onCancel}>
Cancel
</Button>
</HStack>
</VStack>
</ModalContent>
);

export default ConfirmDeletionModal;
Loading
Loading