-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Improve Home Screen #38
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e49206b
Remove admin role restriction
0be4984
Add company hooks
1f3862e
Add language support for search
4211ff9
Add interface for company
52440cb
Change home screen to include search bar and companies
4aabd47
Add background blobs
7b3f214
Add blobs to home
1df05fa
Update the languages
9ae6004
Add blob toggle
931e168
Remove footer
1c232ed
Header style
503d70e
Add glass effect colors to theme
e30b8dd
Update blobs with organic shapes
d478908
Add translations for service type selection flow
b46d1c1
Add reusable UI components
e72d366
Add separate screens for home flow
ca4a90c
Wire up HomeStack navigation and remove old HomeScreen
d60b3f6
Hide stack headers, use custom BackButton
d90bebb
Add BackButton to ServiceOptions and BrowseCompanies screens
df8ab9c
Fix BackButton to not overlap content
972710d
Update header and accessibility button styling
6ec15bb
Add logout button to header
8dee1e2
Add @expo/vector-icons and expo-blur dependencies
bd71e36
Fix issue
f6ff08c
Address the switch issue
da956f9
Update blobs to fix the position
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import client from "./client"; | ||
| import type { Company } from "@/types/api"; | ||
|
|
||
| export async function getCompanies(): Promise<Company[]> { | ||
| const response = await client.get<Company[]>("/api/companies"); | ||
| return response.data; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
frontend/src/components/BackgroundShapes/BackgroundShapes.styles.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { StyleSheet } from "react-native"; | ||
|
|
||
| export const styles = StyleSheet.create({ | ||
| container: { | ||
| ...StyleSheet.absoluteFillObject, | ||
| overflow: "hidden", | ||
| }, | ||
| }); |
45 changes: 45 additions & 0 deletions
45
frontend/src/components/BackgroundShapes/BackgroundShapes.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { View, Dimensions } from "react-native"; | ||
| import { useThemeStore } from "@/stores/themeStore"; | ||
| import { styles } from "./BackgroundShapes.styles"; | ||
|
|
||
| const { width: W, height: H } = Dimensions.get("window"); | ||
|
StoynovAngel marked this conversation as resolved.
Outdated
|
||
|
|
||
| type Blob = { | ||
| top: number; | ||
| left: number; | ||
| width: number; | ||
| height: number; | ||
| rotation: string; | ||
| color: string; | ||
| }; | ||
|
|
||
| const BLOBS: Blob[] = [ | ||
| { top: -60, left: -70, width: 200, height: 160, rotation: "-15deg", color: "#00E8C5" }, | ||
| { top: 0.35 * H, left: W - 70, width: 180, height: 140, rotation: "20deg", color: "#FF6B6B" }, | ||
| { top: 0.65 * H, left: -80, width: 190, height: 170, rotation: "10deg", color: "#aa9cfe" }, | ||
| { top: 0.9 * H, left: W - 60, width: 170, height: 190, rotation: "-25deg", color: "#FFB347" }, | ||
| ]; | ||
|
|
||
| export default function BackgroundShapes() { | ||
| useThemeStore((s) => s.colors); | ||
|
|
||
| return ( | ||
| <View style={styles.container} pointerEvents="none"> | ||
| {BLOBS.map((blob, i) => ( | ||
| <View | ||
| key={i} | ||
| style={{ | ||
| position: "absolute", | ||
| top: blob.top, | ||
| left: blob.left, | ||
| width: blob.width, | ||
| height: blob.height, | ||
| borderRadius: Math.max(blob.width, blob.height) / 2, | ||
| backgroundColor: blob.color, | ||
| transform: [{ rotate: blob.rotation }], | ||
| }} | ||
| /> | ||
| ))} | ||
| </View> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { useQuery } from "@tanstack/react-query"; | ||
| import { getCompanies } from "@/api/companies"; | ||
|
|
||
| export function useCompanies() { | ||
| return useQuery({ | ||
| queryKey: ["companies"], | ||
| queryFn: getCompanies, | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,94 @@ | ||
| import { StyleSheet } from "react-native"; | ||
| import { ThemeColors, spacing, fontSize, borderRadius } from "@/constants/theme"; | ||
| import { ThemeColors, spacing, fontSize, borderRadius, fontWeight } from "@/constants/theme"; | ||
|
|
||
| export const createStyles = (colors: ThemeColors) => | ||
| StyleSheet.create({ | ||
| container: { | ||
| flex: 1, | ||
| justifyContent: "center", | ||
| alignItems: "center", | ||
| backgroundColor: colors.background, | ||
| paddingHorizontal: spacing.lg, | ||
| }, | ||
| title: { | ||
| fontSize: fontSize.xxl, | ||
| fontWeight: "700", | ||
| color: colors.text, | ||
| marginBottom: spacing.sm, | ||
| searchContainer: { | ||
| paddingHorizontal: spacing.md, | ||
| paddingVertical: spacing.sm, | ||
| backgroundColor: colors.background, | ||
| }, | ||
| email: { | ||
| searchInput: { | ||
| borderWidth: 1, | ||
| borderColor: colors.inputBorder, | ||
| borderRadius: borderRadius.md, | ||
| paddingHorizontal: spacing.md, | ||
| paddingVertical: 12, | ||
| marginTop: spacing.md, | ||
| fontSize: fontSize.lg, | ||
| color: colors.primary, | ||
| marginBottom: spacing.md, | ||
| backgroundColor: colors.inputBackground, | ||
| color: colors.text, | ||
| }, | ||
| placeholder: { | ||
| listContent: { | ||
| paddingHorizontal: spacing.md, | ||
| paddingBottom: spacing.lg, | ||
| }, | ||
| card: { | ||
| backgroundColor: colors.surface, | ||
| borderRadius: borderRadius.lg, | ||
| borderWidth: 1, | ||
| borderColor: colors.borderLight, | ||
| overflow: "hidden", | ||
| marginTop: spacing.sm, | ||
| }, | ||
| cardImage: { | ||
| width: "100%", | ||
| height: 160, | ||
| }, | ||
| cardContent: { | ||
| padding: spacing.md, | ||
| }, | ||
| cardHeader: { | ||
| flexDirection: "row", | ||
| justifyContent: "space-between", | ||
| alignItems: "center", | ||
| marginBottom: spacing.xs, | ||
| }, | ||
| cardName: { | ||
| fontSize: fontSize.xl, | ||
| fontWeight: fontWeight.semibold, | ||
| color: colors.text, | ||
| flexShrink: 1, | ||
| }, | ||
| badge: { | ||
| backgroundColor: colors.primaryLight, | ||
| paddingHorizontal: spacing.sm, | ||
| paddingVertical: spacing.xs, | ||
| borderRadius: borderRadius.sm, | ||
| marginLeft: spacing.sm, | ||
| }, | ||
| badgeText: { | ||
| fontSize: fontSize.xs, | ||
| fontWeight: fontWeight.medium, | ||
| color: colors.white, | ||
| }, | ||
| cardDescription: { | ||
| fontSize: fontSize.md, | ||
| color: colors.textSecondary, | ||
| marginBottom: spacing.sm, | ||
| }, | ||
| cardAddress: { | ||
| fontSize: fontSize.sm, | ||
| color: colors.textDisabled, | ||
| marginBottom: spacing.xxl, | ||
| }, | ||
| logoutButton: { | ||
| paddingHorizontal: spacing.xl, | ||
| paddingVertical: 14, | ||
| borderRadius: borderRadius.md, | ||
| borderWidth: 1, | ||
| borderColor: colors.error, | ||
| centered: { | ||
| flex: 1, | ||
| justifyContent: "center", | ||
| alignItems: "center", | ||
| paddingHorizontal: spacing.lg, | ||
| }, | ||
| logoutText: { | ||
| color: colors.error, | ||
| emptyText: { | ||
| fontSize: fontSize.lg, | ||
| fontWeight: "600", | ||
| color: colors.textDisabled, | ||
| textAlign: "center", | ||
| }, | ||
| errorText: { | ||
| fontSize: fontSize.lg, | ||
| color: colors.error, | ||
| textAlign: "center", | ||
| }, | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.