Skip to content

Commit

Permalink
Merge pull request #428 from bounswe/mobile
Browse files Browse the repository at this point in the history
Mobile Merge to Main
  • Loading branch information
aoengin authored Oct 22, 2024
2 parents 3ecbaba + b7d9a85 commit 64209d7
Show file tree
Hide file tree
Showing 35 changed files with 23,453 additions and 0 deletions.
41 changes: 41 additions & 0 deletions mobile/bulingo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
49 changes: 49 additions & 0 deletions mobile/bulingo/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"expo": {
"name": "bulingo",
"slug": "bulingo",
"version": "0.1.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.anil24.searchitect",
"softwareKeyboardLayoutMode": "pan"
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
"expo-font"
],
"experiments": {
"typedRoutes": true
},
"extra": {
"router": {
"origin": false
},
"eas": {
}
}
}
}
49 changes: 49 additions & 0 deletions mobile/bulingo/app/TokenManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// TokenManager.ts

// Define an interface for the tokens
interface Tokens {
accessToken: string | null;
refreshToken: string | null;
}

class TokenManager {
private tokens: Tokens;
private username: string | null;

constructor() {
this.tokens = {
accessToken: null,
refreshToken: null,
};
this.username = null;
}

// Method to set tokens
setTokens(tokens: Tokens): void {
this.tokens = tokens;
}

// Method to get tokens
getTokens(): Tokens {
return this.tokens;
}

setUsername(username: string|null): void {
this.username = username;
}

getUsername(): string|null {
return this.username;
}

// Method to clear tokens
clearTokens(): void {
this.tokens = {
accessToken: null,
refreshToken: null,
};
}
}

// Export a single instance of TokenManager
export default new TokenManager();
30 changes: 30 additions & 0 deletions mobile/bulingo/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Stack } from 'expo-router';

export default function Layout() {

console.log("Layout run")
return (
<Stack
screenOptions={{
headerStyle: {
backgroundColor: '#f4511e',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
}}>
<Stack.Screen name="quizFeed" options={{headerShown: false}} />

<Stack.Screen name="register" options={{headerShown: false}} />
<Stack.Screen name="quizDetails" options={{headerShown: false}} />
<Stack.Screen name="login" options={{headerShown: false}}/>
<Stack.Screen name="quizResults" options={{headerShown: false}}/>
<Stack.Screen name="index" options={{headerShown: false}}/>
<Stack.Screen name="quizQuestion" options={{headerShown: false}}/>
<Stack.Screen name="quizCreationQuestionList" options={{headerShown: false}}/>
<Stack.Screen name="quizCreationSettings" options={{headerShown: false}}/>
<Stack.Screen name="quizCreationInfo" options={{headerShown: false}}/>
</Stack>
);
}
Loading

0 comments on commit 64209d7

Please sign in to comment.