Skip to content
Open
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: 2 additions & 0 deletions apps/backend/src/orders/order.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ManufacturerModule } from '../foodManufacturers/manufacturers.module';
import { DonationItemsModule } from '../donationItems/donationItems.module';
import { Allocation } from '../allocations/allocations.entity';
import { Donation } from '../donations/donations.entity';
import { PantriesModule } from '../pantries/pantries.module';
import { EmailsModule } from '../emails/email.module';

@Module({
Expand All @@ -38,6 +39,7 @@ import { EmailsModule } from '../emails/email.module';
ManufacturerModule,
DonationItemsModule,
DonationModule,
forwardRef(() => PantriesModule),
EmailsModule,
],
controllers: [OrdersController],
Expand Down
70 changes: 70 additions & 0 deletions apps/frontend/src/components/pageEmptyState.tsx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our files are named in camelCase~ could you rename the empty state files accordingly?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like pageEmptyState.tsx @jxuistrying

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import { Box, Button, Text } from '@chakra-ui/react';
import { CircleCheck } from 'lucide-react';
import { useNavigate } from 'react-router-dom';

interface PageEmptyStateProps {
entity?: string;
subtitle?: string;
primaryButtonText: string;
primaryButtonLink: string;
secondaryButtonText: string;
secondaryButtonLink: string;
}

const PageEmptyState: React.FC<PageEmptyStateProps> = ({
entity,
subtitle,
primaryButtonText,
primaryButtonLink,
secondaryButtonText,
secondaryButtonLink,
}) => {
const navigate = useNavigate();
const message = subtitle ?? `You have no ${entity} at this time`;

return (
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
textAlign="center"
py={10}
gap={2}
>
<Box mb={2}>
<CircleCheck size={24} color="var(--chakra-colors-neutral-800)" />
</Box>
<Text fontWeight="600" textStyle="p" color="neutral.800">
Nothing to see here!
</Text>
<Text textStyle="p2" color="neutral.700" fontWeight="400">
{message}
</Text>
<Box display="flex" gap={3} mt={4}>
<Button
size="sm"
bg="neutral.700"
Comment thread
Yurika-Kan marked this conversation as resolved.
color="white"
_hover={{ bg: 'neutral.800' }}
onClick={() => navigate(primaryButtonLink)}
>
{primaryButtonText}
</Button>
<Button
size="sm"
variant="outline"
borderColor="neutral.200"
color="neutral.700"
_hover={{ bg: 'neutral.50' }}
onClick={() => navigate(secondaryButtonLink)}
>
{secondaryButtonText}
</Button>
</Box>
</Box>
);
};

export default PageEmptyState;
30 changes: 30 additions & 0 deletions apps/frontend/src/components/sectionEmptyState.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Box, Text } from '@chakra-ui/react';

interface EmptyStateProps {
entity?: string;
subtitle?: string;
}

const SectionEmptyState: React.FC<EmptyStateProps> = ({ entity, subtitle }) => {
const message = subtitle ?? `You have no ${entity} at this time`;
return (
<Box
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
textAlign="center"
py={10}
gap={2}
>
<Text fontWeight="600" textStyle="p" color="neutral.800">
Nothing to see here!
</Text>
<Text textStyle="p2" color="neutral.700" fontWeight="400">
{message}
</Text>
</Box>
);
};

export default SectionEmptyState;
Loading
Loading