v0.1 #1
@ -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>;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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>;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										26
									
								
								src/components/QuickCategory.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/components/QuickCategory.tsx
									
									
									
									
									
										Normal 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;
 | 
			
		||||
@ -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>;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,7 @@
 | 
			
		||||
body {
 | 
			
		||||
	background-color: darkgray;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.center-wrapper{
 | 
			
		||||
	margin-top: 30%;
 | 
			
		||||
}
 | 
			
		||||
@ -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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								src/style/quickCategory.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/style/quickCategory.scss
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
.quickCategory-component{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user