Skip to content

Commit

Permalink
Merge pull request #1159 from nataliauvarova/kalmyk_markup
Browse files Browse the repository at this point in the history
Kalmyk markup: part
  • Loading branch information
nataliauvarova authored Dec 4, 2024
2 parents c608de4 + f9693e4 commit 5a359ca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
48 changes: 33 additions & 15 deletions src/components/JoinMarkupsModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
const [typeRelation, setTypeRelation] = useState(null);

const joinActive = firstTextRelation && secondTextRelation && typeRelation;
const [deleteActive, setDeleteActive] = useState(false);

const onAddRelation = useCallback(
/*newMetadata*/ () => {
Expand All @@ -30,6 +31,29 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
]
);

const onDeleteRelation = useCallback(
() => {
console.log("onDeleteRelation!!!!!!!");
},
[
/*language, updateLanguageMetadata*/
]
);

const onRelationSelect = useCallback(
(relation_id, checked) => {
console.log("onRelationSelect!!!!!!!");
console.log("relation_id====");
console.log(relation_id);
console.log("checked====");
console.log(checked);
setDeleteActive(true);
},
[
/*language, updateLanguageMetadata*/
]
);

console.log("perspectiveId====");
console.log(perspectiveId);

Expand All @@ -50,8 +74,8 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
<Modal.Header>{getTranslation("Join markups")}</Modal.Header>
<Modal.Content /*scrolling*/>
<div className="join-markups-content">
<div className="join-markups-content__table1">
{/* Table 1 */}
<div className="join-markups-content__markups">
{/* Table Markups */}
<div className="block-add-relation">
<div className="block-add-relation__column">
<Table celled padded className="lingvo-perspective-table">
Expand Down Expand Up @@ -118,10 +142,6 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
))}
</Form>*/}
<Form>
{/*<div>
Selected value: <b>{typeRelation}</b>
</div>*/}

<Form.Radio
label={getTranslation("Translit")}
name="radioGroup"
Expand All @@ -144,27 +164,25 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
</Form>

<Button
//icon={<i className="lingvo-icon lingvo-icon_check" />}
content={getTranslation("Join")}
onClick={onAddRelation}
className="lingvo-button-greenest"
disabled={!joinActive}
/>

<Button
//icon={<i className="lingvo-icon lingvo-icon_check" />}
content={getTranslation("Delete")}
//onClick={onDeleteRelation}
onClick={onDeleteRelation}
className="lingvo-button-redder"
disabled={true}
disabled={!deleteActive}
/>
</div>
</div>
{/* /Table 1 */}
{/* /Table Markups */}
</div>

<div className="join-markups-content__table2">
{/* Table 2 */}
<div className="join-markups-content__relations">
{/* Table Relations */}
<Table celled padded className="lingvo-perspective-table">
<Table.Header>
<Table.Row>
Expand All @@ -183,7 +201,7 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
<Checkbox
className="lingvo-checkbox"
//checked={!!selectedEntries.find(e => isEqual(e, entry.id))}
//onChange={(e, { checked }) => onEntrySelect(entry.id, checked)}
onChange={(e, { checked }) => onRelationSelect(relation.id, checked)}
/>
</Table.Cell>
<Table.Cell>Left text</Table.Cell>
Expand All @@ -195,7 +213,7 @@ const JoinMarkupsModal = ({ perspectiveId, mode, relations, onClose }) => {
})}
</Table.Body>
</Table>
{/* /Table 2 */}
{/* /Table Relations */}
</div>
</div>
</Modal.Content>
Expand Down
4 changes: 2 additions & 2 deletions src/components/JoinMarkupsModal/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
height: 65vh;
min-height: 450px;

&__table1 {
&__markups {
height: 50%;
padding-bottom: 20px;
}

&__table2 {
&__relations {
height: 50%;
overflow-y: auto;

Expand Down

0 comments on commit 5a359ca

Please sign in to comment.