Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# macOS
.DS_Store

# Node / Expo
node_modules/
*.log

# Expo temp home used during installs
app/.tmp-home/
backend/.tmp-home/

# Environment files
app/.env
.env

# Backend build artifacts and database
backend/data/*.db
backend/data/*.sqlite
backend/.cache/

# Expo / Metro caches
.expo/
.expo-shared/
app/node_modules/.cache/


.DS_Store
.DS_Store
43 changes: 43 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
.kotlin/
*.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

app-example

# generated native folders
/ios
/android
1 change: 1 addition & 0 deletions app/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "recommendations": ["expo.vscode-expo-tools"] }
7 changes: 7 additions & 0 deletions app/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
"source.sortMembers": "explicit"
}
}
50 changes: 50 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to your Expo app 👋

This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).

## Get started

1. Install dependencies

```bash
npm install
```

2. Start the app

```bash
npx expo start
```

In the output, you'll find options to open the app in a

- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo

You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).

## Get a fresh project

When you're ready, run:

```bash
npm run reset-project
```

This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.

## Learn more

To learn more about developing your project with Expo, look at the following resources:

- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.

## Join the community

Join our community of developers creating universal apps.

- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
53 changes: 53 additions & 0 deletions app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"expo": {
"name": "GreenUp",
"slug": "greenup",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "greenup",
"extra": {
"supabaseUrl": "https://oldyeaylxdnvfrzocobu.supabase.co",
"supabaseAnonKey": "sb_publishable_YC7cKRCzkXMqhL8tOh1vxg_1--ZPWVZ"
},
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"backgroundColor": "#E6F4FE",
"foregroundImage": "./assets/images/android-icon-foreground.png",
"backgroundImage": "./assets/images/android-icon-background.png",
"monochromeImage": "./assets/images/android-icon-monochrome.png"
},
"edgeToEdgeEnabled": true,
"predictiveBackGestureEnabled": false
},
"web": {
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff",
"dark": {
"backgroundColor": "#000000"
}
}
],
"expo-secure-store"
],
"experiments": {
"typedRoutes": true,
"reactCompiler": true
}
}
}
154 changes: 154 additions & 0 deletions app/app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
import { Tabs, Link } from 'expo-router';
import React from 'react';
import { StyleSheet, View, TouchableOpacity, Image } from 'react-native';
import { BlurView } from 'expo-blur';

import { HapticTab } from '@/components/haptic-tab';
import { IconSymbol } from '@/components/ui/icon-symbol';
import { Colors } from '@/constants/theme';
import { useColorScheme } from '@/hooks/use-color-scheme';

export default function TabLayout() {
const colorScheme = useColorScheme();

return (
<Tabs
initialRouteName="index"
screenOptions={{
tabBarActiveTintColor: '#ffffff',
tabBarInactiveTintColor: 'rgba(255,255,255,0.7)',
headerShown: false,
tabBarButton: HapticTab,
tabBarStyle: {
position: 'absolute',
backgroundColor: 'transparent',
borderTopWidth: 0,
elevation: 0, // Android shadow
},
tabBarBackground: () => (
<>
<BlurView
intensity={55}
tint={(colorScheme ?? 'light') as 'light' | 'dark' | 'default'}
style={StyleSheet.absoluteFill}
/>
<View
pointerEvents="none"
style={[StyleSheet.absoluteFill, { backgroundColor: 'rgba(0,0,0,0.10)' }]}
/>
</>
),
}}>
<Tabs.Screen
name="index"
options={{
title: 'Hem',
headerShown: true,
headerTransparent: true,
headerStyle: { backgroundColor: 'transparent' },
headerTitleStyle: { color: '#1f1f1f' },
headerTintColor: '#1f1f1f',
headerRight: () => (
<Link href="/notifications" asChild>
<TouchableOpacity
accessibilityLabel="Visa notiser"
style={{
backgroundColor: '#2f7147',
width: 36,
height: 36,
borderRadius: 18,
alignItems: 'center',
justifyContent: 'center',
}}
>
<IconSymbol name="envelope.fill" size={20} color="#fff" />
</TouchableOpacity>
</Link>
),
tabBarIcon: ({ color }) => (
<Image
source={{
uri: 'https://img.icons8.com/?size=100&id=8xhovyHdOQzF&format=png&color=000000',
}}
style={{ width: 28, height: 28, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
<Tabs.Screen
name="leaderboard"
options={{
title: 'Tävlingar',
tabBarIcon: ({ color }) => (
<Image
source={{
uri: 'https://img.icons8.com/?size=100&id=0mAtpPoNoAEd&format=png&color=000000',
}}
style={{ width: 28, height: 28, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
<Tabs.Screen
name="create"
options={{
title: 'Skapa',
headerShown: true,
headerTransparent: true,
headerStyle: { backgroundColor: 'transparent' },
headerTitleStyle: { color: '#1f1f1f' },
headerTintColor: '#1f1f1f',
headerShadowVisible: false,
tabBarIcon: ({ color }) => (
<Image
source={{
uri: 'https://img.icons8.com/?size=100&id=GqJpEbXPcmLg&format=png&color=000000',
}}
style={{ width: 28, height: 28, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
<Tabs.Screen
name="info"
options={{
title: 'Information',
tabBarLabel: 'info',
headerShown: true,
headerTransparent: true,
headerStyle: { backgroundColor: 'transparent' },
headerTitleStyle: { color: '#1f1f1f' },
headerTintColor: '#1f1f1f',
headerShadowVisible: false,
tabBarIcon: ({ color }) => (
<Image
source={{
uri: 'https://img.icons8.com/?size=100&id=40JxrZB76JLv&format=png&color=000000',
}}
style={{ width: 28, height: 28, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
<Tabs.Screen
name="acount"
options={{
title: 'Profil',
tabBarIcon: ({ color }) => (
<Image
source={{
uri: 'https://img.icons8.com/?size=100&id=p8UFrp2VUgHR&format=png&color=000000',
}}
style={{ width: 28, height: 28, tintColor: color }}
resizeMode="contain"
/>
),
}}
/>
</Tabs>
);
}
32 changes: 32 additions & 0 deletions app/app/(tabs)/acount/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Stack, router } from 'expo-router';
import React, { useEffect } from 'react';
import { supabase } from '@/src/lib/supabase';
import { isLoggedIn } from '@/lib/session';

export default function AccountStackLayout() {
useEffect(() => {
(async () => {
const { data: sess } = await supabase.auth.getSession();
if (!sess.session) {
const ok = await isLoggedIn();
if (!ok) {
router.replace('/login');
}
}
})();
}, []);

return (
<Stack
screenOptions={{
headerShown: true,
headerStyle: { backgroundColor: '#a7c7a3' },
headerTitleStyle: { color: '#1f1f1f' },
headerTintColor: '#1f1f1f',
headerShadowVisible: false,
}}
/>
);
}


Loading