Skip to content

Commit

Permalink
2024: get it running again
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokareem committed Feb 6, 2024
1 parent a0c21bf commit 1ea79d0
Show file tree
Hide file tree
Showing 14 changed files with 70,438 additions and 12,951 deletions.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodejs 16.15.0
ruby 3.3.0
2 changes: 1 addition & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Credits from "./screens/Credits";

const Stack = createStackNavigator();

export default function App(): JSX.Element {
export default function App(): JSX.Element | null {
const [fontsLoaded] = useFonts({
...Ionicons.font,
...Feather.font,
Expand Down
5 changes: 5 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
},
"android": {
"package": "com.ricokareem.bioenergetics3"
},
"extra": {
"eas": {
"projectId": "0b530a30-c4e0-11e8-a6b0-fdbd974bb46a"
}
}
}
}
10 changes: 10 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@ module.exports = function (api) {
return {
presets: ["@babel/preset-typescript", "babel-preset-expo"],
plugins: ["react-native-reanimated/plugin"],
// compilerOptions: {
// strict: true,
// baseUrl: ".",
// paths: {
// "@components/*": ["./components/*"],
// "@screens/*": ["./screens/*"],
// "@navigation/*": ["./navigation/*"],
// "@media/*": ["./media/*"],
// },
// },
};
};
15 changes: 8 additions & 7 deletions components/MediaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const styles = StyleSheet.create({
},
});

const timeDisplay = ({ remainingTime }) => {
const timeDisplay = ({ remainingTime }: { remainingTime: number }) => {
const minutes = Math.floor(remainingTime / 60);
const seconds = remainingTime % 60;

Expand All @@ -53,9 +53,10 @@ export default function MediaCard({
const [isPlaying, setIsPlaying] = useState(true);
const [currentMovie, setCurrentMovie] = useState(moviePlaylist[0]);
const [nextMovieIndex, setMovieIndex] = useState(1);
const videoRef = useRef<Video>();
const videoRef = useRef() as React.MutableRefObject<Video>;

const videoSourceFile = VideoSourceFiles[currentMovie.file];
const videoSourceFile =
VideoSourceFiles[currentMovie?.file as keyof typeof VideoSourceFiles];

const onPlaybackStatusUpdate = useCallback(
(playbackStatus: AVPlaybackStatus) => {
Expand All @@ -76,14 +77,14 @@ export default function MediaCard({
const onPress = () => {
setIsPlaying(!isPlaying);
if (status.isLoaded && status.isPlaying) {
videoRef.current.pauseAsync();
videoRef.current?.pauseAsync();
} else if (status.isLoaded && !status.isPlaying) {
videoRef.current.playAsync();
videoRef.current?.playAsync();
}
};

useEffect(() => {
videoRef.current.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
videoRef.current?.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
setMovieIndex((i) => i + 1);
}, [currentMovie, onPlaybackStatusUpdate]);

Expand All @@ -104,7 +105,7 @@ export default function MediaCard({
style={styles.backgroundVideo}
onPlaybackStatusUpdate={(newStatus) => setStatus(newStatus)}
/>
<Text style={{ marginBottom: 10 }}>{currentMovie.description}</Text>
<Text style={{ marginBottom: 10 }}>{currentMovie?.description}</Text>
{!!showTimer && (
<>
<CountdownCircleTimer
Expand Down
2 changes: 1 addition & 1 deletion components/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
// @ts-ignore
import styled from "styled-components/native";

export const WhiteContainer = styled.View`
Expand Down
11 changes: 11 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"build": {
"development-simulator": {
"developmentClient": true,
"distribution": "internal",
"ios": {
"simulator": true
}
}
}
}
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install! 'cocoapods',
deterministic_uuids: false

target 'bioenergetics3' do
use_expo_modules!
# use_expo_modules!
config = use_native_modules!

use_frameworks! linkage: podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
Expand Down
11 changes: 6 additions & 5 deletions navigation/TabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from "react";
import { Platform } from "react-native";
import {
NavigationProp,
Route,
RouteProp,
getFocusedRouteNameFromRoute,
} from "@react-navigation/native";
Expand Down Expand Up @@ -31,7 +32,7 @@ type TabBarIconPropType = {

const isAndroid = Platform.OS === "android";

function getHeaderTitle(route) {
function getHeaderTitle(route: Route<string>) {
const routeName = getFocusedRouteNameFromRoute(route) ?? "Main";

switch (routeName) {
Expand Down Expand Up @@ -90,7 +91,7 @@ function TabNavigator({
component={MainScreen}
options={{
tabBarLabel: "Home",
tabBarIcon: ({ focused }) => (
tabBarIcon: ({ focused }: { focused: boolean }) => (
<TabBarIcon iconName="home" focused={focused} />
),
}}
Expand All @@ -100,7 +101,7 @@ function TabNavigator({
component={CardStackScreen}
options={{
tabBarLabel: "Card Stack",
tabBarIcon: ({ focused }) => (
tabBarIcon: ({ focused }: { focused: boolean }) => (
<TabBarIcon iconName="layers" focused={focused} />
),
}}
Expand All @@ -110,7 +111,7 @@ function TabNavigator({
component={ReferenceGuideScreen}
options={{
tabBarLabel: "Symptoms",
tabBarIcon: ({ focused }) => (
tabBarIcon: ({ focused }: { focused: boolean }) => (
<TabBarIcon iconName="book-open" focused={focused} />
),
}}
Expand All @@ -120,7 +121,7 @@ function TabNavigator({
component={InfoScreen}
options={{
tabBarLabel: "Info",
tabBarIcon: ({ focused }) => (
tabBarIcon: ({ focused }: { focused: boolean }) => (
<TabBarIcon
iconName={isAndroid ? "information" : "info"}
focused={focused}
Expand Down
Loading

0 comments on commit 1ea79d0

Please sign in to comment.