Skip to content

Commit 780b21f

Browse files
Merge branch 'master' into remove-top-bar-in-mcq-page
2 parents a70f445 + e569729 commit 780b21f

File tree

6 files changed

+181
-34
lines changed

6 files changed

+181
-34
lines changed
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Bump Audire App Version
2+
run-name: Bump to Version ${{ github.event.inputs.version }}
3+
4+
permissions:
5+
contents: write
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Version'
12+
required: true
13+
type: string
14+
ios_build_number:
15+
description: 'iOS Build Number'
16+
required: true
17+
type: number
18+
android_version_code:
19+
description: 'Android Version Code'
20+
required: true
21+
type: number
22+
23+
jobs:
24+
bump-version:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Verify version
32+
run: |
33+
if [[ ! "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
34+
echo "Version must be in the format of x.y.z. Received: ${{ github.event.inputs.version }}"
35+
exit 1
36+
fi
37+
38+
- name: Bump version in app.json
39+
run: |
40+
NEW_VERSION="${{ github.event.inputs.version }}"
41+
sed -i 's/"version": "[^"]*"/"version": "'$NEW_VERSION'"/g' audire/audire-mobile-app/app.json
42+
43+
- name: Bump iOS Build Number in app.json
44+
run: |
45+
NEW_BUILD_NUMBER="${{ github.event.inputs.ios_build_number }}"
46+
sed -i 's/"buildNumber": "[^"]*"/"buildNumber": "'$NEW_BUILD_NUMBER'"/g' audire/audire-mobile-app/app.json
47+
48+
- name: Bump Android Version Code in app.json
49+
run: |
50+
NEW_VERSION_CODE="${{ github.event.inputs.android_version_code }}"
51+
sed -i 's/"versionCode": [0-9]*,/"versionCode": '$NEW_VERSION_CODE',/g' audire/audire-mobile-app/app.json
52+
53+
- name: Commit and push
54+
run: |
55+
git config --local user.email "action@github.com"
56+
git config --local user.name "GitHub Action"
57+
git commit -am "chore: Bump Audire ExpoApp to v${{ github.event.inputs.version }}"
58+
git push

.github/workflows/pr_review.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Lint & Build
2+
3+
# Needed for nx-set-shas when run on the main branch
4+
permissions:
5+
actions: read
6+
contents: read
7+
8+
on:
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
# Cache node_modules
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: 20
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- uses: nrwl/nx-set-shas@v3
32+
# This line is needed for nx affected to work when CI is running on a PR
33+
- run: git branch --track master origin/master
34+
35+
- name: Run Linter
36+
run: npx nx affected --target=lint
37+
38+
build:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
46+
# Cache node_modules
47+
- uses: actions/setup-node@v3
48+
with:
49+
node-version: 20
50+
cache: 'npm'
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- uses: nrwl/nx-set-shas@v3
56+
# This line is needed for nx affected to work when CI is running on a PR
57+
- run: git branch --track master origin/master
58+
59+
- name: Run Build
60+
run: npx nx affected --target=build

audire/audire-mobile-app/src/modules/common/sidebar/Sidebar.tsx

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import React, { FC, useEffect } from 'react';
22
import { Pressable, StyleSheet } from 'react-native';
3-
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming, } from 'react-native-reanimated';
3+
import Animated, {
4+
Easing,
5+
useAnimatedStyle,
6+
useSharedValue,
7+
withTiming,
8+
} from 'react-native-reanimated';
49
import SidebarContent from './SidebarContent';
510

611
type SidebarProps = {
712
isOpen: boolean;
813
setIsOpen: (isOpen: boolean) => void;
9-
}
14+
};
1015

1116
const animConfig = {
1217
duration: 500,
@@ -16,7 +21,7 @@ const animConfig = {
1621
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
1722

1823
const Sidebar: FC<SidebarProps> = ({ isOpen, setIsOpen }) => {
19-
const drawerPosition = useSharedValue(-250); // Assuming drawer width of 250
24+
const drawerPosition = useSharedValue(-250); // Assuming drawer width of 250.
2025

2126
const drawerStyle = useAnimatedStyle(() => {
2227
return {
@@ -34,7 +39,7 @@ const Sidebar: FC<SidebarProps> = ({ isOpen, setIsOpen }) => {
3439

3540
useEffect(() => {
3641
toggleDrawer();
37-
}, [isOpen])
42+
}, [isOpen]);
3843

3944
const toggleDrawer = () => {
4045
drawerPosition.value = withTiming(isOpen ? 0 : -250, animConfig);
@@ -43,10 +48,13 @@ const Sidebar: FC<SidebarProps> = ({ isOpen, setIsOpen }) => {
4348
return (
4449
<>
4550
<Animated.View style={[styles.drawer, drawerStyle]}>
46-
<SidebarContent />
51+
<SidebarContent onClose={() => setIsOpen(false)} />
4752
</Animated.View>
4853

49-
<AnimatedPressable style={[styles.overlay, overlayStyle]} onPress={() => setIsOpen(false)} />
54+
<AnimatedPressable
55+
style={[styles.overlay, overlayStyle]}
56+
onPress={() => setIsOpen(false)}
57+
/>
5058
</>
5159
);
5260
};

audire/audire-mobile-app/src/modules/common/sidebar/SidebarContent.tsx

+34-10
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,30 @@ type Option = {
2222
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2323
icon: any;
2424
};
25-
26-
type SidebarContentProps = {};
25+
type SidebarContentProps = { onClose: () => void };
2726

2827
const options: Option[] = [
2928
{
3029
name: 'Home',
3130
link: '/',
3231
icon: GripVerticalIcon,
32+
disabled: false,
33+
},
34+
{ name: 'Exams', link: '/exams', icon: ClockIcon, disabled: false },
35+
{
36+
name: 'Notifications',
37+
link: '/profile/notifications',
38+
icon: BellIcon,
39+
disabled: false,
3340
},
34-
{ name: 'Exams', link: '/exams', icon: ClockIcon },
35-
{ name: 'Notifications', link: '/profile/notifications', icon: BellIcon },
3641
{ name: 'Payments', link: '', icon: CheckCircleIcon, disabled: true },
37-
{ name: 'Settings', link: '/profile/profile', icon: SettingsIcon },
42+
{
43+
name: 'Settings',
44+
link: '/profile/profile',
45+
icon: SettingsIcon,
46+
disabled: false,
47+
},
3848
];
39-
4049
const SidebarContent: FC<SidebarContentProps> = (props) => {
4150
const {
4251
user: { firstName },
@@ -46,7 +55,12 @@ const SidebarContent: FC<SidebarContentProps> = (props) => {
4655
const { top } = useSafeAreaInsets();
4756

4857
return (
49-
<Box display="flex" flexDirection="column" bg="white" style={{ paddingTop: top, height: '100%' }}>
58+
<Box
59+
display="flex"
60+
flexDirection="column"
61+
bg="white"
62+
style={{ paddingTop: top, height: '100%' }}
63+
>
5064
<Box overflow="hidden" width="100%">
5165
<Box display="flex" flexDirection="row" p="$5">
5266
<Avatar bgColor="#D6A8D4" size="lg" borderRadius="$full">
@@ -69,8 +83,13 @@ const SidebarContent: FC<SidebarContentProps> = (props) => {
6983
</Box>
7084
<Box mt="$10" pl="$5">
7185
{options.map((option) => (
72-
<Link key={option.name} href={option.link} disabled={options.disabled} asChild>
73-
<TouchableOpacity>
86+
<Link
87+
key={option.name}
88+
href={option.link}
89+
disabled={options.disabled}
90+
asChild
91+
>
92+
<TouchableOpacity onPress={props.onClose}>
7493
<Box
7594
display="flex"
7695
flexDirection="row"
@@ -87,7 +106,11 @@ const SidebarContent: FC<SidebarContentProps> = (props) => {
87106
color={option.disabled ? 'gray' : 'black'}
88107
/>
89108
)}
90-
<Text fontSize="$lg" color={option.disabled ? 'gray' : 'black'} fontWeight="$bold">
109+
<Text
110+
fontSize="$lg"
111+
color={option.disabled ? 'gray' : 'black'}
112+
fontWeight="$bold"
113+
>
91114
{option.name}
92115
</Text>
93116
</Box>
@@ -97,6 +120,7 @@ const SidebarContent: FC<SidebarContentProps> = (props) => {
97120
<Box h={0.3} backgroundColor="black" m={17}></Box>
98121
<TouchableOpacity
99122
onPress={() => {
123+
props.onClose();
100124
setShowModal(true);
101125
}}
102126
>

audire/audire-mobile-app/src/modules/course-topic/VideoComponent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const VideoComponent: FC<VideoComponentProps> = (props) => {
7474

7575
return (
7676
<Box
77-
width="$full"
77+
mx={17}
7878
display="flex"
7979
alignItems="center"
8080
justifyContent="center"

audire/audire-mobile-app/src/modules/mcq-exams/Congratulations.tsx

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { ComponentProps, FC } from 'react';
22
import { CloseIcon } from '@gluestack-ui/themed';
3+
import { router } from 'expo-router';
34
import {
45
Heading,
56
Box,
@@ -11,6 +12,7 @@ import {
1112
ModalBody,
1213
ModalFooter,
1314
Text,
15+
Center,
1416
} from '@gluestack-ui/themed';
1517
import Congratulations from '/assets/Congratulations.svg';
1618

@@ -37,26 +39,21 @@ const CongratulationsDialog: FC<AllQuestionsProps> = (props) => {
3739
<ModalBackdrop />
3840
<ModalContent>
3941
<ModalHeader>
40-
<Heading></Heading>
41-
<ModalCloseButton>
42+
<Heading fontSize="$2xl">Congratulations!</Heading>
43+
<ModalCloseButton
44+
onPress={() => {
45+
router.replace('/');
46+
props.onClose();
47+
}}
48+
>
4249
<CloseIcon size="sm" />
4350
</ModalCloseButton>
4451
</ModalHeader>
45-
<ModalBody pt="$7">
46-
<Box
47-
display="flex"
48-
flexDirection="row"
49-
flexWrap="wrap"
50-
gap="$1"
51-
justifyContent="center"
52-
>
53-
<Heading pb="$7" fontSize="$2xl">
54-
Congratulations!
55-
</Heading>
56-
<Box>
57-
<Congratulations />
58-
</Box>
59-
</Box>
52+
<ModalBody>
53+
<Center>
54+
<Congratulations />
55+
</Center>
56+
6057
<Box
6158
display="flex"
6259
flexDirection="column"

0 commit comments

Comments
 (0)