main
Last change
on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
1.6 KB
|
Line | |
---|
1 | import styles from "../EntranceModal/EntranceModal.module.css";
|
---|
2 | import React from "react";
|
---|
3 | import PropTypes from "prop-types";
|
---|
4 | import MapShape from "../../../scripts/base/MapShape.js";
|
---|
5 |
|
---|
6 | export default function ModalSelectConnections2({shapeInfo,updateModalData,addConnection,availableShapes}) {
|
---|
7 |
|
---|
8 | console.log("shapes modal",availableShapes)
|
---|
9 | return (
|
---|
10 | <div className={styles.formGroup}>
|
---|
11 | <label htmlFor="selectedPin">Select connections:</label>
|
---|
12 | <select
|
---|
13 | id="selectedPin"
|
---|
14 | name="selectedPin"
|
---|
15 | value={shapeInfo.selectedPin}
|
---|
16 | onChange={updateModalData}
|
---|
17 | >
|
---|
18 | <option value="">Select Connection</option>
|
---|
19 | {availableShapes
|
---|
20 | .filter(
|
---|
21 | (s) =>
|
---|
22 | !s.info.selectedPins.includes(shapeInfo.name) &&
|
---|
23 | s.info.name !== "" &&
|
---|
24 | s.info.name !== shapeInfo.name
|
---|
25 | )
|
---|
26 | .map((othShape, index) => (
|
---|
27 | <option key={index} value={othShape.info.name}>
|
---|
28 | {othShape.info.name}
|
---|
29 | </option>
|
---|
30 | ))}
|
---|
31 | </select>
|
---|
32 | <button type="button" onClick={addConnection} className={styles.addButton}>
|
---|
33 | Add Connection
|
---|
34 | </button>
|
---|
35 | </div>
|
---|
36 | )
|
---|
37 | }
|
---|
38 |
|
---|
39 | ModalSelectConnections2.propTypes = {
|
---|
40 | shapeInfo: PropTypes.object,
|
---|
41 | updateModalData: PropTypes.func,
|
---|
42 | addConnection: PropTypes.func,
|
---|
43 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.