Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Home and Profile icons #289

Merged
merged 6 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 20 additions & 3 deletions client/app/navigation/AppNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import {StyleSheet, Text, View} from 'react-native';

Check warning on line 2 in client/app/navigation/AppNavigator.tsx

View workflow job for this annotation

GitHub Actions / lint (21.x)

'StyleSheet' is defined but never used

Check warning on line 2 in client/app/navigation/AppNavigator.tsx

View workflow job for this annotation

GitHub Actions / lint (21.x)

'Text' is defined but never used
import * as React from "react";

import { LocationProvider } from "../contexts/LocationContext";
import { SocketProvider } from "../contexts/SocketContext";
import { UserProvider } from "../contexts/UserContext";
import ChatScreen from "../screens/chat/ChatScreen";
import SettingsScreen from "../screens/settings/SettingsScreen";
import { Home } from "react-native-feather";
import {User} from "react-native-feather";

const Tab = createBottomTabNavigator();

const AppNavigator = () => {
return (
<LocationProvider>
Expand All @@ -17,9 +19,24 @@
<Tab.Navigator
screenOptions={{
headerShown: false,
tabBarLabelStyle: {
fontSize: 15,
}
}}>
<Tab.Screen name="Home" component={ChatScreen} />
<Tab.Screen name="Profile" component={SettingsScreen} />
<Tab.Screen name="Home" component={ChatScreen} options={{
tabBarIcon:({ focused, color, size }) => {
return(<Home width = {size} stroke = {color}/>
)
}
}
}/>
<Tab.Screen name="Profile" component={SettingsScreen} options = {{
tabBarIcon:({ focused, color, size }) => {
return(<User width = {size} stroke = {color} />)
}
}
}
/>
</Tab.Navigator>
</UserProvider>
</SocketProvider>
Expand Down
5 changes: 0 additions & 5 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ io.on("connection", async (socket: any) => {
const defaultConnectedUser: ConnectedUser = {
uid: "UID",
socketId: socket.id,
displayName: "DISPLAY NAME",
userIcon: {
foregroundImage: "FOREGROUND IMG",
backgroundImage: "BACKGROUND IMG",
},
location: {
lat: 9999,
lon: 9999,
Expand Down
5 changes: 0 additions & 5 deletions server/src/routes/user/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ createUserRoute.post("/users", async (req, res) => {
status = await createUser({
uid: req.body.uid,
socketId: req.body.socketId,
displayName: req.body.displayName,
userIcon: {
foregroundImage: req.body.userIcon.foregroundImage,
backgroundImage: req.body.userIcon.backgroundImage,
},
location: {
lat: Number(req.body.location.lat),
lon: Number(req.body.location.lon),
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/user/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { deleteConnectedUserByUID } from "../../actions/deleteConnectedUser";

const deleteUserRoute = Router();

deleteUserRoute.post("/users", async (req, res) => {
deleteUserRoute.delete("/users", async (req, res) => {
const userId = req.query.userId;
if (typeof userId != "string") {
console.error(
Expand Down
12 changes: 6 additions & 6 deletions server/src/types/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ export interface UserConfig {
isPermaBanned: boolean
reason: string
}
displayName: string
userIcon?: {
foregroundImage: string
backgroundImage: string
}
}

export interface ConnectedUser {
uid: string
socketId: string
displayName: string
userIcon?: {
foregroundImage: string
backgroundImage: string
}
location: {
lat: number
lon: number
geohash: string
}
},
}
Loading