From fd8dc43f8748bfc6c0723a24fa28de4c3228e222 Mon Sep 17 00:00:00 2001 From: amulya <amulya.n@nivuessolutions.com> Date: Fri, 7 Jan 2022 20:23:37 +0530 Subject: [PATCH] creating buttons --- src/App.js | 10 +++++----- src/components/Button/Button.module.scss | 2 +- src/components/Button/index.jsx | 3 ++- src/containers/Login/index.jsx | 16 +++++++++------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/App.js b/src/App.js index edd4203..8e79aaf 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,4 @@ -import Footer from './components/Footer/Footer' import Button from './components/Button/index' import React, { lazy, Suspense } from "react"; import { BrowserRouter, Route, Routes } from "react-router-dom"; @@ -10,18 +9,19 @@ function App() { return ( <div className="App"> - {/* <BrowserRouter> + { <BrowserRouter> <Suspense fallback={<div> loading</div>}> <Routes> <Route exact path="/login" element={<Login />} /> <Route path="/" element={<Login />} /> </Routes> </Suspense> - </BrowserRouter> */} - + </BrowserRouter> + } + - <Footer/> + </div> ); diff --git a/src/components/Button/Button.module.scss b/src/components/Button/Button.module.scss index 01690d4..f9ea375 100644 --- a/src/components/Button/Button.module.scss +++ b/src/components/Button/Button.module.scss @@ -1,5 +1,5 @@ .customButton { background-color: red; -} +} diff --git a/src/components/Button/index.jsx b/src/components/Button/index.jsx index afee0ba..0975c52 100644 --- a/src/components/Button/index.jsx +++ b/src/components/Button/index.jsx @@ -4,7 +4,8 @@ import cs from "classnames"; import styles from "./Button.module.scss"; function Button(props) { - return <div className={cs(styles.customButton)}>here</div>; + return <div onClick={props.handleClick} className={`btn btn-${props.color} btn-${props.size}`}> {props.buttonName}</div> + // "btn btn-primary btn-lg" } Button.propTypes = {}; diff --git a/src/containers/Login/index.jsx b/src/containers/Login/index.jsx index eef0abf..c9f3883 100644 --- a/src/containers/Login/index.jsx +++ b/src/containers/Login/index.jsx @@ -2,14 +2,16 @@ import React from "react"; import PropTypes from "prop-types"; import Button from "components/Button"; + + function Login(props) { - // return <div>login</div>; - return <> - <Button buttonName="pwe"/> - {/* <Button type="password" name="password" /> */} - </> -} + return <div>login</div>; + + -Login.propTypes = {}; + + +Login.propTypes = {}; +} export default Login; -- GitLab