mirror of
https://github.com/Blair-SGA-Dev-Team/blazerapp.git
synced 2024-11-21 20:41:16 -05:00
Added tweak to announcements and json for url of CMS
This commit is contained in:
parent
4b14f130cc
commit
e663cc9a95
|
@ -18,10 +18,15 @@ import {
|
|||
} from 'react-native/Libraries/NewAppScreen';
|
||||
|
||||
import styles from './styles/liststyles'
|
||||
import { url } from './resources/fetchInfo.json'
|
||||
|
||||
const Announcement = ({item}) => {
|
||||
const date = new Date
|
||||
const dateStr = `${date.getMonth()+1}/${date.getUTCDate()}/${date.getFullYear()}`
|
||||
const dateInfo = dateStr===item.item.date&&item.item.time!==undefined?item.item.time:item.item.date;
|
||||
return (
|
||||
<View style={styles.item}>
|
||||
{dateInfo!==undefined?<Text style={styles.date}>{dateInfo}</Text>:<></>}
|
||||
<Text style={styles.title}>{item.item.message}</Text>
|
||||
</View>
|
||||
)
|
||||
|
@ -37,7 +42,7 @@ class Announcements extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
fetch('https://6dc2642ae9b3.ngrok.io/api/en/announcements',{
|
||||
fetch(`${url}/api/en/announcements`,{
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache'
|
||||
}
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
/**
|
||||
* Sample React Native App
|
||||
* https://github.com/facebook/react-native
|
||||
*
|
||||
* @format
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import {
|
||||
SafeAreaView,
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
} from 'react-native/Libraries/NewAppScreen';
|
||||
import { SearchBar } from 'react-native-elements';
|
||||
import styles from './styles/liststyles'
|
||||
import { url } from './resources/fetchInfo.json'
|
||||
|
||||
const ClubElement = ({item}) => {
|
||||
const [visible, setVisible] = useState(0)
|
||||
|
@ -49,7 +50,7 @@ class Clubs extends React.Component {
|
|||
|
||||
componentDidMount() {
|
||||
|
||||
fetch('https://6dc2642ae9b3.ngrok.io/api/en/clubs',{
|
||||
fetch(`${url}/api/en/clubs`,{
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache'
|
||||
} })
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
} from 'react-native/Libraries/NewAppScreen';
|
||||
|
||||
import styles from './styles/liststyles'
|
||||
import { url } from './resources/fetchInfo.json'
|
||||
|
||||
const LunchEvent = ({item}) => {
|
||||
const [visible, setVisible] = useState(0)
|
||||
|
@ -43,7 +44,7 @@ class LunchEvents extends React.Component {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
fetch('https://6dc2642ae9b3.ngrok.io/api/en/lunchEvents',{
|
||||
fetch(`${url}/api/en/lunchEvents`,{
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache'
|
||||
}
|
||||
|
|
1
app/resources/fetchInfo.json
Normal file
1
app/resources/fetchInfo.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"url":"http://10.0.2.2:5000"}
|
|
@ -14,6 +14,13 @@ const styles = StyleSheet.create({
|
|||
title: {
|
||||
fontSize: 32,
|
||||
},
|
||||
date: {
|
||||
fontSize:12,
|
||||
marginBottom:'-3%',
|
||||
alignSelf:'flex-end',
|
||||
marginTop:'-3%',
|
||||
marginRight:'-3%'
|
||||
}
|
||||
});
|
||||
|
||||
export default styles;
|
Loading…
Reference in New Issue
Block a user