Skip to content

Commit f600daa

Browse files
committed
first commit
0 parents commit f600daa

23 files changed

+14991
-0
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
.kotlin/
14+
*.orig.*
15+
*.jks
16+
*.p8
17+
*.p12
18+
*.key
19+
*.mobileprovision
20+
21+
# Metro
22+
.metro-health-check*
23+
24+
# debug
25+
npm-debug.*
26+
yarn-debug.*
27+
yarn-error.*
28+
29+
# macOS
30+
.DS_Store
31+
*.pem
32+
33+
# local env files
34+
.env*.local
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
app-example

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll": "explicit",
4+
"source.organizeImports": "explicit",
5+
"source.sortMembers": "explicit"
6+
}
7+
}

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Clock Work
2+
3+
Clock Work is a React Native Expo application designed to boost productivity and well-being. It combines four essential features:
4+
- **To-Do List**: Organize your tasks and stay on top of your schedule.
5+
- **Focus Timer**: Use the Pomodoro technique to stay focused and productive.
6+
- **Notes App**: Jot down ideas, reminders, and important information.
7+
- **Relaxation Game**: Take a break and unwind with a simple game, offering a healthy alternative to doomscrolling.
8+
9+
## Features
10+
- Seamless integration of productivity tools in one app.
11+
- User-friendly interface for easy navigation.
12+
- Cross-platform support with Expo.
13+
14+
## Setup and Run Instructions
15+
16+
### Prerequisites
17+
- Node.js installed on your system.
18+
- Expo CLI installed globally (`npm install -g expo-cli`).
19+
- A mobile device or emulator for testing.
20+
21+
### Steps to Setup and Run
22+
23+
1. **Clone the Repository**
24+
```bash
25+
git clone https://github.com/your-repo/clock-work.git
26+
```
27+
28+
2. **Install Dependencies**
29+
```bash
30+
npm install
31+
```
32+
33+
3. **Start the Development Server**
34+
```bash
35+
npx expo start
36+
```
37+
38+
4. **Run on a Device or Emulator**
39+
- Scan the QR code in the Expo Go app (available on iOS and Android).
40+
- Alternatively, use an emulator/simulator to run the app.
41+
42+
Enjoy using Clock Work to enhance your productivity and well-being!

app.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"expo": {
3+
"name": "clock-work",
4+
"slug": "clock-work",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/images/icon.png",
8+
"scheme": "clockwork",
9+
"userInterfaceStyle": "automatic",
10+
"newArchEnabled": true,
11+
"ios": {
12+
"supportsTablet": true
13+
},
14+
"android": {
15+
"adaptiveIcon": {
16+
"foregroundImage": "./assets/images/adaptive-icon.png",
17+
"backgroundColor": "#ffffff"
18+
},
19+
"edgeToEdgeEnabled": true
20+
},
21+
"web": {
22+
"bundler": "metro",
23+
"output": "static",
24+
"favicon": "./assets/images/favicon.png"
25+
},
26+
"plugins": [
27+
"expo-router",
28+
[
29+
"expo-splash-screen",
30+
{
31+
"image": "./assets/images/splash-icon.png",
32+
"imageWidth": 200,
33+
"resizeMode": "contain",
34+
"backgroundColor": "#ffffff"
35+
}
36+
]
37+
],
38+
"experiments": {
39+
"typedRoutes": true
40+
}
41+
}
42+
}

app/_layout.tsx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// app/_layout.tsx
2+
import React from "react";
3+
import { View, Text, TouchableOpacity, StyleSheet, useColorScheme } from "react-native";
4+
import { Stack, useRouter, usePathname } from "expo-router";
5+
import { Ionicons } from "@expo/vector-icons";
6+
import { SafeAreaProvider } from "react-native-safe-area-context";
7+
8+
export default function RootLayout() {
9+
const router = useRouter();
10+
const pathname = usePathname();
11+
const scheme = useColorScheme();
12+
const isDark = scheme === "dark";
13+
14+
// Define colors based on theme
15+
const colors = {
16+
background: isDark ? "#121212" : "#f2f2f2",
17+
card: isDark ? "#1e1e1e" : "#fff",
18+
text: isDark ? "#fff" : "#333",
19+
subtext: isDark ? "#ccc" : "#666",
20+
border: isDark ? "#333" : "#ccc",
21+
accent: "#4caf50",
22+
};
23+
24+
const tabs: { name: string; icon: React.ComponentProps<typeof Ionicons>["name"]; path: "/" | "/focus" | "/notes" | "/game" }[] = [
25+
{ name: "Tasks", icon: "checkbox-outline", path: "/" },
26+
{ name: "Focus", icon: "timer-outline", path: "/focus" },
27+
{ name: "Notes", icon: "document-text-outline", path: "/notes" },
28+
{ name: "Game", icon: "grid-outline", path: "/game" },
29+
];
30+
31+
return (
32+
<SafeAreaProvider>
33+
<Stack screenOptions={{ headerShown: false }} />
34+
35+
{/* Bottom Navigation */}
36+
<View style={[styles.tabBar, { backgroundColor: colors.card, borderTopColor: colors.border }]}>
37+
{tabs.map((tab) => (
38+
<TouchableOpacity
39+
key={tab.path}
40+
style={styles.tabItem}
41+
onPress={() => router.push(tab.path)}
42+
>
43+
<Ionicons
44+
name={tab.icon}
45+
size={24}
46+
color={pathname === tab.path ? colors.accent : colors.subtext}
47+
/>
48+
<Text
49+
style={[
50+
styles.tabText,
51+
{ color: pathname === tab.path ? colors.accent : colors.subtext },
52+
]}
53+
>
54+
{tab.name}
55+
</Text>
56+
</TouchableOpacity>
57+
))}
58+
</View>
59+
</SafeAreaProvider>
60+
);
61+
}
62+
63+
const styles = StyleSheet.create({
64+
tabBar: {
65+
flexDirection: "row",
66+
position: "absolute",
67+
bottom: 0,
68+
left: 0,
69+
right: 0,
70+
height: 70,
71+
borderTopWidth: 1,
72+
paddingBottom: 10,
73+
},
74+
tabItem: {
75+
flex: 1,
76+
alignItems: "center",
77+
justifyContent: "center",
78+
},
79+
tabText: {
80+
fontSize: 12,
81+
marginTop: 4,
82+
},
83+
});

app/context/AppContext.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// context/AppContext.tsx
2+
import React, { createContext, useState, useContext } from 'react';
3+
4+
type AppContextType = {
5+
disabledTabs: string[];
6+
setTabsDisabled: (tabs: string[]) => void;
7+
notifyBreakEnd: () => void;
8+
onBreakEnd: (() => void) | null;
9+
setOnBreakEnd: (callback: (() => void) | null) => void;
10+
gameInProgress: boolean;
11+
setGameInProgress: (inProgress: boolean) => void;
12+
};
13+
14+
const AppContext = createContext<AppContextType>({
15+
disabledTabs: [],
16+
setTabsDisabled: () => {},
17+
notifyBreakEnd: () => {},
18+
onBreakEnd: null,
19+
setOnBreakEnd: () => {},
20+
gameInProgress: false,
21+
setGameInProgress: () => {},
22+
});
23+
24+
export const AppProvider = ({ children }: { children: React.ReactNode }) => {
25+
const [disabledTabs, setDisabledTabs] = useState<string[]>([]);
26+
const [onBreakEnd, setOnBreakEnd] = useState<(() => void) | null>(null);
27+
const [gameInProgress, setGameInProgress] = useState<boolean>(false);
28+
29+
const setTabsDisabled = (tabs: string[]) => {
30+
setDisabledTabs(tabs);
31+
};
32+
33+
const notifyBreakEnd = () => {
34+
if (onBreakEnd) {
35+
onBreakEnd();
36+
}
37+
};
38+
39+
return (
40+
<AppContext.Provider
41+
value={{
42+
disabledTabs,
43+
setTabsDisabled,
44+
notifyBreakEnd,
45+
onBreakEnd,
46+
setOnBreakEnd,
47+
gameInProgress,
48+
setGameInProgress,
49+
}}
50+
>
51+
{children}
52+
</AppContext.Provider>
53+
);
54+
};
55+
56+
export { AppContext };
57+
export const useAppContext = () => useContext(AppContext);

0 commit comments

Comments
 (0)