v0.1 #1

Merged
niklas merged 17 commits from develop into master 2020-04-22 14:53:02 +00:00
7 changed files with 84 additions and 15 deletions
Showing only changes of commit 0625e57be0 - Show all commits

View File

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

View File

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

View File

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

View File

@ -1,3 +1,13 @@
.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{
}