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

chore(merging old files): commit to merge old event and gallery files #112

Merged
merged 1 commit into from
Feb 16, 2024
Merged
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
6 changes: 1 addition & 5 deletions src/app/(pages)/events/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import {Container, Img, Text, Flex, Center} from '@chakra-ui/react';

Check warning on line 3 in src/app/(pages)/events/page.tsx

View workflow job for this annotation

GitHub Actions / build-and-lint (18.x)

'Flex' is defined but never used

Check warning on line 3 in src/app/(pages)/events/page.tsx

View workflow job for this annotation

GitHub Actions / build-and-lint (18.x)

'Flex' is defined but never used

const Events = () => {
return (
Expand All @@ -24,11 +24,7 @@
</Text>
</Center>
<Center>
<Text
fontWeight="500"
fontSize="4xl"
color="#15997E"
>
<Text fontWeight="500" fontSize="4xl" color="#15997E">
More events coming soon!
</Text>
</Center>
Expand Down
58 changes: 36 additions & 22 deletions src/app/(pages)/gallery/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ const Gallery = () => {
const [loading, setLoading] = useState(false);
const loader = useRef(null);

const skeletons = new Array(9).fill(null).map((_, index) => (
<Skeleton key={index} rounded="lg" height="300px" width="300px" />
));
const skeletons = new Array(9)
.fill(null)
.map((_, index) => (
<Skeleton key={index} rounded="lg" height="300px" width="300px" />
));

const fetchPosts = async (afterParam = null) => {
if (loading) return;
Expand Down Expand Up @@ -94,27 +96,39 @@ const Gallery = () => {
</Box>
<Container maxW="container.lg" py="28">
<SimpleGrid columns={3} spacing={6}>
{posts.length === 0 ? skeletons : posts.map((post, index) => (
<Box
key={`post-${index}`}
ref={loader}
w="300px"
h="300px"
rounded="lg"
overflow="hidden">
<a href={post.permalink} target="_blank" rel="noopener noreferrer">
<Image src={post.media_url}
alt={post.caption}
objectFit="cover"
width="100%"
height="100%" />
</a>
</Box>
))}
{posts.length === 0
? skeletons
: posts.map((post, index) => (
<Box
key={`post-${index}`}
ref={loader}
w="300px"
h="300px"
rounded="lg"
overflow="hidden"
>
<a
href={post.permalink}
target="_blank"
rel="noopener noreferrer"
>
<Image
src={post.media_url}
alt={post.caption}
objectFit="cover"
width="100%"
height="100%"
/>
</a>
</Box>
))}
</SimpleGrid>
</Container>
{loading && <Center>
<Text color="gray">Loading...</Text></Center>}
{loading && (
<Center>
<Text color="gray">Loading...</Text>
</Center>
)}
</Container>
);
};
Expand Down
Loading