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

fix: geometry edit tools and styling #1762

Merged
merged 3 commits into from
Nov 11, 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
1 change: 1 addition & 0 deletions src/bootstrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ const renderApp = async () => {
<ConfigProvider
locale={getConfigLang(i18n.language)}
theme={{
cssVar: true,
token: {
colorPrimary: Color(style['--primaryColor']).isLight() ?
Color(style['--primaryColor']).darken(0.5).hex() :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
left: -45px;
top: 50%;
transform: translateY(-50%);
button {
background: var(--secondaryColor);
border-color: var(--secondaryColor);

&:hover {
background: var(--ant-primary-color-hover);
border-color: var(--ant-primary-color-hover);
}
.ant-btn-variant-solid.react-geo-togglebutton {
background: var(--secondaryColor);
}

.ant-btn-variant-solid {
&:disabled {
background: #f5f5f5;
border-color: #d9d9d9
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const EditFeatureGeometryToolbar: React.FC<EditFeatureGeometryToolbarProp

const [editLayer, setEditLayer] = useState<OlLayerVector<OlSourceVector>>();
const [, setRevision] = useState<number>(0);
const [selected, setSelected] = useState<string | undefined>(undefined);

const gjFormat = useMemo(() => new OlFormatGeoJson(), []);

Expand Down Expand Up @@ -104,8 +105,8 @@ export const EditFeatureGeometryToolbar: React.FC<EditFeatureGeometryToolbarProp
if (isModified && !formDirty) {
dispatch(setFormDirty(true));
}
// we only want to change formDirty state when the editHistory changes
// eslint-disable-next-line react-hooks/exhaustive-deps
// we only want to change formDirty state when the editHistory changes
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, editHistory.current.past]);

useEffect(() => {
Expand Down Expand Up @@ -221,10 +222,16 @@ export const EditFeatureGeometryToolbar: React.FC<EditFeatureGeometryToolbarProp
className="geometry-edit-tb"
alignment="vertical"
>
<ToggleGroup>
<ToggleGroup
selected={selected}
onChange={(_evt: any, value: string | undefined) => {
setSelected(value);
}}
>
{
allowedEditMode.includes('CREATE') ?
<DrawButton
value="create"
icon={
<FontAwesomeIcon icon={faPencil} />
}
Expand All @@ -243,6 +250,7 @@ export const EditFeatureGeometryToolbar: React.FC<EditFeatureGeometryToolbarProp
{
allowedEditMode.includes('UPDATE') ?
<ModifyButton
value="update"
icon={
<FontAwesomeIcon icon={faDrawPolygon} />
}
Expand All @@ -262,6 +270,7 @@ export const EditFeatureGeometryToolbar: React.FC<EditFeatureGeometryToolbarProp
{
allowedEditMode.includes('DELETE') ?
<DeleteButton
value="delete"
icon={
<FontAwesomeIcon icon={faTrash} />
}
Expand Down
Loading