Skip to content

Commit

Permalink
Add title to climbing dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik committed Jan 27, 2024
1 parent 0b0b222 commit 5af53ae
Show file tree
Hide file tree
Showing 6 changed files with 392 additions and 371 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import TuneIcon from '@material-ui/icons/Tune';
import { useClimbingContext } from './contexts/ClimbingContext';
import { ClimbingSettings } from './ClimbingSettings';
import { PhotoLink } from './PhotoLink';
import { useFeatureContext } from '../../utils/FeatureContext';
import { getLabel } from '../../../helpers/featureLabel';

const Title = styled.div`
flex: 1;
Expand Down Expand Up @@ -41,13 +43,15 @@ export const ClimbingDialogHeader = ({
handleImageLoad();
}, 100);
};
const { feature } = useFeatureContext();
const label = getLabel(feature);

return (
<AppBar position="static" color="transparent">
<Toolbar variant="dense">
<Title>
<Typography noWrap variant="h6" component="div">
Jickovice: Hlavní oblast - patro
{label}
</Typography>
<PhotoLinks>
{photoPaths.map((photo, index) => (
Expand Down
3 changes: 3 additions & 0 deletions src/components/FeaturePanel/Climbing/ClimbingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const ClimbingView = () => {
photoPath,
handleImageLoad,
areRoutesLoading,
routes,
setImageZoom, // TODO remove it from context
} = useClimbingContext();

Expand Down Expand Up @@ -165,6 +166,8 @@ export const ClimbingView = () => {
const showArrowOnBottom =
splitPaneHeight === viewportSize.height - editorPosition.y;

console.log('_______________', JSON.stringify(routes));

return (
<Container>
{(showArrowOnTop || showArrowOnBottom) && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export const ClimbingContextProvider = ({ children, feature }: Props) => {
return !!availablePhotos.find((availablePhotoPath) => {
if (
availablePhotoPath !== photoPath &&
paths[availablePhotoPath].length > 0
paths[availablePhotoPath]?.length > 0
) {
return true;
}
Expand All @@ -269,7 +269,6 @@ export const ClimbingContextProvider = ({ children, feature }: Props) => {

return [...new Set([...acc, ...routePhotos])];
}, []);
console.log('-____', routes, photos);
setPhotoPaths(photos.sort());
};

Expand Down
Loading

0 comments on commit 5af53ae

Please sign in to comment.