Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit ccf5821

Browse files
author
Adrian Podkalicki
committed
fix(website): change buttons sizes on mobile (#337)
1 parent e1801d7 commit ccf5821

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

packages/website/src/components/Benefits/Benefits.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const rolledUpProfitButton = {
2929

3030
export const Benefits = ({ title, benefitItems, shrinkSize }: BenefitsProps) => {
3131
const columnsCount = useBreakpointValue({ base: 1, md: 2, xl: 3 } as const);
32-
const profitButtonSize = useBreakpointValue({ base: 'sm', md: 'lg' } as const);
32+
const profitButtonSize = useBreakpointValue({ base: 'md', sm: 'md', md: 'lg' } as const);
3333

3434
const [isExpanded, setIsExpanded] = useState(false);
3535
const benefitTitleRef = useRef<HTMLDivElement>(null);

packages/website/src/components/Hero.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import { externalLinkBaseProps } from './ExternalLink';
1212
export const Hero = () => {
1313
const { openModal } = useRecruitmentModal();
1414

15-
const buttonSize = useBreakpointValue({ base: 'sm', sm: 'md', md: 'lg' } as const);
16-
const buttonsStackDirection = useBreakpointValue({ base: 'column', md: 'row' } as const);
15+
const buttonSize = useBreakpointValue({ base: 'md', sm: 'md', md: 'lg' } as const);
16+
const buttonsStackDirection = useBreakpointValue({ base: 'column', sm: 'row' } as const);
17+
const buttonWidth = useBreakpointValue({ md: 'min(280px, 75vw)' } as const);
1718

1819
const mainHeaderSize = { base: '4xl', sm: '6xl', md: '7xl', xl: '8xl' } as const;
1920
const subheaderSize = { base: 'md', sm: 'xl', md: '2xl' } as const;
20-
const buttonProps = { size: buttonSize, width: 'min(280px, 75vw)' } as const;
21+
const buttonProps = { size: buttonSize, width: buttonWidth } as const;
2122

2223
return (
2324
<Flex justify="center" width="100%" p={{ base: '32px 16px 64px', lg: '120px 64px 160px' }}>

packages/website/src/components/MentorPerspective.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MENTORS_GUIDE_URL } from '@/constants';
99
import { Section } from './Section';
1010

1111
export const MentorPerspective = () => {
12-
const downloadSize = useBreakpointValue({ base: 'sm', sm: 'lg' } as const, 'base');
12+
const downloadSize = useBreakpointValue({ base: 'md', sm: 'md', md: 'lg' } as const, 'base');
1313

1414
return (
1515
<Section spacing="32px" backgroundColor="gray.50">

packages/website/src/components/Projects/ProjectCard.tsx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ import { Project } from './Projects.data';
1212

1313
interface ProjectCardProps {
1414
project: Project;
15-
isSmallMobile: boolean;
1615
}
1716

18-
const buttonProps = {
19-
...externalLinkBaseProps,
20-
as: 'a',
21-
variant: 'solid',
22-
color: 'default',
23-
flex: 1,
24-
size: 'sm',
25-
} as const;
17+
export const ProjectCard = ({ project }: ProjectCardProps) => {
18+
const buttonHasIcon = useBreakpointValue({ base: true, md: true, lg: true });
19+
const buttonsDirection = useBreakpointValue({ base: 'column', sm: 'row', md: 'column', lg: 'row' } as const);
20+
const buttonSize = useBreakpointValue({ base: 'md', sm: 'md', md: 'sm' } as const);
2621

27-
export const ProjectCard = ({ project, isSmallMobile }: ProjectCardProps) => {
28-
const buttonHasIcon = useBreakpointValue({ base: true, md: false, lg: true });
22+
const buttonProps = {
23+
...externalLinkBaseProps,
24+
as: 'a',
25+
variant: 'solid',
26+
color: 'default',
27+
size: buttonSize,
28+
width: 'max(164px)',
29+
} as const;
2930

3031
return (
3132
<Flex direction="column" p="24px" h="100%" border="1px solid" borderColor="gray.300" borderRadius="8px">
@@ -37,7 +38,14 @@ export const ProjectCard = ({ project, isSmallMobile }: ProjectCardProps) => {
3738
{project.description}
3839
</Typography>
3940
</VStack>
40-
<Stack spacing="12px" width="100%" pt="32px" mt="auto" direction={isSmallMobile ? 'column' : 'row'}>
41+
<Stack
42+
spacing="12px"
43+
pt="32px"
44+
mt="auto"
45+
justifyContent="center"
46+
alignItems="center"
47+
direction={buttonsDirection}
48+
>
4149
<Button {...buttonProps} href={project.gitHubUrl} icon={buttonHasIcon ? <SolidGitHubIcon /> : undefined}>
4250
Zobacz kod
4351
</Button>

packages/website/src/components/Projects/ProjectsCarousel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const ProjectsCarousel = () => {
4444
>
4545
{projects.map((project) => (
4646
<SwiperSlide key={project.name}>
47-
<ProjectCard project={project} isSmallMobile={isSmallMobile} />
47+
<ProjectCard project={project} />
4848
</SwiperSlide>
4949
))}
5050
</Swiper>

0 commit comments

Comments
 (0)