Skip to content

Commit

Permalink
style(web): improve tabbar styles based on screen width
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert27 committed Dec 17, 2024
1 parent e2ce5f7 commit 11b027b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Binary file modified bun.lockb
Binary file not shown.
8 changes: 6 additions & 2 deletions src/app/(screens)/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { type FormListSections } from '@/types/components'
import { trackEvent } from '@aptabase/react-native'
import { alert } from 'burnt'
import * as Application from 'expo-application'
import Constants from 'expo-constants'
import * as Haptics from 'expo-haptics'
import { useRouter } from 'expo-router'
import React, { useState } from 'react'
Expand Down Expand Up @@ -42,8 +43,11 @@ export default function About(): JSX.Element {
const addUnlockedAppIcon = usePreferencesStore(
(state) => state.addUnlockedAppIcon
)
const version = `${Application.nativeApplicationVersion}`
const versionWithCode = `${version} (${Application.nativeBuildVersion})`
const version =
Application.nativeApplicationVersion ??
Constants.expoConfig?.version ??
'unknown'
const versionWithCode = `${version} (${Application.nativeBuildVersion ?? '0'})`
const [displayVersion, setDisplayVersion] = useState(version)

const toggleVersion = (): void => {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Layout/Tabbar.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const DefaultTabs = (): JSX.Element => {
const { theme: styleTheme } = useStyles()
const { t } = useTranslation('navigation')
const isMobile = Dimensions.get('window').width < 900
const isPad = Dimensions.get('window').width < 1300

return (
<>
Expand All @@ -26,6 +27,12 @@ const DefaultTabs = (): JSX.Element => {
tabBarStyle: {
backgroundColor: styleTheme.colors.card,
},
tabBarLabelPosition: isMobile
? undefined
: isPad
? 'below-icon'
: 'beside-icon',
tabBarVariant: isMobile ? 'uikit' : 'material',
}}
>
<Tabs.Screen
Expand Down
15 changes: 7 additions & 8 deletions src/components/allCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ export const AllCards: Card[] = [
allowed: [USER_STUDENT, USER_EMPLOYEE, USER_GUEST],
card: () => <EventsCard />,
},
{
key: 'food',
removable: true,
initial: [USER_GUEST],
allowed: [USER_GUEST, USER_STUDENT, USER_EMPLOYEE],
card: () => <FoodCard />,
},
{
key: 'library',
removable: true,
Expand Down Expand Up @@ -72,7 +65,13 @@ export const AllCards: Card[] = [
allowed: [USER_STUDENT, USER_EMPLOYEE],
card: () => <BaseCard title="lecturers" onPressRoute="lecturers" />,
},

{
key: 'food',
removable: true,
initial: [USER_GUEST, USER_STUDENT, USER_EMPLOYEE],
allowed: [USER_GUEST, USER_STUDENT, USER_EMPLOYEE],
card: () => <FoodCard />,
},
{
key: 'login',
removable: false,
Expand Down

0 comments on commit 11b027b

Please sign in to comment.