-
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.
signup auth, claim tickets, see claimed tickets
- Loading branch information
1 parent
8502850
commit e9e06db
Showing
6 changed files
with
90 additions
and
24 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
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,20 +1,48 @@ | ||
import React from 'react'; | ||
import {StyleSheet, Text, View} from 'react-native'; | ||
import {StyleSheet, Text, View, TouchableOpacity} from 'react-native'; | ||
import {gql, useQuery} from '@apollo/client'; | ||
|
||
import Ticket from './Ticket'; | ||
// TODO: get ID of whoever is logged in so that we can query the tasks assigned to specific id | ||
|
||
const JuniorTickets = () => { | ||
return ( | ||
<View> | ||
<Text style={styles.text}>My Tickets</Text> | ||
</View> | ||
); | ||
const GET_TASK_FOR_HELPER = gql` | ||
query Helper($id: Int!) { | ||
helper(id: $id) { | ||
tasks { | ||
seniorname | ||
description | ||
type | ||
} | ||
} | ||
} | ||
`; | ||
|
||
const JuniorTickets = ({authID}) => { | ||
console.log('authID in junior ticketss', authID); | ||
const {loading, error, data} = useQuery(GET_TASK_FOR_HELPER, { | ||
// userID hardcoded to 34, we need to figure out why dynamic authID isn't working | ||
variables: {id: 34}, | ||
}); | ||
if (error) return <Text>`Error! ${error.message}`</Text>; | ||
|
||
console.log('data from query', data); | ||
|
||
const tickets = data.helper.tasks.map(task => ( | ||
<Ticket task={task} key={task.id} /> | ||
)); | ||
|
||
return <View style={styles.container}>{tickets}</View>; | ||
}; | ||
|
||
export default JuniorTickets; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
width: '100%', | ||
}, | ||
text: { | ||
fontSize: 20, | ||
marginVertical: 10, | ||
fontSize: 25, | ||
alignSelf: 'center', | ||
}, | ||
}); |
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