Skip to content

Commit 64c67c5

Browse files
fix: Home Screen Responsivesness
1 parent a0c055a commit 64c67c5

File tree

3 files changed

+72
-45
lines changed

3 files changed

+72
-45
lines changed

audire/audire-mobile-app/src/modules/common/FooterView.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ const FooterView = () => {
4949
return (
5050
<Box
5151
borderRadius="$2xl"
52-
position="absolute"
52+
position="$fixed"
5353
w="$full"
54+
$lg-maxWidth="$1/3"
5455
bottom="$0"
5556
display="flex"
5657
flexDirection="row"
5758
justifyContent="space-between"
59+
alignSelf="center"
5860
bg="#D6A8D4"
5961
px="$10"
6062
py="$5"

audire/audire-mobile-app/src/modules/home/HomeView.tsx

+50-38
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const CARD_COLORS = ['#D6A8D4', '#94B6BB', '#FBB6B1', '#FF33D1', '#33D1FF'];
1212
const HomeView = () => {
1313
const {
1414
user: { firstName, optedCourse },
15-
} = useActiveUser()
15+
} = useActiveUser();
1616
const router = useRouter();
1717

1818
useEffect(() => {
@@ -36,43 +36,55 @@ const HomeView = () => {
3636

3737
return (
3838
<Box flex={1} width="$full">
39-
<Text fontSize="$xl" color="black" fontWeight="$bold" ml="$5" py="$5">
40-
Hello {firstName}!
41-
</Text>
42-
<Box bg="white" p="$1.5">
43-
<Image
44-
borderRadius={10}
45-
style={{
46-
resizeMode: 'contain',
47-
width: imageWidth,
48-
height: imageHeight,
49-
}}
50-
alt="homepageBanner"
51-
source={HomePageBanner}
52-
/>
53-
</Box>
54-
<Text fontSize="$xl" color="black" fontWeight="$medium" ml="$5" py="$5">
55-
Choose your stage
56-
</Text>
57-
<Box
58-
display="flex"
59-
flexDirection="row"
60-
justifyContent="space-evenly"
61-
alignItems="center"
62-
borderRadius="$2xl"
63-
>
64-
{optedCourse.stages.map((stage, index) => (
65-
<View
66-
borderRadius="$lg"
67-
key={stage.id}
68-
style={{ backgroundColor: CARD_COLORS[index % CARD_COLORS.length] }}
69-
>
70-
<StageCard
71-
stage={stage.title}
72-
href={`/course-stages/${stage.id}`}
73-
/>
74-
</View>
75-
))}
39+
<Box $lg-pb="$96">
40+
<Text fontSize="$xl" color="black" fontWeight="$bold" ml="$5" py="$5">
41+
Hello {firstName}!
42+
</Text>
43+
<Box bg="white" p="$1.5" maxHeight={dimensions.height / 1.5}>
44+
<Image
45+
borderRadius={10}
46+
maxHeight="$full"
47+
resizeMode="cover"
48+
$md-resizeMode="cover"
49+
style={{
50+
width: imageWidth,
51+
height: imageHeight,
52+
}}
53+
alt="homepageBanner"
54+
source={HomePageBanner}
55+
/>
56+
</Box>
57+
<Text fontSize="$xl" color="black" fontWeight="$medium" ml="$5" py="$5">
58+
Choose your stage
59+
</Text>
60+
<Box
61+
display="flex"
62+
gap="$2"
63+
flexDirection="row"
64+
justifyContent="space-evenly"
65+
alignItems="center"
66+
borderRadius="$2xl"
67+
>
68+
{optedCourse.stages.map((stage, index) => (
69+
<View
70+
borderRadius="$lg"
71+
minHeight={dimensions.height - dimensions.height * 0.85}
72+
width="$1/3"
73+
key={stage.id}
74+
display="flex"
75+
justifyContent="center"
76+
alignItems="center"
77+
style={{
78+
backgroundColor: CARD_COLORS[index % CARD_COLORS.length],
79+
}}
80+
>
81+
<StageCard
82+
stage={stage.title}
83+
href={`/course-stages/${stage.id}`}
84+
/>
85+
</View>
86+
))}
87+
</Box>
7688
</Box>
7789
<FooterView />
7890
</Box>

audire/audire-mobile-app/src/modules/home/stage-card/StageCard.tsx

+19-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,34 @@ type StageCardProps = {
1313

1414
const StageCard: FC<StageCardProps> = ({ stage, href }) => {
1515
return (
16-
<Box width={120} height={120} alignItems="center">
16+
<Box>
1717
<Link href={href} asChild>
1818
<TouchableOpacity>
19-
<Box alignItems="center" pt="$3">
19+
<Box
20+
$md-display="flex"
21+
$md-flexDirection="row"
22+
justifyContent="center"
23+
alignItems="center"
24+
>
2025
<Text
2126
color="black"
22-
fontSize="$lg"
27+
sx={{
28+
'@base': {
29+
size: 'xl',
30+
},
31+
'@md': {
32+
size: '2xl',
33+
},
34+
'@xl': {
35+
size: '6xl',
36+
},
37+
}}
2338
fontWeight="$medium"
24-
justifyContent="center"
25-
alignItems="center"
2639
>
2740
{stage}
2841
</Text>
2942

30-
<Box pt="$10" ml="$10">
43+
<Box>
3144
<Icon as={ArrowRightIcon} color="#B051AE" m="$2" w="$6" h="$6" />
3245
</Box>
3346
</Box>

0 commit comments

Comments
 (0)