Skip to content

Commit

Permalink
fix: ipad layout
Browse files Browse the repository at this point in the history
  • Loading branch information
OverGlass committed Sep 25, 2024
1 parent 0111f4a commit d99eb02
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 50 deletions.
22 changes: 3 additions & 19 deletions app/(app)/profil/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
import { SmallHeader } from '@/components/Header/Header'
import { useSession } from '@/ctx/SessionProvider'
import { Redirect, router, Stack, useNavigation } from 'expo-router'
import { PortalHost, YStack } from 'tamagui'
import { PortalHost, useMedia, YStack } from 'tamagui'

export default function AppLayout() {
const { isAuth } = useSession()
const media = useMedia()

if (!isAuth) {
return <Redirect href={'/(app)/(tabs)/evenements/'} />
}

return (
<Stack screenOptions={{ header: (x) => <SmallHeader {...x} />, animation: 'slide_from_right' }}>
<Stack screenOptions={{ header: (x) => <SmallHeader {...x} />, animation: media.gtSm ? 'none' : 'slide_from_right' }}>
<Stack.Screen
name="index"
options={{
title: 'Profil',
}}
/>
<Stack.Screen
name="informations-personnelles"
options={{
title: 'Informations Personelles',
headerRight: () => (
<YStack>
<PortalHost name="ProfilHeaderRight"></PortalHost>
</YStack>
),
}}
/>
<Stack.Screen
name="cotisation-et-dons"
options={{
title: 'Cotisation et Dons',
}}
/>
</Stack>
)
}
2 changes: 1 addition & 1 deletion src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type BadgeProps = {
const Badge = ({ children, ...props }: BadgeProps) => {
return (
<BadgeFrame {...props}>
<Text.SM semibold color="$color4">
<Text.SM semibold color="$color5">
{children}
</Text.SM>
</BadgeFrame>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type ChipProps = {
const Chip = ({ children, ...props }: ChipProps) => {
return (
<ChipFrame {...props} theme={props.theme ?? 'gray'}>
<Text fontWeight="$6" fontSize="$1" color="$color4">
<Text fontWeight="$6" fontSize="$1" color="$color5">
{children}
</Text>
</ChipFrame>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProfileCards/ProfileCard/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ export default function ProfileCard({ firstName = '', lastName = '', tags, onBut
)}

{onButtonPress && (
<View flex={1}>
<YStack>
<VoxButton width="100%" pop variant="soft" theme="purple" iconLeft={Repeat} onPress={onButtonPress}>
Mon espace cadre
</VoxButton>
</View>
</YStack>
)}
</VoxCard.Content>
</VoxCard>
Expand Down
8 changes: 3 additions & 5 deletions src/components/layouts/ProfilLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ export default function ProfilLayout({ children }: { children: React.ReactNode }
return (
<PageLayout>
<PageLayout.SideBarLeft showOn="gtSm">
<YStack gap="$3">
<XStack justifyContent="flex-end">
<ProfilMenu />
</XStack>
</YStack>
<XStack justifyContent="flex-end">
<ProfilMenu />
</XStack>
</PageLayout.SideBarLeft>
<PageLayout.MainSingleColumn>{children}</PageLayout.MainSingleColumn>
<PageLayout.SideBarRight />
Expand Down
12 changes: 6 additions & 6 deletions src/components/menu/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Text from '../base/Text'

const ItemFrame = styled(XStack, {
animation: '100ms',
flex: 1,
// flex: 1,
width: '100%',
backgroundColor: '$white1',
paddingHorizontal: '$4',
Expand Down Expand Up @@ -77,12 +77,12 @@ const Item = ({
<ItemFrame {...props}>
<View height="100%" width={8} backgroundColor="$gray2" display={props.active ? 'flex' : 'none'} position="absolute" top={0} left={0} />
<Icon size={props.size === 'lg' ? '$2' : '$1'} color="$textPrimary" marginRight="$2" />
<ItemText size={props.size ?? 'sm'} active={props.active}>
{children}
</ItemText>
<XStack justifyContent="flex-end" flex={1}>
<ChevronRight size="$1" color="$textPrimary" />
<XStack width="100%" flexShrink={1}>
<ItemText size={props.size ?? 'sm'} active={props.active}>
{children}
</ItemText>
</XStack>
<ChevronRight size="$1" color="$textPrimary" />
</ItemFrame>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { styled, withStaticProperties, YStack } from 'tamagui'

const MenuFrame = styled(YStack, {
backgroundColor: '$white1',
flex: 1,
// flex: 1,
$sm: {
width: '100%',
},
$gtSm: {
overflow: 'hidden',
borderRadius: '$4',
maxWidth: 260,
maxWidth: 270,
elevation: 1,
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/screens/profil/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ProfilMenu = () => {
<Menu key="profil-menu">
{itemsData.map((item, index) => (
<Link asChild={!isWeb} href={item.pathname ?? '/profil'} key={index} replace={media.gtSm}>
<Menu.Item key={index} active={item.pathname === pathname} size={media.gtMd ? 'sm' : 'lg'} icon={item.icon} last={index === menuData.length - 1}>
<Menu.Item key={index} active={item.pathname === pathname} size={media.sm ? 'lg' : 'sm'} icon={item.icon} last={index === menuData.length - 1}>
{item.children}
</Menu.Item>
</Link>
Expand Down
25 changes: 12 additions & 13 deletions themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,18 @@ export const templates = (() => {
background075: 3,
'color/8': -1,

color0: transparencies + 1,
color1: transparencies + 2,
color2: transparencies + 3,
color3: transparencies + 4,
color4: transparencies + 5,
color5: transparencies + 6,
color6: transparencies + 7,
color7: transparencies + 8,
color8: transparencies + 9,
color9: transparencies + 10,
color10: transparencies + 11,
color11: transparencies + 12,
color12: transparencies + 13,
color1: transparencies + 1,
color2: transparencies + 2,
color3: transparencies + 3,
color4: transparencies + 4,
color5: transparencies + 5,
color6: transparencies + 6,
color7: transparencies + 7,
color8: transparencies + 8,
color9: transparencies + 9,
color10: transparencies + 10,
color11: transparencies + 11,
color12: transparencies + 12,
color025: -1,
color05: -2,
color075: -3,
Expand Down

0 comments on commit d99eb02

Please sign in to comment.