Skip to content

Commit

Permalink
Added styling to chat screen header (#301)
Browse files Browse the repository at this point in the history
* added styling to chat screen header
Co-authored-by: Dylan <[email protected]>
  • Loading branch information
arwendowers authored Nov 7, 2024
1 parent a8fcde6 commit 1db9dd9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 71 deletions.
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,
} 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 @@ -17,6 +17,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 @@ -89,16 +90,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 @@ -29,11 +29,6 @@ export type MessageChannelProps = {
messages: Message[];
};

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

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

0 comments on commit 1db9dd9

Please sign in to comment.