Skip to content

Commit 0f80e2c

Browse files
authored
fix: Merge pull request #300 from UniversalDataTool/better-convert-button
Change convert button to link to universaldatatool.com/convert
2 parents b50bf4f + b1004a9 commit 0f80e2c

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

src/components/DownloadButton/index.js

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { styled } from "@material-ui/core/styles"
77
import * as colors from "@material-ui/core/colors"
88
import Button from "@material-ui/core/Button"
99
import HeaderPopupBox from "../HeaderPopupBox"
10-
import SimpleDialog from "../SimpleDialog"
1110

1211
import { useTranslation } from "react-i18next"
1312

@@ -16,9 +15,10 @@ const Container = styled("div")({ position: "relative" })
1615
const StyledButton = styled(Button)({
1716
justifyContent: "flex-start",
1817
"& .fakeicon": {
19-
display: "inline",
18+
display: "inline-block",
2019
marginRight: 8,
2120
padding: 4,
21+
textAlign: "center",
2222
paddingTop: 5,
2323
fontSize: 11,
2424
fontWeight: "bold",
@@ -40,7 +40,6 @@ const StyledButton = styled(Button)({
4040

4141
export default ({ interfaceType, onDownload }) => {
4242
const [open, changeOpen] = useState(false)
43-
const [downloadMaskDialogOpen, setDownloadMaskDialogOpen] = useState(false)
4443
const { t } = useTranslation()
4544

4645
return (
@@ -61,37 +60,15 @@ export default ({ interfaceType, onDownload }) => {
6160
<div className="fakeicon blue">JSON</div>
6261
{t("download-json")}
6362
</StyledButton>
64-
{(interfaceType || "").includes("image") &&
65-
(interfaceType || "").includes("segmentation") && (
66-
<StyledButton
67-
fullWidth
68-
onClick={() => setDownloadMaskDialogOpen(true)}
69-
>
70-
<div className="fakeicon orange">IMG</div>
71-
Download Masks
72-
</StyledButton>
73-
)}
63+
<StyledButton
64+
fullWidth
65+
target="_blank"
66+
href="https://universaldatatool.com/convert"
67+
>
68+
<div className="fakeicon orange"></div>
69+
{t("other-formats")}
70+
</StyledButton>
7471
</HeaderPopupBox>
75-
<SimpleDialog
76-
title="How to Download Masks"
77-
open={downloadMaskDialogOpen}
78-
onClose={() => setDownloadMaskDialogOpen(false)}
79-
>
80-
We can't process the image masks online because of processing
81-
limitations, however, if you have "npm" installed you can run the line
82-
below to get all the masks in your file.
83-
<pre>npx autoseg some_file.udt.json -o output_directory</pre>
84-
<div style={{ marginTop: 16 }}>
85-
Read more about{" "}
86-
<a
87-
style={{ color: colors.blue[500] }}
88-
href="https://github.com/UniversalDataTool/autoseg/blob/master/README.md"
89-
>
90-
autoseg
91-
</a>
92-
.
93-
</div>
94-
</SimpleDialog>
9572
</Container>
9673
)
9774
}

src/i18n/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@
7777
"transform-video-keyframes-dialog-explanation-text": "This operation will convert keyframes set on a video into individual image segmentation frames. Your interface type will change from 'video_segmentation' into 'image_segmentation'. This is sometimes helpful when preparing video data for a computer vision model.",
7878
"transform-video-keyframes-dialog-explanation-warning": "You need to label some keyframes to use this.",
7979
"universal-data-viewer-interface-warning": "This interface hasn't been set up properly, try selecting an interface in the 'Setup' tab.",
80-
"setup-project": "Setup Project"
80+
"setup-project": "Setup Project",
81+
"other-formats": "Other Formats"
8182
}

0 commit comments

Comments
 (0)