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

Added styling to chat screen header #301

Merged
merged 2 commits into from
Nov 7, 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
41 changes: 0 additions & 41 deletions client/app/components/chat/NearbyCount.tsx

This file was deleted.

64 changes: 49 additions & 15 deletions client/app/components/chat/NearbyHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,68 @@
import React from "react";
import { View, Text, StyleSheet, Dimensions } from "react-native";
import {
View,
Text,
StyleSheet,
Dimensions,
Image,
TouchableOpacity,

Check warning on line 8 in client/app/components/chat/NearbyHeader.tsx

View workflow job for this annotation

GitHub Actions / lint (21.x)

'TouchableOpacity' is defined but never used
} from "react-native";
import { ChevronLeft } from "react-native-feather";

import NearbyCount from "./NearbyCount";
import { CounterProps } from "../../types/Props";

export const NearbyHeader: React.FC<CounterProps> = ({ count }) => {
export const NearbyHeader: React.FC = () => {
return (
<View style={styles.nearbyContainer}>
<View style={{ flexDirection: "row" }}>
<Text style={styles.nearbyText}>Nearby</Text>
<NearbyCount count={count} />
<ChevronLeft color="white" strokeWidth={1.4} width={40} height={40} />
<Text style={styles.nearbyText}>Nearby</Text>
<View style={styles.iconContainer}>
<Image
style={styles.peopleIcon}
source={require("../../../assets/icons/misc/nearby_icon.png")}
/>
<Text style={styles.countText}>{5}</Text>
</View>
</View>
);
};

const styles = StyleSheet.create({
nearbyContainer: {
paddingTop: Dimensions.get("window").height * 0.01,
paddingBottom: Dimensions.get("window").height * 0.01,
display: "flex",
flexDirection: "row",
backgroundColor: "#34D1BF",
width: "100%",
alignItems: "center",
justifyContent: "flex-start",
shadowColor: "black",
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.3,
shadowRadius: 2,
paddingVertical: 15,
paddingRight: 25,
paddingLeft: 10,
gap: 10,
},
nearbyText: {
fontSize: 30,
fontFamily: "Quicksand",
fontSize: 24,
fontWeight: "bold",
color: "white",
marginRight: "auto",
},
peopleIcon: {
tintColor: "white",
height: Dimensions.get("window").height * 0.025,
width: Dimensions.get("window").height * 0.03,
},
iconContainer: {
display: "flex",
alignItems: "center",
},
countText: {
fontFamily: "Quicksand",
fontSize: 13,
fontWeight: "bold",
color: "black",
textAlign: "left",
width: "35%",
marginLeft: "5%",
color: "white",
},
});

Expand Down
14 changes: 4 additions & 10 deletions client/app/screens/chat/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { AuthStore } from "../../services/AuthStore";
import { Message } from "../../types/Message";
import { useState, useEffect } from "react";
import { useUser } from "@app/contexts/UserContext";
import NearbyHeader from "@app/components/chat/NearbyHeader";

const ChatScreen = () => {
const settings = useSettings();
Expand Down Expand Up @@ -90,16 +91,9 @@ const ChatScreen = () => {
Platform.OS === "ios" ? screenHeight * 0.055 : 0
}>
<View style={styles.mainContainer}>
<View style={styles.headerContainer}>
<Text
style={{
fontSize: 20,
fontWeight: "bold",
color: "white",
}}>
Chat Screen
</Text>
</View>
<NearbyHeader
count = {5} //test count value
/>
<View style={styles.chatContainer}>
<MessageChannel messages={messages} />
</View>
Expand Down
5 changes: 0 additions & 5 deletions client/app/types/Props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ export type MessageChannelProps = {
messages: Message[];
};

/* misc props*/
export type CounterProps = {
count: number;
};

export type SafeAreaWrapperProps = {
children: React.ReactNode;
};
Loading