-
Notifications
You must be signed in to change notification settings - Fork 4
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
e180f3b
commit c084080
Showing
22 changed files
with
2,618 additions
and
2,338 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,59 @@ | ||
// Expo router Page to display a single user | ||
|
||
import { useEffect, useState } from 'react'; | ||
|
||
import { useLocalSearchParams } from 'expo-router'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
|
||
import { colors } from '../../styles/constants'; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: colors.background, | ||
}, | ||
text: { | ||
color: colors.text, | ||
}, | ||
}); | ||
|
||
type Guest = { | ||
id: string; | ||
firstName: string; | ||
lastName: string; | ||
deadline?: string; | ||
attending: boolean; | ||
}; | ||
|
||
const API_URL = | ||
'https://37820499-b115-4574-94d1-64870873aef3-00-2o18dc9ex4s5s.spock.replit.dev'; | ||
|
||
export default function Guests() { | ||
const { id } = useLocalSearchParams(); | ||
|
||
const [guest, setGuest] = useState<Guest>(); | ||
|
||
useEffect(() => { | ||
async function loadGuest() { | ||
const response = await fetch(`${API_URL}/guests/${id}`); | ||
const fetchedGuest = await response.json(); | ||
setGuest(fetchedGuest); | ||
} | ||
loadGuest(); | ||
}, [id]); | ||
|
||
if (!guest) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.text}> | ||
{guest.firstName} {guest.lastName} | ||
</Text> | ||
<Text style={styles.text}> | ||
{guest.attending ? 'Attending' : 'Not attending'} | ||
</Text> | ||
</View> | ||
); | ||
} |
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,5 @@ | ||
import { ExpoRequest, ExpoResponse } from 'expo-router/server'; | ||
|
||
export function GET(request: ExpoRequest) { | ||
return ExpoResponse.json({ hello: 'world' }); | ||
} |
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,6 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 @@ | ||
export { default } from 'eslint-config-upleveled'; |
Oops, something went wrong.