mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
🚧 Start working on "Create object" panel
This commit is contained in:
parent
721c9afaef
commit
734f8ac057
4 changed files with 41 additions and 6 deletions
32
frontend/src/components/NewResearchGroupPanel.tsx
Normal file
32
frontend/src/components/NewResearchGroupPanel.tsx
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
import * as React from "react"
|
||||||
|
import {Field, Button, Select} from "@steffo/bluelib-react";
|
||||||
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||||
|
import {faPlus} from "@fortawesome/free-solid-svg-icons";
|
||||||
|
import {ObjectPanel} from "./ObjectPanel";
|
||||||
|
|
||||||
|
|
||||||
|
export function NewResearchGroupPanel(): JSX.Element {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ObjectPanel>
|
||||||
|
<ObjectPanel.Icon>
|
||||||
|
<Select>
|
||||||
|
<Select.Option value={"🌐"}/>
|
||||||
|
<Select.Option value={"🎓"}/>
|
||||||
|
<Select.Option value={"🔒"}/>
|
||||||
|
</Select>
|
||||||
|
</ObjectPanel.Icon>
|
||||||
|
<ObjectPanel.Name>
|
||||||
|
<Field placeholder={"Project name"} required/>
|
||||||
|
</ObjectPanel.Name>
|
||||||
|
<ObjectPanel.Text>
|
||||||
|
|
||||||
|
</ObjectPanel.Text>
|
||||||
|
<ObjectPanel.Buttons>
|
||||||
|
<Button>
|
||||||
|
<FontAwesomeIcon icon={faPlus}/> Create
|
||||||
|
</Button>
|
||||||
|
</ObjectPanel.Buttons>
|
||||||
|
</ObjectPanel>
|
||||||
|
)
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
.ObjectPanel {
|
.ObjectPanel {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-areas: "icon name text buttons";
|
grid-template-areas: "icon name text buttons";
|
||||||
grid-template-columns: auto 1fr 4fr auto;
|
/* Not sure about this, there probably is a better way */
|
||||||
|
grid-template-columns: auto minmax(25%, 1fr) auto auto;
|
||||||
grid-gap: 8px;
|
grid-gap: 8px;
|
||||||
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
@ -6,8 +6,8 @@ import {BluelibHTMLProps} from "@steffo/bluelib-react/dist/types";
|
||||||
import classNames from "classnames"
|
import classNames from "classnames"
|
||||||
|
|
||||||
|
|
||||||
interface ObjectPanelProps extends PanelProps {}
|
export interface ObjectPanelProps extends PanelProps {}
|
||||||
interface ObjectSubPanelProps extends BluelibHTMLProps<HTMLDivElement> {}
|
export interface ObjectSubPanelProps extends BluelibHTMLProps<HTMLDivElement> {}
|
||||||
|
|
||||||
|
|
||||||
export function ObjectPanel({className, ...props}: ObjectPanelProps): JSX.Element {
|
export function ObjectPanel({className, ...props}: ObjectPanelProps): JSX.Element {
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import * as ReactDOM from "react-dom"
|
|
||||||
import {useDRFManagedList} from "../hooks/useDRF";
|
import {useDRFManagedList} from "../hooks/useDRF";
|
||||||
import {ResearchGroup, ResearchProject} from "../types";
|
import {ResearchProject} from "../types";
|
||||||
import {Loading} from "./Loading";
|
import {Loading} from "./Loading";
|
||||||
import {ResearchGroupPanel} from "./ResearchGroupPanel";
|
|
||||||
import {Box, Heading} from "@steffo/bluelib-react";
|
import {Box, Heading} from "@steffo/bluelib-react";
|
||||||
import {ResearchProjectPanel} from "./ResearchProjectPanel";
|
import {ResearchProjectPanel} from "./ResearchProjectPanel";
|
||||||
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||||
|
import {faPlus} from "@fortawesome/free-solid-svg-icons";
|
||||||
|
import {NewResearchGroupPanel} from "./NewResearchGroupPanel";
|
||||||
|
|
||||||
|
|
||||||
interface ProjectsListBoxProps {
|
interface ProjectsListBoxProps {
|
||||||
|
@ -35,6 +36,7 @@ export function ResearchProjectsByGroupListBox({group_pk}: ProjectsListBoxProps)
|
||||||
</Heading>
|
</Heading>
|
||||||
<div>
|
<div>
|
||||||
{groups}
|
{groups}
|
||||||
|
<NewResearchGroupPanel/>
|
||||||
</div>
|
</div>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue