first implemenation of quick items
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Niklas 2020-04-22 02:40:51 +02:00
parent 00fd49aeff
commit 0625e57be0
7 changed files with 84 additions and 15 deletions

View File

@ -2,6 +2,7 @@ import * as React from "react";
import Quick from "./Quick"; import Quick from "./Quick";
import QuickItem from "./QuickItem"; import QuickItem from "./QuickItem";
import QuickCategory from "./QuickCategory";
class App extends React.Component { class App extends React.Component {
constructor(props) { constructor(props) {
@ -10,9 +11,28 @@ class App extends React.Component {
render(): JSX.Element { render(): JSX.Element {
return <div> return <div>
<Quick> <div className="center-wrapper">
<QuickItem/> <Quick>
</Quick> <QuickCategory name="Cat 1">
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
</QuickCategory>
<QuickCategory name="Cat 2">
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
</QuickCategory>
<QuickCategory name="Cat 3">
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
<QuickItem name="Hello World" />
</QuickCategory>
</Quick>
</div>
</div>; </div>;
} }

View File

@ -3,10 +3,11 @@ import * as PropTypes from "prop-types";
import "../style/quick.scss"; import "../style/quick.scss";
class Quick extends React.Component { interface Props {
static propTypes = { children: React.ReactNode;
children : PropTypes.element }
};
class Quick extends React.Component<Props> {
constructor(props){ constructor(props){
super(props); super(props);
@ -14,7 +15,10 @@ class Quick extends React.Component {
render(): JSX.Element { render(): JSX.Element {
return <div className="quick-component"> return <div className="quick-component">
{this.props.children} <p>Quick list</p>
<div className="container">
{this.props.children}
</div>
</div>; </div>;
} }

View File

@ -0,0 +1,26 @@
import * as React from "react";
import * as PropTypes from "prop-types";
import "../style/quickCategory.scss";
interface Props {
children: React.ReactNode;
name: string;
}
class QuickCategory extends React.Component<Props> {
constructor(props){
super(props);
}
render(): JSX.Element {
return <div className="quickCategory-component">
{this.props.name}
{this.props.children}
</div>;
}
}
export default QuickCategory;

View File

@ -3,10 +3,11 @@ import * as PropTypes from "prop-types";
import "../style/quickItem.scss"; import "../style/quickItem.scss";
class QuickItem extends React.Component { interface Props {
static propTypes = { name: string;
url: PropTypes.string.isRequired }
};
class QuickItem extends React.Component<Props> {
constructor(props){ constructor(props){
super(props); super(props);
@ -14,6 +15,7 @@ class QuickItem extends React.Component {
render(): JSX.Element { render(): JSX.Element {
return <div className="quickItem-component"> return <div className="quickItem-component">
{this.props.name}
</div>; </div>;
} }

View File

@ -1,3 +1,7 @@
body { body {
background-color: darkgray; background-color: darkgray;
} }
.center-wrapper{
margin-top: 30%;
}

View File

@ -1,3 +1,13 @@
.quick-component { .quick-component {
background-color: green; border: 3px solid green;
width: 70%;
margin: auto;
.container {
display: flex;
justify-content: space-evenly;
flex-direction: row;
flex-wrap: wrap;
}
} }

View File

@ -0,0 +1,3 @@
.quickCategory-component{
}