Skip to content

Commit

Permalink
Merge pull request #40 from simonyiszk/map-improvements
Browse files Browse the repository at this point in the history
Map improvements
  • Loading branch information
berenteb authored Mar 2, 2024
2 parents 7a54fe4 + 49a93be commit c6cf6f5
Show file tree
Hide file tree
Showing 8 changed files with 398 additions and 484 deletions.
14 changes: 9 additions & 5 deletions app/(tabs)/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ import { Header } from '../../components/common/header';
import { Title } from '../../components/common/title';
import { Map } from '../../components/map/map';
import { ResourceSheet } from '../../components/map/resource-sheet';
import { MapResources_en } from '../../content/map-resources-en.content';
import { MapResources_hu } from '../../content/map-resources-hu.content';
import { MapResources_hu } from '../../content/map-resources.content';
import { MapResource } from '../../types/map.type';

export default function MapPage() {
const { t } = useTranslation();
const [selectedResource, setSelectedResource] = useState<MapResource>();

const onSelectedResource = (id: string) => {
const localizedResource = t('map.key') === 'hu' ? MapResources_hu : MapResources_en;
const res = localizedResource.find((r) => r.id === id);
const res = MapResources_hu.find((r) => r.id === id);
setSelectedResource(res);
};

Expand All @@ -26,7 +24,13 @@ export default function MapPage() {
<Header>
<Title>{t('tabbar.map')}</Title>
</Header>
<ReactNativeZoomableViewWithGestures initialZoom={0.5} maxZoom={2} contentHeight={1332} contentWidth={846}>
<ReactNativeZoomableViewWithGestures
panBoundaryPadding={200}
initialZoom={0.5}
maxZoom={2}
contentHeight={1332}
contentWidth={846}
>
<Map selectedResource={selectedResource?.id} onSelectedResource={onSelectedResource} />
</ReactNativeZoomableViewWithGestures>
<ResourceSheet resource={selectedResource} />
Expand Down
251 changes: 126 additions & 125 deletions components/map/map.tsx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions components/map/resource-sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export function ResourceSheet({ resource, className, ...props }: ResourceSheetPr
outputRange: [0, 400],
}),
}}
className={cn('bg-white -mt-10 dark:bg-slate-800 pb-40 rounded-t-2xl px-5 pt-5 space-y-2', className)}
className={cn('bg-white -mt-10 dark:bg-slate-800 pb-32 rounded-t-2xl px-5 pt-5 space-y-2', className)}
{...props}
>
<StyledText className='text-2xl'>{savedResource?.title}</StyledText>
<StyledText className='text-slate-500'>{savedResource?.description}</StyledText>
<StyledText className='text-slate-500 text-lg'>{savedResource?.description.hu}</StyledText>
</Animated.View>
);
}
174 changes: 0 additions & 174 deletions content/map-resources-en.content.ts

This file was deleted.

174 changes: 0 additions & 174 deletions content/map-resources-hu.content.ts

This file was deleted.

Loading

0 comments on commit c6cf6f5

Please sign in to comment.