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

Collapse all branches to a main branch #295

Merged
merged 27 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ded3e8d
fix(ui): update alphabet filter's layout on scroll
kaf-lamed-beyt Feb 23, 2024
a86cae1
minor
kaf-lamed-beyt Feb 23, 2024
0f305f9
Merge pull request #287 from kaf-lamed-beyt/web-dev
acekyd Feb 25, 2024
13042d2
First drafts
acekyd Mar 2, 2024
a0ab585
fix broken image
acekyd Mar 2, 2024
ec7f428
fix: image shrinkage with objectFit
kaf-lamed-beyt Mar 3, 2024
4832508
Merge pull request #291 from kaf-lamed-beyt/web-dev
acekyd Mar 3, 2024
2acc963
Add metadata
acekyd Mar 3, 2024
04ab274
feat: add authors project component
kaf-lamed-beyt Mar 3, 2024
00e57f9
Merge branch 'web-dev' of https://github.com/acekyd/made-in-nigeria i…
kaf-lamed-beyt Mar 3, 2024
4fd78fa
chore: fix excessive padding on device breakpoints
kaf-lamed-beyt Mar 3, 2024
dd26885
Update article components
acekyd Mar 3, 2024
a9b1790
Merge pull request #292 from kaf-lamed-beyt/web-dev
acekyd Mar 3, 2024
bcd7863
feat: fix alphabet filter to top on scroll
kaf-lamed-beyt Mar 3, 2024
ea5d23b
Merge branch 'web-dev' of https://github.com/acekyd/made-in-nigeria i…
kaf-lamed-beyt Mar 3, 2024
aa9f1d5
chore: refactor layouts
kaf-lamed-beyt Mar 3, 2024
3cb2bbd
Merge pull request #293 from kaf-lamed-beyt/web-dev
acekyd Mar 4, 2024
e55b7cc
chore: refactor page layout styles
kaf-lamed-beyt Mar 4, 2024
224a417
Merge pull request #294 from kaf-lamed-beyt/web-dev
acekyd Mar 6, 2024
9bffa12
Add Shedrack article
acekyd Mar 6, 2024
c5de246
Add Shedrack article
acekyd Mar 6, 2024
d14289a
Add Shedrack article
acekyd Mar 6, 2024
bc536ff
simple cleanups
acekyd Mar 6, 2024
7008348
Add Omolara's article
acekyd Mar 6, 2024
6217f9c
Update emisho links
acekyd Mar 6, 2024
1464682
Merge pull request #260 from acekyd/web-dev
acekyd Mar 6, 2024
2da32fb
fix creators social card
acekyd Mar 6, 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
161 changes: 100 additions & 61 deletions app/components/AlphabetFilter/AlphabetFilter.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
import { ChevronUpIcon, ChevronDownIcon } from '@chakra-ui/icons';
import { Button, Center, SimpleGrid, Flex } from '@chakra-ui/react';
import React, {useState} from 'react';
import { ChevronUpIcon, ChevronDownIcon } from "@chakra-ui/icons";
import { Button, Center, SimpleGrid, Flex } from "@chakra-ui/react";

const AlphabetFilter = ({selectedLetter, setSelectedLetter, isMobile = false, isExpanded, setIsExpanded}) => {
const AlphabetFilter = ({
selectedLetter,
setSelectedLetter,
isMobile = false,
isExpanded,
setIsExpanded,
}) => {
const visibleChar = isMobile && !isExpanded ? 7 : 26;
const alphabetsCharCodes = Array.from(Array(visibleChar)).map((element, index) => index + 65);
const alphabetsCharCodes = Array.from(Array(visibleChar)).map(
(element, index) => index + 65
);
const filterAlphabetsStrings = alphabetsCharCodes.map((charCode) =>
String.fromCharCode(charCode)
String.fromCharCode(charCode)
);

// custom code for merging
const gridClasses = {};

const filterProjects = (letter) => {
if(letter === selectedLetter) {
setSelectedLetter('')
if (letter === selectedLetter) {
setSelectedLetter("");
} else {
setSelectedLetter(letter);
}
Expand All @@ -29,75 +36,107 @@ const AlphabetFilter = ({selectedLetter, setSelectedLetter, isMobile = false, is
setIsExpanded(true);
};

if(setIsExpanded) {
if (setIsExpanded) {
gridClasses.borderBottom = "0.5px solid #E2E3E3";
gridClasses.pb = "1rem";
gridClasses.width = "100vw";
gridClasses.height = "280px";
}

const collapseCode = isExpanded ? (
<Center
borderX="1px solid #E2E3E3"
justifyContent="center"
alignItems="center"
cursor="pointer"
>
<Button background="none" padding={0} _hover={{ background: '#f4f4f4' }} onClick={collapse}>
<ChevronUpIcon color="#B8BAB9" boxSize="1.5rem" />
</Button>
</Center>
) : '';
borderX="1px solid #E2E3E3"
justifyContent="center"
alignItems="center"
cursor="pointer"
>
<Button
background="none"
padding={0}
_hover={{ background: "#f4f4f4" }}
onClick={collapse}
>
<ChevronUpIcon color="#B8BAB9" boxSize="1.5rem" />
</Button>
</Center>
) : (
""
);

if(isMobile && !isExpanded) {
if (isMobile && !isExpanded) {
return (
<Center borderBottom="0.5px solid #E2E3E3" pb="1rem" width="100vw" background="#FFFFFF">
<Flex gap="3px">
{filterAlphabetsStrings.map((letter) => (
<Center key={letter} borderLeft="0.5px solid #E2E3E3" padding="0 0.2rem">
<Button
background="none"
padding={0}
style={{ backgroundColor: letter === selectedLetter && '#f4f4f4' }}
color="#B8BAB9"
fontWeight="800"
_hover={{ background: '#f4f4f4' }}
onClick={() => filterProjects(letter)}
>
{letter}
</Button>
</Center>
))}

<Center borderLeft="0.5px solid #E2E3E3" padding="0 0.2rem">
<Button background="none" padding={0} _hover={{ background: '#f4f4f4' }} onClick={expand}>
<ChevronDownIcon color="#B8BAB9" boxSize="1.5rem" />
<Center
borderBottom="0.5px solid #E2E3E3"
pb="1rem"
width="100vw"
background="#FFFFFF"
>
<Flex gap="3px">
{filterAlphabetsStrings.map((letter) => (
<Center
key={letter}
borderLeft="0.5px solid #E2E3E3"
padding="0 0.2rem"
height="fit-content"
>
<Button
background="none"
padding={0}
style={{
backgroundColor: letter === selectedLetter && "#f4f4f4",
}}
color="#B8BAB9"
fontWeight="800"
_hover={{ background: "#f4f4f4" }}
onClick={() => filterProjects(letter)}
>
{letter}
</Button>
</Center>
</Flex>
</Center>
))}

<Center borderLeft="0.5px solid #E2E3E3" padding="0 0.2rem">
<Button
background="none"
padding={0}
_hover={{ background: "#f4f4f4" }}
onClick={expand}
>
<ChevronDownIcon color="#B8BAB9" boxSize="1.5rem" />
</Button>
</Center>
</Flex>
</Center>
);
}

return (
<SimpleGrid columns={{ base: 8, md: 26 }} rowGap={6} background="#FFFFFF" mt="0.5rem" pt="2rem" {...gridClasses}>
{filterAlphabetsStrings.map((letter) => (
<Center key={letter} borderLeft="1px solid #E2E3E3" padding="0rem 1rem">
<Button
background="none"
style={{ backgroundColor: letter === selectedLetter && '#f4f4f4' }}
color="#B8BAB9"
fontWeight="800"
_hover={{ background: '#f4f4f4' }}
onClick={() => filterProjects(letter)}
>
{letter}
</Button>
</Center>
))}
<SimpleGrid
columns={{ base: 8, md: 26 }}
rowGap={6}
background="#FFFFFF"
mt="0.5rem"
pt="2rem"
{...gridClasses}
>
{filterAlphabetsStrings.map((letter) => (
<Center key={letter} borderLeft="1px solid #E2E3E3" padding="0rem 1rem">
<Button
background="none"
style={{ backgroundColor: letter === selectedLetter && "#f4f4f4" }}
color="#B8BAB9"
fontWeight="800"
_hover={{ background: "#f4f4f4" }}
onClick={() => filterProjects(letter)}
>
{letter}
</Button>
</Center>
))}

{collapseCode}
</SimpleGrid>
{collapseCode}
</SimpleGrid>
);
};

export default AlphabetFilter;
export default AlphabetFilter;
2 changes: 2 additions & 0 deletions app/components/Blog/ArticleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const ArticleCard = ({ image, slug, title, excerpt }: CardProps) => {
borderRadius="8px 8px 0 0"
alt={`${title}'s cover image`}
height="280px"
objectFit="cover"
objectPosition={{ lg: "top", base: "top" }}
/>
<Text
color="#292F2E"
Expand Down
10 changes: 5 additions & 5 deletions app/components/Blog/ArticleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ export const ArticleList = ({ data }: ArticleProps) => {
ml="1.2rem"
textTransform="capitalize"
>
all articles
all creators
</Heading>

{filteredArticles.length === 0 ? (
<Text textAlign="center" fontSize="16px" my="3rem" px="1.2rem">
We couldn&apos;t find any article with this title:
We couldn&apos;t find any creators with this title:
<Text as="span" color="#008463">
{searchTerm}
</Text>
Expand Down Expand Up @@ -110,14 +110,14 @@ export const ArticleList = ({ data }: ArticleProps) => {
<SecondaryButton
link=""
type="button"
text="load more articles"
text="load more creators"
onClick={onLoadMoreArticles}
/>
) : (
<Text>You&apos;re at the end of our articles list</Text>
<Text>You&apos;re at the end of our creators list</Text>
)}

<Box my="10rem">{/* <BlogNewsletter /> */}</Box>
<Box>{/* <BlogNewsletter /> */}</Box>
</Flex>
</Box>
);
Expand Down
4 changes: 3 additions & 1 deletion app/components/Blog/BlogPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ export const BlogPost = ({
mb="8rem"
flexFlow="column"
justifyContent="center"
px={{ base: ".5rem", md: "22rem", lg: "32rem" }}
mt={{ base: "-8rem", md: "-8rem", lg: "-20rem" }}
px={{ base: ".5rem", md: "8rem", lg: "12rem", xl: "32rem" }}
>
<Image
height={{ lg: "592px", base: "100%" }}
alt="cover image"
src={coverImage}
objectFit="cover"
objectPosition={{ lg: "top", base: "top" }}
/>
<Box>
<Text
Expand Down
4 changes: 2 additions & 2 deletions app/components/BlogHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const BlogHero = ({ onChange }: BlogHeroProps) => {
width={{
base: "22.875rem",
sm: "22.875rem",
md: "22.875rem",
lg: "74.938rem",
md: "44.875rem",
lg: "58.938rem",
xl: "74.938rem",
"2xl": "74.938rem",
}}
Expand Down
4 changes: 2 additions & 2 deletions app/components/ProjectsHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const ProjectsHero = ({ onChange }: ProjectsHeroProps) => {
width={{
base: "22.875rem",
sm: "22.875rem",
md: "22.875rem",
lg: "74.938rem",
md: "44.875rem",
lg: "58.938rem",
xl: "74.938rem",
"2xl": "74.938rem",
}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/SearchArticles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SearchArticles = ({ onChange }: SearchProps) => {
<Image src={SearchIcon.src} w="1.2rem" height="1.2rem" alt="" />
<Input
variant="unstyled"
placeholder="Search Articles"
placeholder="Search Creators"
onChange={(e) => onChange(e)}
_placeholder={{ color: "#B8BAB9", fontSize: "sm" }}
/>
Expand Down
21 changes: 12 additions & 9 deletions app/components/featured-articles/feature-article-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
width={{
base: "22.875rem",
sm: "22.875rem",
md: "22.875rem",
md: "44.8rem",
lg: "36.5rem",
xl: "36.5rem",
"2xl": "36.5rem",
Expand All @@ -21,7 +21,7 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
sm: "28.688rem",
md: "28.688rem",
lg: "42.438rem",
xl: "42.438rem",
// xl: "42.438rem",
"2xl": "42.438rem",
}}
padding={{ base: 5, sm: 5, md: 5, lg: 6, xl: 6, "2xl": 6 }}
Expand All @@ -35,7 +35,7 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
width={{
base: "20.375rem",
sm: "20.375rem",
md: "20.375rem",
md: "44.375rem",
lg: "33.5rem",
xl: "33.5rem",
"2xl": "33.5rem",
Expand All @@ -57,10 +57,12 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
</Box>
<Link href={`/creators/${slug}`} as={NextLink}>
<Text
my={{ md: ".5em", xl: "0", lg: "0", base: "0" }}
px={{ md: ".5em", xl: "0", lg: "0", base: "0" }}
width={{
base: "20.375rem",
sm: "20.375rem",
md: "20.375rem",
md: "44.375rem",
lg: "33.5rem",
xl: "33.5rem",
"2xl": "33.5rem",
Expand All @@ -76,7 +78,7 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
fontSize={{
base: "1rem",
sm: "1rem",
md: "1rem",
md: "1.8rem",
lg: "1.5rem",
xl: "1.5rem",
"2xl": "1.5rem",
Expand All @@ -85,7 +87,7 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
lineHeight={{
base: "1.75rem",
sm: "1.75rem",
md: "1.75rem",
md: "2rem",
lg: "2rem",
xl: "2rem",
"2xl": "2rem",
Expand All @@ -96,10 +98,11 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
</Text>
</Link>
<Text
px={{ md: ".9em", xl: "0", lg: "0", base: "0" }}
width={{
base: "20.375rem",
sm: "20.375rem",
md: "20.375rem",
md: "44.375rem",
lg: "33.5rem",
xl: "33.5rem",
"2xl": "33.5rem",
Expand All @@ -115,10 +118,10 @@ const FeaturedArticleMain = ({ image, slug, title, excerpt }: CardProps) => {
fontSize={{
base: "0.875rem",
sm: "0.875rem",
md: "0.875rem",
md: "1rem",
lg: "1rem",
xl: "1rem",
"2xl": "1rem",
"2xl": "1.1rem",
}}
lineHeight="1.75rem"
color="#949796"
Expand Down
1 change: 1 addition & 0 deletions app/components/featured-articles/feature-article-other.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const FeatureArticleOther = ({ slug, title, image, excerpt }: CardProps) => {
"2xl": 8,
}}
objectFit="cover"
objectPosition={{ lg: "top", base: "top" }}
/>

<VStack width={{ lg: "22.188rem", xl: "22.188rem", "2xl": "22.188rem" }}>
Expand Down
Loading