Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
808d353
:thread: initialization
mathiszerari Jun 4, 2024
89c379f
:tada: initialization
mathiszerari Jun 4, 2024
a8168e2
:construction: small steps
mathiszerari Jun 5, 2024
b1245ed
:package: nativewind added, from tsx to jsx
mathiszerari Jun 5, 2024
5aeae53
:sparkles: create the tabs component and new files
mathiszerari Jun 6, 2024
988b6e0
:bento: add assets
mathiszerari Jun 6, 2024
8070e2d
:package: update dependencies
mathiszerari Jun 13, 2024
2a198c7
🚧 small steps on the tab bar
mathiszerari Jun 13, 2024
8324506
📦 bun lock update
mathiszerari Jun 13, 2024
e946bf9
💄 tab bar in color
mathiszerari Jun 13, 2024
8698277
:fire: fire some comments
mathiszerari Jun 13, 2024
981eda7
🍱 use the search icon instead of the plus one
mathiszerari Jun 13, 2024
696e78f
:sparkles: add haptic return on the tab bar
mathiszerari Jun 13, 2024
c273fe2
:sparkles: update onboarding screen
mathiszerari Jun 13, 2024
01635ec
:sparkles: add a custom button and import it on th onboarding page
mathiszerari Jun 14, 2024
d0d955c
:lipstick: update the button
mathiszerari Jun 15, 2024
b3aa4c7
:sparkles: two inputs on the sign in page
mathiszerari Jun 15, 2024
421cafd
:sparkles: show/hide input function
mathiszerari Jun 15, 2024
c2acc95
🚧 submit button log the data
mathiszerari Jun 16, 2024
9589d94
:sparkles: signup and signin pages done
mathiszerari Jun 16, 2024
8cc8520
:sparkles: connected to appwrite, user creation works well
mathiszerari Jun 16, 2024
5c2fa60
:sparkles: create a user works
mathiszerari Jun 16, 2024
0c81565
:sparkles: signin is implemented
mathiszerari Jun 16, 2024
510dc5c
:sparkles: now logged in globally
mathiszerari Jun 16, 2024
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
8 changes: 8 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.
> What do the files contain?
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
- "settings.json": contains the server configuration that is used to serve the application manifest.
> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
3 changes: 3 additions & 0 deletions .expo/devices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"devices": []
}
357 changes: 357 additions & 0 deletions .expo/types/router.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,357 @@
/* eslint-disable */
import type { ReactNode } from 'react';
import type { TextProps, GestureResponderEvent } from 'react-native';

export namespace ExpoRouter {
type StaticRoutes = `/` | `/(auth)` | `/(tabs)` | `/_sitemap` | `/home` | `/profile` | `/search` | `/sign-in` | `/sign-up`;
type DynamicRoutes<T extends string> = `/search/${SingleRoutePart<T>}`;
type DynamicRouteTemplate = `/search/[query]`;

export type RelativePathString = `./${string}` | `../${string}` | '..';
export type AbsoluteRoute = DynamicRouteTemplate | StaticRoutes;
export type ExternalPathString = `${string}:${string}`;
export type ExpoRouterRoutes = DynamicRouteTemplate | StaticRoutes | RelativePathString;
export type AllRoutes = ExpoRouterRoutes | ExternalPathString;

/****************
* Route Utils *
****************/
type SearchOrHash = `?${string}` | `#${string}`;
export type UnknownInputParams = Record<
string,
string | number | undefined | null | (string | number)[]
>;
type UnknownOutputParams = Record<string, string | string[]>;

/**
* Return only the RoutePart of a string. If the string has multiple parts return never
*
* string | type
* ---------|------
* 123 | 123
* /123/abc | never
* 123?abc | never
* ./123 | never
* /123 | never
* 123/../ | never
*/
type SingleRoutePart<S extends string> = S extends `${string}/${string}`
? never
: S extends `${string}${SearchOrHash}`
? never
: S extends ''
? never
: S extends `(${string})`
? never
: S extends `[${string}]`
? never
: S;

/**
* Return only the CatchAll router part. If the string has search parameters or a hash return never
*/
type CatchAllRoutePart<S extends string> = S extends `${string}${SearchOrHash}`
? never
: S extends ''
? never
: S extends `${string}(${string})${string}`
? never
: S extends `${string}[${string}]${string}`
? never
: S;

/**
* Return the name of a route parameter
* '[test]' -> 'test'
* 'test' -> never
* '[...test]' -> '...test'
*/
type IsParameter<Part> = Part extends `[${infer ParamName}]` ? ParamName : never;

/**
* Return a union of all raw parameter names. If there are no names return never
*
* This differs from ParameterNames as it returns the `...` for catch all parameters
*
* /[test] -> 'test'
* /[abc]/[...def] -> 'abc'|'...def'
*/
type ParameterNames<Path> = Path extends `${infer PartA}/${infer PartB}`
? IsParameter<PartA> | ParameterNames<PartB>
: IsParameter<Path>;

/**
* Returns all segments of a route.
*
* /(group)/123/abc/[id]/[...rest] -> ['(group)', '123', 'abc', '[id]', '[...rest]'
*/
type RouteSegments<Path> = Path extends `${infer PartA}/${infer PartB}`
? PartA extends '' | '.'
? [...RouteSegments<PartB>]
: [PartA, ...RouteSegments<PartB>]
: Path extends ''
? []
: [Path];

type AllUngroupedRoutes<Path> = Path extends `(${infer PartA})/${infer PartB}`
? `(${PartA})/${AllUngroupedRoutes<PartB>}` | AllUngroupedRoutes<PartB>
: Path;

/**
* Returns a Record of the routes parameters as strings and CatchAll parameters
*
* There are two versions, input and output, as you can input 'string | number' but
* the output will always be 'string'
*
* /[id]/[...rest] -> { id: string, rest: string[] }
* /no-params -> {}
*/
export type InputRouteParams<Path> = {
[Key in ParameterNames<Path> as Key extends `...${infer Name}`
? Name
: Key]: Key extends `...${string}` ? (string | number)[] : string | number;
} & UnknownInputParams;

type OutputRouteParams<Path> = {
[Key in ParameterNames<Path> as Key extends `...${infer Name}`
? Name
: Key]: Key extends `...${string}` ? string[] : string;
} & UnknownOutputParams;

/**
* Returns the search parameters for a route.
*/
export type SearchParams<T extends AllRoutes = never> = T extends DynamicRouteTemplate
? OutputRouteParams<T>
: T extends StaticRoutes
? never
: UnknownOutputParams;

/*********
* Href *
*********/

/**
* The main routing type for Expo Router. Includes all available routes with strongly typed parameters.
*
* Allows for static routes, relative paths, external paths, dynamic routes, and the dynamic route provided as a static string
*/
export type Href =
| StringRouteToType<AllUngroupedRoutes<StaticRoutes> | RelativePathString | ExternalPathString>
| DynamicRouteTemplateToString<DynamicRouteTemplate>
| DynamicRouteObject<
StaticRoutes | RelativePathString | ExternalPathString | DynamicRouteTemplate
>;

type StringRouteToType<T extends string> =
| T
| `${T}${SearchOrHash}`
| { pathname: T; params?: UnknownInputParams | never };

type DynamicRouteTemplateToString<Path> = Path extends `${infer PartA}/${infer PartB}`
? `${PartA extends `[${string}]` ? string : PartA}/${DynamicRouteTemplateToString<PartB>}`
: Path extends `[${string}]`
? string
: Path;

type DynamicRouteObject<T> = T extends DynamicRouteTemplate
? {
pathname: T;
params: InputRouteParams<T>;
}
: never;

type IsStaticRoute<T> =
| StaticRoutes
| RelativePathString
| ExternalPathString
| (T extends DynamicRoutes<infer _> ? T : never);

/***********************
* Expo Router Exports *
***********************/

export type Router = {
/** Go back in the history. */
back: () => void;
/** If there's history that supports invoking the `back` function. */
canGoBack: () => boolean;
/** Navigate to the provided href using a push operation if possible. */
push: (href: Href) => void;
/** Navigate to the provided href. */
navigate: (href: Href) => void;
/** Navigate to route without appending to the history. */
replace: (href: Href) => void;
/** Navigate to a screen with a stack lower than the current screen. Using the provided count if possible, otherwise 1. */
dismiss: (count?: number) => void;
/** Navigate to first screen within the lowest stack. */
dismissAll: () => void;
/** If there's history that supports invoking the `dismiss` and `dismissAll` function. */
canDismiss: () => boolean;
/** Update the current route query params. */
setParams: <T = ''>(
params?: T extends '' ? Record<string, string | undefined | null> : InputRouteParams<T>
) => void;
};

/** The imperative router. */
export declare const router: Router;

/************
* <Link /> *
************/
export interface WebAnchorProps {
/**
* **Web only:** Specifies where to open the `href`.
*
* - **_self**: the current tab.
* - **_blank**: opens in a new tab or window.
* - **_parent**: opens in the parent browsing context. If no parent, defaults to **_self**.
* - **_top**: opens in the highest browsing context ancestor. If no ancestors, defaults to **_self**.
*
* This property is passed to the underlying anchor (`<a>`) tag.
*
* @default '_self'
*
* @example
* <Link href="https://expo.dev" target="_blank">Go to Expo in new tab</Link>
*/
target?: '_self' | '_blank' | '_parent' | '_top' | (string & object);

/**
* **Web only:** Specifies the relationship between the `href` and the current route.
*
* Common values:
* - **nofollow**: Indicates to search engines that they should not follow the `href`. This is often used for user-generated content or links that should not influence search engine rankings.
* - **noopener**: Suggests that the `href` should not have access to the opening window's `window.opener` object, which is a security measure to prevent potentially harmful behavior in cases of links that open new tabs or windows.
* - **noreferrer**: Requests that the browser not send the `Referer` HTTP header when navigating to the `href`. This can enhance user privacy.
*
* The `rel` property is primarily used for informational and instructive purposes, helping browsers and web
* crawlers make better decisions about how to handle and interpret the links on a web page. It is important
* to use appropriate `rel` values to ensure that links behave as intended and adhere to best practices for web
* development and SEO (Search Engine Optimization).
*
* This property is passed to the underlying anchor (`<a>`) tag.
*
* @example
* <Link href="https://expo.dev" rel="nofollow">Go to Expo</Link>
*/
rel?: string;

/**
* **Web only:** Specifies that the `href` should be downloaded when the user clicks on the link,
* instead of navigating to it. It is typically used for links that point to files that the user should download,
* such as PDFs, images, documents, etc.
*
* The value of the `download` property, which represents the filename for the downloaded file.
* This property is passed to the underlying anchor (`<a>`) tag.
*
* @example
* <Link href="/image.jpg" download="my-image.jpg">Download image</Link>
*/
download?: string;
}

export interface LinkProps<T = string> extends Omit<TextProps, 'href'>, WebAnchorProps {
/** Path to route to. */
href: Href;

// TODO(EvanBacon): This may need to be extracted for React Native style support.
/** Forward props to child component. Useful for custom buttons. */
asChild?: boolean;

/** Should replace the current route without adding to the history. */
replace?: boolean;
/** Should push the current route */
push?: boolean;

/** On web, this sets the HTML `class` directly. On native, this can be used with CSS interop tools like Nativewind. */
className?: string;

onPress?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;
}

export interface LinkComponent {
(props: React.PropsWithChildren<LinkProps>): JSX.Element;
/** Helper method to resolve an Href object into a string. */
resolveHref: (href: Href) => string;
}

/**
* Component to render link to another route using a path.
* Uses an anchor tag on the web.
*
* @param props.href Absolute path to route (e.g. \`/feeds/hot\`).
* @param props.replace Should replace the current route without adding to the history.
* @param props.asChild Forward props to child component. Useful for custom buttons.
* @param props.children Child elements to render the content.
* @param props.className On web, this sets the HTML \`class\` directly. On native, this can be used with CSS interop tools like Nativewind.
*/
export declare const Link: LinkComponent;

/** Redirects to the href as soon as the component is mounted. */
export declare const Redirect: (props: React.PropsWithChildren<{ href: Href }>) => ReactNode;
export type Redirect = typeof Redirect;

/**
* Hooks
*/

export declare function useRouter(): Router;
type useRouter = typeof useRouter;

/**
* Returns the URL search parameters for the contextually focused route. e.g. \`/acme?foo=bar\` -> \`{ foo: "bar" }\`.
* This is useful for stacks where you may push a new screen that changes the query parameters.
*
* To observe updates even when the invoking route is not focused, use \`useGlobalSearchParams()\`.
* @see \`useGlobalSearchParams\`
*/
export declare function useLocalSearchParams<
TParams extends AllRoutes | UnknownOutputParams = UnknownOutputParams,
>(): TParams extends AllRoutes ? SearchParams<TParams> : TParams;
type useLocalSearchParams = typeof useLocalSearchParams;

export declare function useSearchParams<
TParams extends AllRoutes | UnknownOutputParams = UnknownOutputParams,
>(): TParams extends AllRoutes ? SearchParams<TParams> : TParams;
type useSearchParams = typeof useSearchParams;

/**
* Get the globally selected query parameters, including dynamic path segments. This function will update even when the route is not focused.
* Useful for analytics or other background operations that don't draw to the screen.
*
* When querying search params in a stack, opt-towards using \`useLocalSearchParams\` as these will only
* update when the route is focused.
*
* @see \`useLocalSearchParams\`
*/
export declare function useGlobalSearchParams<
T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,
>(): T extends AllRoutes ? SearchParams<T> : T;
type useGlobalSearchParams = typeof useGlobalSearchParams;

/**
* Get a list of selected file segments for the currently selected route. Segments are not normalized, so they will be the same as the file path. e.g. /[id]?id=normal -> ["[id]"]
*
* \`useSegments\` can be typed using an abstract.
* Consider the following file structure, and strictly typed \`useSegments\` function:
*
* \`\`\`md
* - app
* - [user]
* - index.js
* - followers.js
* - settings.js
* \`\`\`
* This can be strictly typed using the following abstract:
*
* \`\`\`ts
* const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()
* \`\`\`
*/
export declare function useSegments<
T extends AbsoluteRoute | RouteSegments<AbsoluteRoute> | RelativePathString,
>(): T extends AbsoluteRoute ? RouteSegments<T> : T extends string ? string[] : T;
type useSegments = typeof useSegments;
}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
node_modules

# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
Loading