-
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.
собрал создание карт, модулей, уровней в один компонент
- Loading branch information
Showing
4 changed files
with
93 additions
and
25 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
65 changes: 65 additions & 0 deletions
65
frontend/src/components/mapMenu/SuperUserMap/superUserControlPanel/CreateUnit.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,65 @@ | ||
import React from 'react'; | ||
import mapMenuStore from "../../../../store/mapMenuStore.ts"; | ||
import CustomButton from "../../../../UIComponents/customButton/CustomButton.tsx"; | ||
import CustomInput from "../../../../UIComponents/customInput/CustomInput.tsx"; | ||
import CustomAddButton from "../../../../UIComponents/customAddButton/CustomAddButton.tsx"; | ||
import {IMapType} from "../../../../types/MapType.ts"; | ||
import {IModuleType} from "../../../../types/ModuleType.ts"; | ||
import {ILevelType} from "../../../../types/LevelType.ts"; | ||
|
||
interface IPropTypes { | ||
classNameSelect: string, | ||
handleOnClickOptionUnit: (unit: IMapType | IModuleType | ILevelType, index: number) => void, | ||
handleOnClickDeleteUnit: (unitId: string) => void, | ||
unitName: string, | ||
handleOnChangeUnitName: (e: React.FormEvent<HTMLInputElement>) => void, | ||
handleOnClickCreateUnit: (unitName: string) => void, | ||
currentUnitId: string | ||
} | ||
|
||
const CreateUnit: React.FC<IPropTypes> = | ||
({ | ||
classNameSelect, | ||
handleOnClickOptionUnit, | ||
handleOnClickDeleteUnit, | ||
unitName, | ||
handleOnChangeUnitName, | ||
handleOnClickCreateUnit, | ||
currentUnitId | ||
}) => { | ||
return ( | ||
<div> | ||
<select className={classNameSelect}> | ||
<option value="-">-</option> | ||
{mapMenuStore.availableMaps?.map((map, index) => | ||
<option | ||
key={map.id} | ||
value={map.title} | ||
onClick={() => handleOnClickOptionUnit(map, index)} | ||
> | ||
{map.title} | ||
</option>) | ||
} | ||
</select> | ||
|
||
<CustomButton | ||
text="Удалить выбранную карту" | ||
className={`delete-${unitName}__btn`} | ||
handleOnClick={() => handleOnClickDeleteUnit(currentUnitId)} | ||
/> | ||
|
||
<div className={`map-creator-item ${unitName}-create`}> | ||
<CustomInput | ||
type="text" | ||
value={unitName} | ||
handleOnChange={(e) => handleOnChangeUnitName(e)} | ||
/> | ||
<CustomAddButton | ||
handleOnClick={() => handleOnClickCreateUnit(unitName)} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CreateUnit; |
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
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 |
---|---|---|
|
@@ -117,6 +117,7 @@ | |
left: 35%; | ||
top: 50%; | ||
transform: translate(0, -50%); | ||
word-break: break-word; | ||
} | ||
|
||
.user-photo { | ||
|