Skip to content

Commit

Permalink
Remove default margin
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr committed Sep 4, 2024
1 parent 42c29e6 commit 2e7b736
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/client/src/AppTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export const theme = createTheme({
textTransform: "none",
whiteSpace: "nowrap",
minWidth: "auto",
marginLeft: "5px",
padding: "8px 12px",
borderRadius: "4px",
boxShadow: "none",
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/components/dataCard/dataCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const DataCardButtonContainer = forwardRef((props, ref) => {
marginTop: "15px",
marginRight: "10px",
}}>
<Stack direction="row" justifyContent="flex-end" alignItems="center">
<Stack direction="row" justifyContent="flex-end" alignItems="center" gap="5px">
{props.children}
</Stack>
</Box>
Expand Down
15 changes: 8 additions & 7 deletions src/client/src/pages/detail/detailHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ const DetailHeader = ({ editingEnabled, setEditingEnabled, editableByCurrentUser
icon={borehole?.data.workflow?.finished != null ? <CheckmarkIcon /> : <div />}
/>
</Stack>
{editableByCurrentUser && (
<>
{editingEnabled && (
{editableByCurrentUser &&
(editingEnabled ? (
<>
<DeleteButton
label="deleteBorehole"
onClick={() =>
Expand All @@ -105,10 +105,11 @@ const DetailHeader = ({ editingEnabled, setEditingEnabled, editableByCurrentUser
])
}
/>
)}
{editingEnabled ? <EndEditButton onClick={stopEditing} /> : <EditButton onClick={startEditing} />}
</>
)}
<EndEditButton onClick={stopEditing} sx={{ marginLeft: "5px" }} />
</>
) : (
<EditButton onClick={startEditing} />
))}
</Stack>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as Styled from "./styles.js";
import { Checkbox, Popup } from "semantic-ui-react";
import { Checkbox } from "semantic-ui-react";
import { copyStratigraphy, deleteStratigraphy } from "../../../../../../../api/fetchApiV2.js";
import { useTranslation } from "react-i18next";
import { CopyButton, DeleteButton } from "../../../../../../../components/buttons/buttons";
import { PromptContext } from "../../../../../../../components/prompt/promptContext";
import { useContext } from "react";
import TrashIcon from "../../../../../../../assets/icons/trash.svg?react";

const InfoCheckBox = props => {
const { profileInfo, updateChange, isEditable, onUpdated } = props.data;
const { t } = useTranslation();
const { showPrompt } = useContext(PromptContext);

return (
<Styled.CheckBoxContainer>
Expand All @@ -31,18 +35,28 @@ const InfoCheckBox = props => {
onUpdated("cloneStratigraphy");
});
}}></CopyButton>
<Popup flowing hoverable on="click" position="right center" trigger={<DeleteButton label="delete" />}>
{t("deleteForever")}?
<br />
<DeleteButton
label="delete"
onClick={() => {
deleteStratigraphy(profileInfo?.id).then(() => {
onUpdated("deleteStratigraphy");
});
}}
/>
</Popup>
<DeleteButton
label="delete"
onClick={() => {
showPrompt(t("deleteMessage"), [
{
label: t("cancel"),
action: null,
},
{
label: t("delete"),
icon: <TrashIcon />,
variant: "contained",
action: () => {
deleteStratigraphy(profileInfo?.id).then(() => {
onUpdated("deleteStratigraphy");
});
},
},
]);
}}
sx={{ marginLeft: "5px" }}
/>
</div>
)}
</Styled.CheckBoxContainer>
Expand Down

0 comments on commit 2e7b736

Please sign in to comment.