Skip to content

Commit

Permalink
Refactor BarGraph component to update console.log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
KamogeloMoeketse committed Oct 24, 2024
1 parent a719dd7 commit f20a22e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/occupi-mobile4/components/BarGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { convertValues, convertValuesHour } from '@/utils/occupancy';


const BarGraph = ({data,tab}) => {
console.log('tab',data)
console.log('hah',data)
const colorscheme = useColorScheme();
const { theme } = useTheme();
const currentTheme = theme === "system" ? colorscheme : theme;
Expand Down
8 changes: 4 additions & 4 deletions frontend/occupi-mobile4/screens/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Dashboard: React.FC = () => {
const toast = useToast();
const [currentData, setCurrentData] = useState();
const pagerRef = useRef<PagerView>(null);
const [activeTab, setActiveTab] = useState(1);
const [activeTab, setActiveTab] = useState(2);
const [weeklyData, setWeeklyData] = useState();
const [hourlyData, setHourlyData] = useState();
const counter = useCentrifugeCounter();
Expand Down Expand Up @@ -193,7 +193,7 @@ const Dashboard: React.FC = () => {
try {
const prediction = await getFormattedPredictionData();
if (prediction) {
// console.log(prediction);
console.log('hhahah',prediction);
setCurrentData(prediction);
setWeeklyData(prediction);
}
Expand Down Expand Up @@ -224,7 +224,7 @@ const Dashboard: React.FC = () => {
}, []);

const getPredictionsFromWeek = async (date: string) => {
console.log(activeTab);
// console.log(activeTab);
try {
if (activeTab === 2) {
const prediction = await getFormattedPredictionWeekData(date);
Expand Down Expand Up @@ -404,7 +404,7 @@ const Dashboard: React.FC = () => {

const handleConfirm = (date: Date) => {
const selectedDate: string = date.toString();
console.log('selected', extractDateFromTimestamp(selectedDate));
// console.log('selected', extractDateFromTimestamp(selectedDate));
setDate(extractDateFromTimestamp(selectedDate));
getPredictionsFromWeek(extractDateFromTimestamp(selectedDate));
hideDatePicker();
Expand Down
2 changes: 1 addition & 1 deletion frontend/occupi-mobile4/utils/occupancy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export async function mapToClassForSpecificHours(date? : string) {
}
}
const prediction = await fetchHourlyPredictions();
console.log(prediction);
// console.log(prediction);
if (prediction) {
return prediction.Hourly_Predictions
.filter(item => specificHours.includes(item.Hour)) // Filter specific hours
Expand Down

0 comments on commit f20a22e

Please sign in to comment.