Skip to content

Commit

Permalink
Merge pull request #72 from wwi21seb-projekt/structure
Browse files Browse the repository at this point in the history
Structure
  • Loading branch information
thommy3 authored Jul 10, 2024
2 parents 2645254 + 1ce5b86 commit 76a116e
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 63 deletions.
5 changes: 0 additions & 5 deletions DummyData.ts

This file was deleted.

6 changes: 0 additions & 6 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
"slug": "Breta",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/expo/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/expo/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
Expand All @@ -26,14 +24,10 @@
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/expo/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.breta.app"
},
"web": {
"favicon": "./assets/expo/favicon.png"
},
"plugins": [
[
"expo-build-properties",
Expand Down
Binary file removed assets/expo/adaptive-icon.png
Binary file not shown.
Binary file removed assets/expo/favicon.png
Binary file not shown.
Binary file removed assets/expo/icon.png
Binary file not shown.
Binary file removed assets/expo/splash.png
Binary file not shown.
Empty file removed assets/icons/sample.txt
Empty file.
Binary file removed assets/images/Adrian.jpeg
Binary file not shown.
Binary file removed assets/images/Aleks.jpeg
Binary file not shown.
Binary file removed assets/images/Ei.jpeg
Binary file not shown.
Binary file removed assets/images/Kevin.jpeg
Binary file not shown.
Binary file removed assets/images/Luca.jpeg
Binary file not shown.
Binary file removed assets/images/Max.jpeg
Binary file not shown.
Binary file removed assets/images/test.jpg
Binary file not shown.
4 changes: 2 additions & 2 deletions components/NotificationTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const {
timestamp,
notificationType,
username,
profilePictureUrl,
onRefresh
} = props;
const { token } = useAuth();
Expand Down Expand Up @@ -91,8 +92,7 @@ const {
<TouchableOpacity className="flex-1 flex-row items-center"
onPress={pressNotification}>
<Image
source={require("../assets/images/Max.jpeg")}
// source={profilePictureUrl} sobald Bilder da sind
source={{ uri: profilePictureUrl || "defaultPicture"}}
className="aspect-square rounded-full w-10"
alt="Picture"
/>
Expand Down
40 changes: 17 additions & 23 deletions components/TextPostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,18 @@ const checkForHashtag = (text: string) => {
setConfirmationVisible(false);
}}
>
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
className="flex-1">
<View
className="flex-1 justify-center items-center"
style={{ backgroundColor: "rgba(200, 200, 200, 0.8)" }}
>
<View className="bg-white rounded-3xl px-8 py-4">
<Text className="text-lg mb-4">
<View className="bg-white rounded-3xl">
<Text className="text-base my-3 mx-2.5">
Do you really want to repost this post?
</Text>

<View className="bg-white justify-center flex-row">
<TextInput
className="flex-1 border-2 ml-2.5 mr-2.5 border-lightgray rounded-[8px] p-2 "
className="flex-1 border-2 mx-2.5 border-lightgray rounded-[8px] p-2 "
value={repostText}
onChangeText={(post) => {
setRepostText(post);
Expand All @@ -453,16 +450,26 @@ const checkForHashtag = (text: string) => {
maxLength={256}
/>
</View>
<View className="mt-10 items-center">
<View className="mt-6 items-center">
<TouchableOpacity onPress={pickImage}>
{image !== '' ? (
<Image className="w-96 h-96 mb-5"source={{ uri: image }}/>
<Image className="w-72 h-72 mb-1"source={{ uri: image }}/>
) : (
<Image className="w-96 h-96 mb-5" source={require("../assets/images/image_placeholder.jpeg")}/>
<Image className="w-72 h-72 mb-1" source={require("../assets/images/image_placeholder.jpeg")}/>
)}
</TouchableOpacity>
</View>
<View className="flex-row mt-4">
{image !== '' && (
<TouchableOpacity
className="ml-2.5"
onPress={() => {
removeImage();
}}
>
<Text className="text-black text-sm">Remove Image</Text>
</TouchableOpacity>
)}
<View className="flex-row mt-5 mx-2.5 mb-3">
<TouchableOpacity onPress={() => setConfirmationVisible(false)}>
<Text className="text-red text-base font-bold">Cancel</Text>
</TouchableOpacity>
Expand All @@ -473,22 +480,9 @@ const checkForHashtag = (text: string) => {
>
<Text className="text-black text-base font-bold">Create Repost</Text>
</TouchableOpacity>
{image !== '' && (
<TouchableOpacity
className="ml-auto"
disabled={repostText === ""}
onPress={() => {
removeImage();
}}
>
<Text className="text-black text-base font-bold">Remove Image</Text>
</TouchableOpacity>
)}

</View>
</View>
</View>
</KeyboardAvoidingView>
</Modal>
{!isRepost ? (
<View
Expand Down
1 change: 0 additions & 1 deletion components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ const UserProfile: React.FC<Props> = ({ userInfo, personal }) => {
<TouchableOpacity
className="mx-2"
disabled={!personal}
//activeOpacity={1}
onLongPress={() => {
setCurrentPostId(item.postId);
setModalVisible(true);
Expand Down
4 changes: 3 additions & 1 deletion components/types/Notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export interface Notification {
user: {
username: string,
nickname: string,
profilePictureUrl: string
picture: {
url: string
}
}
}
4 changes: 2 additions & 2 deletions env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// Beta Websocket: wss://server-beta.de/api/

// URL for development
export const baseUrl = "https://alpha.c930.net/api/";
export const baseUrl = "https://server-beta.de/api/";


// Websocket for development
export const baseSocketUrl = "wss://alpha.c930.net/api/";
export const baseSocketUrl = "wss://server-beta.de/api/";
2 changes: 1 addition & 1 deletion screens/EditProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ const EditProfileScreen = () => {
</View>
{isInfoChangeSuccessful && (
<Text className="self-center mx-10 mt-1 text-xs text-green">
Your nickname and status have been updated successfully!
Your picture, nickname and status have been updated successfully!
</Text>
)}
<View className="bg-white">
Expand Down
22 changes: 1 addition & 21 deletions screens/NotificationScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,6 @@ Notifications.setNotificationHandler({
}),
});

/*async function sendPushNotification(expoPushToken: string) {
const message = {
to: expoPushToken,
sound: "default",
title: "Original Title",
body: "And here is the body!",
data: { someData: "goes here" },
};
await fetch("https://exp.host/--/api/v2/push/send", {
method: "POST",
headers: {
Accept: "application/json",
"Accept-encoding": "gzip, deflate",
"Content-Type": "application/json",
},
body: JSON.stringify(message),
});
}*/

function handleRegistrationError(errorMessage: string) {
alert(errorMessage);
throw new Error(errorMessage);
Expand Down Expand Up @@ -184,7 +164,7 @@ const NotificationScreen = () => {
timestamp={item.timestamp}
notificationType={item.notificationType}
username={item.user.username}
profilePictureUrl={item.user.profilePictureUrl}
profilePictureUrl={item.user.picture.url}
onRefresh={onRefresh}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion screens/PostScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const PostScreen: React.FC = () => {
createPost();
}}
>
<Text className="text-black text-xs">Create Post</Text>
<Text className="text-black text-sm">Create Post</Text>
</TouchableOpacity>
{image !== '' && (
<TouchableOpacity
Expand Down

0 comments on commit 76a116e

Please sign in to comment.