Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map improvements #40

Merged
merged 4 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading