style: added navbar and fixed styling

This commit is contained in:
rutik wankhade 2020-08-05 21:43:04 +05:30
parent 682ceafbcc
commit 0c7125ee6d
7 changed files with 49 additions and 25 deletions

4
src/components/App.css Normal file
View File

@ -0,0 +1,4 @@
.navbar{
color:#ffffff;
padding-left:40px;
}

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import ConfigCover from './ConfigCover'; import ConfigCover from './ConfigCover';
import Navbar from './Navbar';
class App extends React.Component { class App extends React.Component {
@ -8,6 +8,8 @@ class App extends React.Component {
render() { render() {
return ( return (
<div> <div>
<Navbar />
<ConfigCover /> <ConfigCover />
</div> </div>

View File

@ -1,12 +1,20 @@
.container{ .container{
margin:20px; width:auto;
display:flex; display:flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.inputData{
margin:60px 0px 20px 0px;
}
label{margin:5px;} label{margin:5px;}
.input-sm{width:60px;}
input{margin:4px;} input{margin:4px;}
.inputTitle{
height:40px;
width:300px;
border-radius:4px;
padding-left:20px;
}

View File

@ -5,8 +5,6 @@ class ConfigCover extends React.Component {
state = { state = {
title: 'How I built my first project with react', title: 'How I built my first project with react',
height: 420,
width: 800,
bgcolor: '', bgcolor: '',
bxshadow: '' bxshadow: ''
}; };
@ -15,38 +13,37 @@ class ConfigCover extends React.Component {
return ( return (
<div className="container"> <div className="container">
<div className="inputData">
<input type="text" placeholder="Enter title here" className="inputTitle"
onChange={e => this.setState({ title: e.target.value })}></input>
<input type="text" placeholder="Enter title here" {/* <div className="d-flex flex-row">
onChange={e=>this.setState({title:e.target.value})}></input>
<div className="d-flex flex-row">
<label >width</label> <label >width</label>
<input type="number" name="width" className="input-sm" <input type="number" name="width" className="input-sm"
onChange={e=>this.setState({width:e.target.value})}></input> onChange={e=>this.setState({width:e.target.value})}></input>
<label >height</label> <label >height</label>
<input type="number" name="height" className="input-sm" <input type="number" name="height" className="input-sm"
onChange={e=>this.setState({height:e.target.value})}></input> onChange={e=>this.setState({height:e.target.value})}></input>
</div> </div> */}
<label>Background</label> <label>Background</label>
<input type="color" defaultValue="#c5a8ff" <input type="color" defaultValue="#c5a8ff"
onChange={e=>this.setState({bgcolor:e.target.value})}/> onChange={e => this.setState({ bgcolor: e.target.value })} />
<label>box-shadow</label> <label>box-shadow</label>
<input type="color" defaultValue="#8c52ff" <input type="color" defaultValue="#8c52ff"
onChange={e=>this.setState({bxshadow:e.target.value})} /> onChange={e => this.setState({ bxshadow: e.target.value })} />
</div>
<CoverImage <CoverImage
title={this.state.title} title={this.state.title}
bgcolor={this.state.bgcolor} bgcolor={this.state.bgcolor}
bxshadow={this.state.bxshadow} bxshadow={this.state.bxshadow}
height={this.state.height}
width={this.state.width}
/> />

View File

@ -6,8 +6,8 @@
} }
.cover{ .cover{
width:auto; width:800px;
height:auto; height:420px;
background-color: #c5a8ff; background-color: #c5a8ff;
text-align: center; text-align: center;

13
src/components/Navbar.js Normal file
View File

@ -0,0 +1,13 @@
import React from 'react';
import './App.css';
const Navbar = () => {
return <nav className="navbar bg-dark"><h4>CoverView</h4></nav>;
};
export default Navbar;

View File

@ -5,7 +5,7 @@ import App from './components/App';
ReactDOM.render( ReactDOM.render(
<App/>, <App />,
document.querySelector('#root') document.querySelector('#root')
); );