-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d0fabf
commit b22dc31
Showing
46 changed files
with
857 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ mongodb-data | |
.env.production | ||
.env.old | ||
node_modules | ||
local-files | ||
# yarn.lock | ||
# dist | ||
old/ | ||
|
This file contains 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 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 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 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,22 @@ | ||
import useTheme from 'app/hooks/useTheme'; | ||
import { BaseModal, Form, FormInput, RStack, RText } from '@packrat/ui'; | ||
|
||
export const EditTripModal = () => { | ||
|
||
return ( | ||
<BaseModal | ||
title="Add Item" | ||
trigger="Add Item" | ||
footerButtons={[ | ||
{ | ||
label: 'Cancel', | ||
color: '#B22222', | ||
onClick: (_, closeModal) => closeModal(), | ||
}, | ||
]} | ||
footerComponent={undefined} | ||
> | ||
<RText>TripModal</RText> | ||
</BaseModal> | ||
); | ||
}; |
This file contains 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 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 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,24 @@ | ||
import { InformUser } from 'app/utils/ToastUtils'; | ||
import { queryTrpc } from '../../trpc'; | ||
|
||
export const useCompleteTrip = () => { | ||
const utils = queryTrpc.useUtils(); | ||
const mutation = queryTrpc.completeTrip.useMutation(); | ||
|
||
const completeTrip = (tripId: string) => { | ||
mutation.mutate({tripId}, { | ||
onSuccess: (result) => { | ||
utils.getTrips.invalidate(); | ||
|
||
InformUser({ | ||
title: 'Trip completed! Share your experience with others', | ||
placement: 'bottom', | ||
duration: 3000, | ||
style: { backgroundColor: 'green' }, | ||
}); | ||
}, | ||
}); | ||
}; | ||
|
||
return completeTrip; | ||
}; |
This file contains 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,21 @@ | ||
import { queryTrpc } from '../../trpc'; | ||
|
||
export const useTripImages = () => { | ||
const utils = queryTrpc.useUtils(); | ||
const { mutate: addTripImageMutation } = queryTrpc.addTripImage.useMutation(); | ||
|
||
const addTripImage = (tripId: string, image: string) => { | ||
addTripImageMutation( | ||
{ tripId, image }, | ||
{ | ||
onSuccess: () => { | ||
utils.getTrips.invalidate(); | ||
}, | ||
}, | ||
); | ||
}; | ||
|
||
return { | ||
addTripImage, | ||
}; | ||
}; |
This file contains 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 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 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 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,6 +1,4 @@ | ||
import { LinkComponent, Router, CreateParam } from './model'; | ||
export declare function Link( | ||
props: Parameters<LinkComponent>, | ||
): ReturnType<LinkComponent>; | ||
export declare function Link(props: Parameters<LinkComponent>): ReturnType<LinkComponent>; | ||
export declare const createParam: CreateParam; | ||
export declare function useRouter(): Router; |
This file contains 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,32 +1,27 @@ | ||
import { FC } from 'react'; | ||
import { LinkProps } from 'solito/link'; | ||
export interface CreateParamOptions { | ||
initial?: string; | ||
parse?: (param: string) => unknown; | ||
stringify?: (param: unknown) => string; | ||
initial?: string; | ||
parse?: (param: string) => unknown; | ||
stringify?: (param: unknown) => string; | ||
} | ||
export interface Router { | ||
push: (url: URL) => void; | ||
replace: (url: URL) => void; | ||
back: () => void; | ||
push: (url: URL) => void; | ||
replace: (url: URL) => void; | ||
back: () => void; | ||
} | ||
export type LinkComponent = FC<LinkProps>; | ||
export type URL = | ||
| string | ||
| { | ||
pathname?: string; | ||
query?: Record<string, any>; | ||
state?: Record<string, any>; | ||
hash?: string; | ||
as?: string | object; | ||
}; | ||
export type URL = string | { | ||
pathname?: string; | ||
query?: Record<string, any>; | ||
state?: Record<string, any>; | ||
hash?: string; | ||
as?: string | object; | ||
}; | ||
export type CreateParam = <T>() => { | ||
useParam: ( | ||
key: keyof T, | ||
options?: CreateParamOptions, | ||
) => [value: any, setValue: (value: any) => void]; | ||
useParams: (key: keyof T) => { | ||
params: T; | ||
setParams: (value: any) => void; | ||
}; | ||
useParam: (key: keyof T, options?: CreateParamOptions) => [value: any, setValue: (value: any) => void]; | ||
useParams: (key: keyof T) => { | ||
params: T; | ||
setParams: (value: any) => void; | ||
}; | ||
}; |
This file contains 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
Oops, something went wrong.