Skip to content

Commit be6f9c2

Browse files
committed
fix(typescript): apply fixes to typescript errors
1 parent 46bcfba commit be6f9c2

File tree

18 files changed

+74
-62
lines changed

18 files changed

+74
-62
lines changed

packages/app/Root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function App() {
3737
const { user, setUser } = useUserContext();
3838

3939
const currentSession = async () => {
40-
let accessToken = await SecureStore.getValueFor("accessToken");
40+
const accessToken = await SecureStore.getValueFor("accessToken");
4141
let refreshToken = await SecureStore.getValueFor("refreshToken");
4242

4343
if (!accessToken) {

packages/app/__tests__/GroupScreen.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import { render } from "@testing-library/react-native";
33
import GroupScreen from "@app/screens/group/GroupScreen";
44
import GroupHeader from "@app/components/GroupScreen/GroupHeader";
5+
import { GroupHeaderProps } from "@app/types/Group";
56

67
jest.mock("@expo/vector-icons/Ionicons", () => ({
78
Ionicons: () => null,
@@ -11,7 +12,7 @@ jest.mock("@expo/vector-icons/FontAwesome5", () => ({
1112
FontAwesome5: () => null,
1213
}));
1314

14-
let props: any;
15+
let props: GroupHeaderProps;
1516

1617
describe("GroupScreen Tests", () => {
1718
describe(GroupScreen, () => {

packages/app/__tests__/Login.test.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { render, fireEvent } from "@testing-library/react-native";
33
import LandingScreen from "@app/screens/landing/LandingScreen";
4+
import { LandingScreenNavigationProps } from "@app/types/Landing";
45

56
// Need these to avoid "Cannot use import statement outside a module" error
67
jest.mock("expo-web-browser", () => ({
@@ -13,7 +14,7 @@ jest.mock("expo-constants", () => ({
1314
Constants: () => null,
1415
}));
1516

16-
let props: any;
17+
let props: LandingScreenNavigationProps;
1718
const mockedNavigate = jest.fn();
1819

1920
jest.mock("@react-navigation/native", () => ({
@@ -103,11 +104,8 @@ describe(LandingScreen, () => {
103104
});
104105

105106
it("signup button renders correctly", () => {
106-
const mockNavigation = {
107-
navigate: jest.fn(),
108-
};
109107
const { getByTestId } = render(
110-
<LandingScreen navigation={mockedNavigate} {...props} />
108+
<LandingScreen {...props}/>
111109
);
112110
const signupButton = getByTestId("signupButton");
113111
expect(signupButton).toBeTruthy();

packages/app/components/EventCard/EventCardRegistration.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ const sampleArray = [0, 1, 2, 3];
1010
const BLUE = "#0b91e0";
1111

1212
const styles = StyleSheet.create({
13-
buttonView: {
14-
flex: 7,
15-
justifyContent: "center",
16-
},
1713
button: {
18-
height: 35,
14+
backgroundColor: BLUE,
1915
borderRadius: 5,
16+
height: 35,
2017
marginBottom: 0,
2118
marginLeft: 0,
2219
marginRight: 0,
23-
backgroundColor: BLUE
20+
},
21+
buttonView: {
22+
flex: 7,
23+
justifyContent: "center",
24+
},
25+
container: {
26+
flexDirection: "row",
2427
},
2528
faceView: {
2629
flexDirection: "row",
@@ -35,9 +38,14 @@ export default function EventCardRegistration(
3538
const { register } = props;
3639

3740
return (
38-
<View style={{ flexDirection: "row" }}>
41+
<View style={styles.container}>
3942
<View style={styles.buttonView}>
40-
<Button style={styles.button} fontColor="#ffffff" title="Going" onPress={register} />
43+
<Button
44+
style={styles.button}
45+
fontColor="#ffffff"
46+
title="Going"
47+
onPress={register}
48+
/>
4149
</View>
4250
<View style={styles.faceView}>
4351
{sampleArray.slice(0, 4).map((x) => {

packages/app/components/GroupScreen/GroupTabs.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function GroupTabs(props: GroupTabsProps) {
139139
style={[
140140
styles.blueView,
141141
{ transform: blueViewPosition.getTranslateTransform() },
142-
isAnimationComplete ? { opacity: 0 } : {},
142+
isAnimationComplete ? styles.hide : {},
143143
]}
144144
/>
145145

@@ -164,6 +164,9 @@ const styles = StyleSheet.create({
164164
height: 3,
165165
width: "100%",
166166
},
167+
hide: {
168+
opacity: 0,
169+
},
167170
innerTabView: {
168171
flexDirection: "row",
169172
},

packages/app/components/TextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const TextInput = forwardRef(function textInput(
3737
},
3838
textField: {
3939
alignItems: "flex-start",
40+
borderColor: props.error ? RED : props.borderColor,
4041
flexDirection: "row",
41-
borderColor: props.error ? "#f54242" : props.borderColor,
4242
},
4343
});
4444

packages/app/screens/group/tabs/AboutScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from "react";
22
import { View } from "react-native";
3-
import { AboutScreenProps } from "@app/types/Group";
43

5-
function AboutScreen(props: AboutScreenProps) {
4+
function AboutScreen() { // props: AboutScreenProps --> available in "types"
65
return <View></View>;
76
}
87

packages/app/screens/group/tabs/LeaderboardScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from "react";
22
import { View } from "react-native";
3-
import { LeaderboardScreenProps } from "@app/types/Group";
43

5-
function LeaderboardScreen(props: LeaderboardScreenProps) {
4+
function LeaderboardScreen() { // props: LeaderboardScreenProps --> available in "types"
65
return <View></View>;
76
}
87

packages/app/screens/group/tabs/MembersScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from "react";
22
import { View } from "react-native";
3-
import { MembersScreenProps } from "@app/types/Group";
43

5-
function MembersScreen(props: MembersScreenProps) {
4+
function MembersScreen() { // props: MembersScreenProps --> available in "types"
65
return <View></View>;
76
}
87

packages/app/screens/group/tabs/NewsletterScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { NewsletterScreenProps } from "@app/types/Group";
21
import React from "react";
32
import { View } from "react-native";
43

5-
function NewsletterScreen(props: NewsletterScreenProps) {
4+
function NewsletterScreen() { // props: NewsletterScreenProps --> available in "types"
65
return <View></View>;
76
}
87

0 commit comments

Comments
 (0)