Skip to content

Commit 7e3dace

Browse files
committed
updated premier and championships
1 parent 2d54f76 commit 7e3dace

14 files changed

Lines changed: 233 additions & 98 deletions

File tree

api/firstAPI.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ export const getUpcomingEvents = async (season: SupportedYear, team?: number): P
773773
record: 'TBD',
774774
matches: [],
775775
achievements: 'Event Not Started',
776+
type: event.type || undefined, // Include event type from API
776777
};
777778

778779
return eventInfo;

api/types.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export interface EventInfo {
6767
record: string;
6868
matches: MatchInfo[];
6969
achievements: string;
70+
type?: string; // Event type (Premier, Championship, etc.)
7071
}
7172

7273
export interface MatchTypeAverages {

app/_layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function InnerLayout() {
9292
tranks: 'Teams', tauto: 'Auto', ttele: 'TeleOp', tendgame: 'Endgame',
9393
mranks: 'Matches', qual: 'Qualifiers', finals: 'Finals', premier: 'Premier',
9494
tac: 'Terms & Conditions', privacy: 'Privacy Policy', systemstatus: 'Systems Status',
95+
allevents: 'All Events', championships: 'Championship',
9596
};
9697

9798
const currentPage = routeLabels[pathname?.split('/').pop() || ''] || '';
@@ -185,7 +186,7 @@ function InnerLayout() {
185186
<View style={[styles2.container, { backgroundColor: theme.backgroundColor }]}>
186187
<StatusBar barStyle={barStyle} backgroundColor={theme.backgroundColor} />
187188
<Animated.View style={[styles2.sidebar, { width: sidebarWidth, backgroundColor: theme.sidebarBackground }]}>
188-
{sidebarVisible && <LeftSidebar close={() => setSidebarVisible(false)} />}
189+
{sidebarVisible && <LeftSidebar close={() => setSidebarVisible(false)} isMobile={false} />}
189190
</Animated.View>
190191

191192
<View style={[styles2.contentArea, { backgroundColor: theme.contentBackground }]}>
@@ -229,7 +230,7 @@ function InnerLayout() {
229230
)}
230231

231232
<Animated.View style={[styles.sidebar, { transform: [{ translateX: sidebarTranslateX }], backgroundColor: theme.sidebarBackground }]}>
232-
<LeftSidebar close={() => setSidebarVisible(false)} />
233+
<LeftSidebar close={() => setSidebarVisible(false)} isMobile={true} />
233234
{sidebarVisible && (
234235
<Animated.View style={[styles.closeButton, { opacity: overlayOpacity, backgroundColor: theme.closeButtonBackground }]}>
235236
<TouchableOpacity style={[styles.closeButtonTouch, { backgroundColor: theme.closeButtonTouchBackground }]} onPress={() => setSidebarVisible(false)}>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import EventTemplate from '@/components/templates/EventTemplate';
2+
import React from 'react';
3+
4+
const EventsPage = () => (
5+
<EventTemplate pageTitle="Championships" />
6+
);
7+
8+
export default EventsPage;

app/analytics/events/premier.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import EventTemplate from '@/components/templates/EventTemplate';
2+
import React from 'react';
3+
4+
const EventsPage = () => (
5+
<EventTemplate pageTitle="Premier" />
6+
);
7+
8+
export default EventsPage;

components/header/leftSide.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React, { useEffect, useState } from 'react';
2-
import { View, Text, StyleSheet, Pressable } from 'react-native';
2+
import { Pressable, StyleSheet, Text, View } from 'react-native';
33

4-
import Sidebar from '../../assets/icons/sidebar-simple.svg';
5-
import Star from '../../assets/icons/star.svg';
6-
import StarFill from '../../assets/icons/star-fill.svg';
4+
import { getFavoritesForUser, toggleFavorite } from '@/api/auth';
5+
import { supabase } from '@/api/dashboardInfo';
76
import { useDarkMode } from '@/context/DarkModeContext';
87
import { usePathname } from 'expo-router';
9-
import { supabase } from '@/api/dashboardInfo';
10-
import { getFavoritesForUser, toggleFavorite } from '@/api/auth';
8+
import Sidebar from '../../assets/icons/sidebar-simple.svg';
9+
import StarFill from '../../assets/icons/star-fill.svg';
10+
import Star from '../../assets/icons/star.svg';
1111

1212
type LeftSideProps = {
1313
toggleSidebar: () => void;
@@ -98,7 +98,7 @@ const LeftSide = ({ toggleSidebar, pageTitle, showRoute }: LeftSideProps) => {
9898
} else if (pageTitle === 'ScoutSheet') {
9999
routeLabel = 'Scouting';
100100
} else if (
101-
['Teams', 'Auto', 'TeleOp', 'Endgame', 'Matches', 'Qualifiers', 'Finals', 'Premier'].includes(pageTitle)
101+
['Teams', 'Auto', 'TeleOp', 'Endgame', 'Matches', 'Qualifiers', 'Finals', 'Premier', 'All Events', 'Championship'].includes(pageTitle)
102102
) {
103103
routeLabel = 'Analytics';
104104
}

components/header/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const SearchDropdown: React.FC<Props> = ({
4949
year,
5050
onSelectTeam,
5151
onSelectAux,
52-
placeholder = 'Search teams & events…',
52+
placeholder = 'Search...',
5353
maxResults = 30,
5454
zIndex = 99999,
5555
style,

components/leftSidebar.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import Home from "./left_sidebar/home"
1010
// Types
1111
type SidebarProps = {
1212
close?: () => void
13+
isMobile?: boolean
1314
}
1415

15-
export default function SettingsStyleSidebar({ close }: SidebarProps) {
16+
export default function SettingsStyleSidebar({ close, isMobile }: SidebarProps) {
1617
const { isDarkMode } = useDarkMode()
1718

1819
// Theme colors
@@ -28,11 +29,11 @@ export default function SettingsStyleSidebar({ close }: SidebarProps) {
2829
<ScrollView showsVerticalScrollIndicator={false}>
2930

3031
{/* Sidebar Content */}
31-
<Home close={close} />
32+
<Home close={close} isMobile={isMobile} />
3233
{/* <View style={[styles.separator, { backgroundColor: isDarkMode ? "rgba(71, 85, 105, 0.3)" : "#f3f4f6" }]} /> */}
33-
<Analytics close={close} />
34-
<Platforms close={close} />
35-
<Scouting close={close} />
34+
<Analytics close={close} isMobile={isMobile} />
35+
<Platforms close={close} isMobile={isMobile} />
36+
<Scouting close={close} isMobile={isMobile} />
3637
</ScrollView>
3738

3839
{/* Footer */}

components/left_sidebar/analytics.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import IdentificationBadge from '../../assets/icons/identification-badge.svg';
1515

1616
type AnalyticsProps = {
1717
close?: () => void;
18+
isMobile?: boolean;
1819
};
1920

20-
const Analytics = ({ close }: AnalyticsProps) => {
21+
const Analytics = ({ close, isMobile }: AnalyticsProps) => {
2122
const router = useRouter();
2223
const [teamsExpanded, setTeamsExpanded] = useState(false);
2324
const [matchesExpanded, setMatchesExpanded] = useState(false);
@@ -68,7 +69,7 @@ const Analytics = ({ close }: AnalyticsProps) => {
6869

6970
const go = (path: string, label: string) => {
7071
router.push(path as any);
71-
close?.();
72+
if (isMobile) close?.();
7273
};
7374

7475
const textColor = isDarkMode ? '#fff' : '#000';
@@ -153,7 +154,9 @@ const Analytics = ({ close }: AnalyticsProps) => {
153154

154155
{eventsExpanded && (
155156
<>
156-
<SidebarItem label="All Events" onPress={() => go('/analytics/events', 'Events')} isDarkMode={isDarkMode} />
157+
<SidebarItem label="All Events" onPress={() => go('/analytics/events/allevents', 'Events')} isDarkMode={isDarkMode} />
158+
<SidebarItem label="Premier" onPress={() => go('/analytics/events/premier', 'Premier')} isDarkMode={isDarkMode} />
159+
<SidebarItem label="Championship" onPress={() => go('/analytics/events/championships', 'Championship')} isDarkMode={isDarkMode} />
157160
</>
158161
)}
159162
</View>

0 commit comments

Comments
 (0)