implemented tha add of a folder in personal space
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
e259d64387
commit
6875c500f2
@ -0,0 +1,27 @@
|
|||||||
|
import {ReactNode, useState} from "react";
|
||||||
|
import "../style/popup.css"
|
||||||
|
|
||||||
|
export interface PopupProps {
|
||||||
|
children: ReactNode[] | ReactNode,
|
||||||
|
displayState: boolean,
|
||||||
|
onClose: () => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Popup({children, displayState, onClose}: PopupProps) {
|
||||||
|
return (
|
||||||
|
<div id="popup-background"
|
||||||
|
style={{
|
||||||
|
display: displayState ? 'flex' : 'none',
|
||||||
|
position: "absolute",
|
||||||
|
width: "78%",
|
||||||
|
height: "79%",
|
||||||
|
overflow:"hidden"
|
||||||
|
}}
|
||||||
|
onClick={onClose}>
|
||||||
|
<div id="content" onClick={event => event.stopPropagation()}>
|
||||||
|
<button id="close-button" onClick={onClose}>X</button>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
@import url(theme/dark.css);
|
||||||
|
|
||||||
|
#popup-background{
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
color: white;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#content{
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: var(--third-color);
|
||||||
|
display:flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
#close-button{
|
||||||
|
border-radius: 100px;
|
||||||
|
align-self: end;
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace IQBall\Core\Gateway;
|
||||||
|
|
||||||
|
use IQBall\Core\Connection;
|
||||||
|
|
||||||
|
class PersonalSpaceGateway {
|
||||||
|
private Connection $con;
|
||||||
|
|
||||||
|
public function __construct(Connection $con) {
|
||||||
|
$this->con = $con;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addFolder(string $folderName,int $ownerId,int $parentId): void{
|
||||||
|
$this->con->exec("INSERT INTO TacticFolder(name,owner,tactic_folder_parent) VALUES(:name,:owner,:parent)",
|
||||||
|
[
|
||||||
|
"name" =>[$folderName,\PDO::PARAM_STR],
|
||||||
|
"owner"=>[$ownerId,\PDO::PARAM_INT],
|
||||||
|
"parent"=>[$parentId,\PDO::PARAM_INT]
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace IQBall\Core\Model;
|
||||||
|
|
||||||
|
use IQBall\Core\Gateway\PersonalSpaceGateway;
|
||||||
|
|
||||||
|
class PersonalSpaceModel {
|
||||||
|
private PersonalSpaceGateway $gateway;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param PersonalSpaceGateway $gateway
|
||||||
|
*/
|
||||||
|
public function __construct(PersonalSpaceGateway $gateway) {
|
||||||
|
$this->gateway = $gateway;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createFolder(string $folderName,int $ownerId,int $parentFolder): void{
|
||||||
|
$this->gateway->addFolder($folderName,$ownerId,$parentFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue