Skip to content
Snippets Groups Projects

feat(layer-text): add transform interaction for layer text and delete functionality

Files
4
import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { mapBackgroundSelector } from '@/redux/map/map.selectors';
import { twMerge } from 'tailwind-merge';
import { MAP_BACKGROUND_TYPES } from '@/redux/map/map.constants';
import { setMapBackground } from '@/redux/map/map.slice';
import { useAppDispatch } from '@/redux/hooks/useAppDispatch';
import { Select } from '@/shared/Select';
import './MapBackgroundSwitch.styles.css';
import { JSX } from 'react';
export const MapVectorBackgroundSelector = (): JSX.Element => {
export const MapBackgroundSwitchComponent = (): JSX.Element => {
const dispatch = useAppDispatch();
const backgroundId = useAppSelector(mapBackgroundSelector);
@@ -15,13 +15,19 @@ export const MapVectorBackgroundSelector = (): JSX.Element => {
};
return (
<div className={twMerge('absolute right-6 top-[calc(64px+40px+24px)] z-10 flex')}>
<Select
options={MAP_BACKGROUND_TYPES}
selectedId={backgroundId}
onChange={handleChange}
width={140}
/>
<div role="group" className="c-map-background-switch">
{MAP_BACKGROUND_TYPES.map(background => (
<button
className={`${
background.id === backgroundId && 'c-map-background-switch__button--active'
} c-map-background-switch__button`}
type="button"
key={background.id}
onClick={() => handleChange(background.id)}
>
{background.name}
</button>
))}
</div>
);
};
Loading