forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from roboduels/feat/grades-form-improvements
add: advanced controls support
- Loading branch information
Showing
4 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.grades-form-advanced-controls { | ||
position: relative; | ||
} |
35 changes: 35 additions & 0 deletions
35
cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
import React, { useCallback } from 'react'; | ||
import './grades-form-advanced-controls.scss'; | ||
import Button from 'antd/lib/button'; | ||
|
||
interface Props { | ||
onRobogradesAndMasks(): void; | ||
} | ||
|
||
function GradesFormAdvancedControls({ onRobogradesAndMasks }: Props): JSX.Element { | ||
const [isExpanded, setIsExpanded] = React.useState(false); | ||
|
||
const handleToggle = useCallback((): void => { | ||
setIsExpanded((prev) => !prev); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<div className='grades-form-advanced-controls-toggle'> | ||
<Button type='link' block onClick={handleToggle}> | ||
{isExpanded ? 'Hide Advanced' : 'Advanced'} | ||
</Button> | ||
</div> | ||
{isExpanded && ( | ||
<Button block onClick={onRobogradesAndMasks}> | ||
Generate Robogrades & Masks | ||
</Button> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export default GradesFormAdvancedControls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters