Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
izakrobles committed Aug 31, 2023
1 parent 0917023 commit 6ab7f13
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 21 deletions.
62 changes: 45 additions & 17 deletions lib/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
}}
onPress={() => deleteNote(data.item.id, rowMap)}
>
<Ionicons name="trash-outline" size={24} color={HomeStyles.backColor.color} />
<Ionicons
name="trash-outline"
size={24}
color={HomeStyles.backColor.color}
/>
</TouchableOpacity>
) : null}
</View>
Expand Down Expand Up @@ -232,7 +236,7 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
})
}
>
<View style={{ flexDirection: "row", alignItems: 'center' }}>
<View style={{ flexDirection: "row", alignItems: "center" }}>
{IsImage ? (
<View style={{ height: 100, width: 100 }}>
<LoadingImage
Expand All @@ -247,9 +251,7 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
</View>
)}

<View
style={{ position: "absolute", left: 120 }}
>
<View style={{ position: "absolute", left: 120 }}>
<Text style={HomeStyles.noteTitle}>
{item.title.length > textLength
? item.title.slice(0, textLength) + "..."
Expand All @@ -268,9 +270,17 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
}}
>
{item.published ? (
<Ionicons name="share" size={24} color={HomeStyles.shareColor.color} />
<Ionicons
name="share"
size={24}
color={HomeStyles.shareColor.color}
/>
) : (
<Ionicons name="share-outline" size={24} color={HomeStyles.highlightColor.color} />
<Ionicons
name="share-outline"
size={24}
color={HomeStyles.highlightColor.color}
/>
)}
</View>
</TouchableOpacity>
Expand All @@ -280,13 +290,24 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
return (
<View style={HomeStyles.container}>
<View style={HomeStyles.topView}>
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: 'space-between', width: '100%'}}>
<TouchableOpacity style={[HomeStyles.userPhoto, {backgroundColor: HomeStyles.highlightColor.color}]} onPress={() => {navigation.navigate("AccountPage")}}>
<Text
style={HomeStyles.pfpText}
>
{userInitials}
</Text>
<View
style={{
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
width: "100%",
}}
>
<TouchableOpacity
style={[
HomeStyles.userPhoto,
{ backgroundColor: HomeStyles.highlightColor.color },
]}
onPress={() => {
navigation.navigate("AccountPage");
}}
>
<Text style={HomeStyles.pfpText}>{userInitials}</Text>
</TouchableOpacity>
<Text style={HomeStyles.title}>Field Notes</Text>
<View style={HomeStyles.userPhoto} />
Expand All @@ -302,7 +323,9 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
onPress={() => handleFilters("private")}
style={isPrivate ? HomeStyles.filtersSelected : HomeStyles.filters}
>
<Text style={isPrivate ? HomeStyles.selectedFont : HomeStyles.filterFont}>
<Text
style={isPrivate ? HomeStyles.selectedFont : HomeStyles.filterFont}
>
{rendering
? "Private"
: isPrivate
Expand All @@ -315,15 +338,20 @@ const HomeScreen: React.FC<HomeScreenProps> = ({ navigation, route }) => {
onPress={() => handleFilters("published")}
style={published ? HomeStyles.filtersSelected : HomeStyles.filters}
>
<Text style={published ? HomeStyles.selectedFont : HomeStyles.filterFont}>
<Text
style={published ? HomeStyles.selectedFont : HomeStyles.filterFont}
>
{rendering
? "Published"
: published
? `Published (${notes.length})`
: "Published"}
</Text>
</TouchableOpacity>
<TouchableOpacity onPress={handleReverseOrder} style={HomeStyles.filters}>
<TouchableOpacity
onPress={handleReverseOrder}
style={HomeStyles.filters}
>
<Text style={HomeStyles.filterFont}>Sort by Time</Text>
</TouchableOpacity>
</ScrollView>
Expand Down
4 changes: 1 addition & 3 deletions styles/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const lightTheme = {

export const darkTheme = {
textPrimary: "#faf7f7",
textSecondary: "#ddd",
textSecondary: "#ddd",
backgroundPrimary: "#111",
backgroundSecondary: "#222",
backgroundTertiary: "#000",
Expand All @@ -21,5 +21,3 @@ export const darkTheme = {
highlightPrimary: "#cc0000",
highlightSecondary: "#02c484",
};


2 changes: 1 addition & 1 deletion styles/pages/HomeStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { lightTheme, darkTheme } from "../colors";
import Constants from "expo-constants";

// build out settings for dark/light mode configuration
const globalStyle = lightTheme
const globalStyle = lightTheme;
// const globalStyle = darkTheme;

export const HomeStyles = StyleSheet.create({
Expand Down

0 comments on commit 6ab7f13

Please sign in to comment.