Skip to content

Commit

Permalink
api connected home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryan-Bahl committed Aug 3, 2024
1 parent 48e8d34 commit dbc1f40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/getCurrentNextEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from "axios";

export const getCurrentOrNext = async (token: string) => {
try{
const response = await axios.get('https://api.reflectionsprojections.org/events/currentOrNext/', {
const response = await axios.get('https://api.reflectionsprojections.org/events/currentOrNext', {
headers: {
Authorization: token
}
Expand Down
11 changes: 6 additions & 5 deletions screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Background from "../assets/SVGs/home/home_bg.svg"
import Token from "../assets/SVGs/home/token.svg"

import { getCurrentOrNext } from "../api/getCurrentNextEvent";
import { getEvents } from "../api/getEvents";



Expand All @@ -50,29 +51,29 @@ const Home: React.FC = ({}) => {
};

fetchCurrNext();
}, []);
}, [token]);

return (
<SafeAreaView style = {{flex: 1, position: 'relative'}}>
<Background width={width} height={height} style={{position: 'absolute'}}/>
<View style={{position: 'relative', width:'100%', height:'100%'}}>
<OngoingEvent style={{position: 'absolute', top:'25%', left:'10%'}} />
{1==1 ? (
{currNextEvent && token ? (
<View style={styles.eventDataContainer}>
<View style={styles.tabValue}>
<Text style = {styles.tabText}>ONGOING</Text>
</View>
<View style={styles.header}>
<Text style={styles.title}>Event</Text>
<Text style={styles.title}>{currNextEvent.name}</Text>
</View>
<View style={styles.info}>
<View style={styles.infoItem}>
<EvilIcons name="location" size={26} color={Colors.WHITE} />
<Text style={styles.infoText}>Location</Text>
<Text style={styles.infoText}>{currNextEvent.location}</Text>
</View>
<View style={styles.infoItem}>
<EvilIcons name="clock" size={26} color={Colors.WHITE} />
<Text style={styles.infoText}>Time</Text>
<Text style={styles.infoText}>{currNextEvent.time}</Text>
</View>
<View style={styles.infoItem}>
<Token width={30} height={30} style={{marginRight: 5, marginLeft: 40}}/>
Expand Down

0 comments on commit dbc1f40

Please sign in to comment.