SimpleDatePicker Component Made

master
Pedram Keshavarzi 3 years ago
parent dbb338b0c9
commit 4f2d52e18f
  1. 19
      src/components/SimpleDatePicker/index.js
  2. 11
      src/redux/data.js

@ -0,0 +1,19 @@
import React, { useState } from 'react';
import DatePicker from "react-modern-calendar-datepicker";
import '../Calendar/index.css';
const SimpleDatePicker = () =>{
const [selectedDay, setSelectedDay] = useState(null);
return(
<div className='flex items-center justify-center w-full my-2'>
<DatePicker
value={selectedDay}
onChange={setSelectedDay}
inputPlaceholder="Select a day"
shouldHighlightWeekends
locale='fa'
/>
</div>
)
}
export default SimpleDatePicker;

@ -23,6 +23,7 @@ import Product from "../components/Product";
import Navbar from "../components/Navbar";
import SimpleCalendar from '../components/Calendar';
import Footer from "../components/Footer";
import SimpleDatePicker from "../components/SimpleDatePicker";
const components = [
{
name: "Button",
@ -475,6 +476,16 @@ const components = [
code: null,
},
},
{
name: "SimpleDatePicker",
author: "Keshavarzi",
props: [],
content: {
name: "SimpleDatePicker",
component: <SimpleDatePicker />,
code: null,
},
},
];
export default components;

Loading…
Cancel
Save