From 05e09429ac93baa87149d636b103dc5b54b84711 Mon Sep 17 00:00:00 2001 From: mahdi Date: Sun, 8 May 2022 10:31:00 +0430 Subject: [PATCH] delete 5 files and update 5 files ./index.scss --- src/App.js | 12 +- src/{App.css => App.scss} | 0 src/App.test.js | 8 - src/components/Calendar/index.js | 198 ++++++++++-------- src/components/RangeDatePicker/index.js | 35 ++-- .../RangeDatePicker/{index.css => index.scss} | 0 src/components/Switch/index.scss | 4 +- src/index.js | 12 +- src/{index.css => index.scss} | 0 src/logo.svg | 1 - 10 files changed, 136 insertions(+), 134 deletions(-) rename src/{App.css => App.scss} (100%) delete mode 100644 src/App.test.js rename src/components/RangeDatePicker/{index.css => index.scss} (100%) rename src/{index.css => index.scss} (100%) delete mode 100644 src/logo.svg diff --git a/src/App.js b/src/App.js index 3c154a5..28d25e6 100644 --- a/src/App.js +++ b/src/App.js @@ -1,10 +1,10 @@ -import Router from './router.js'; -import {Provider} from 'react-redux'; -import store from './redux/store'; -import 'rc-slider/assets/index.css'; -import 'react-circular-progressbar/dist/styles.css'; +import Router from "./router.js"; +import { Provider } from "react-redux"; +import store from "./redux/store"; +import "rc-slider/assets/index.css"; +import "react-circular-progressbar/dist/styles.css"; -import "./App.css"; +import "./App.scss"; function App() { return ( diff --git a/src/App.css b/src/App.scss similarity index 100% rename from src/App.css rename to src/App.scss diff --git a/src/App.test.js b/src/App.test.js deleted file mode 100644 index 1f03afe..0000000 --- a/src/App.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/src/components/Calendar/index.js b/src/components/Calendar/index.js index 1888261..1e5c4c7 100644 --- a/src/components/Calendar/index.js +++ b/src/components/Calendar/index.js @@ -1,38 +1,49 @@ import React, { useState } from "react"; -import './index.css'; +import "./index.css"; import Calendar from "./CalendarComponents/Calendar"; import { utils } from "./CalendarComponents"; -import './index.css'; +import "./index.css"; const SimpleCalendar = () => { - const [selectedDay, setSelectedDay] = useState(null); - const [type, setType] = useState('dashboard'); - const list = { - 'default':
} - locale="fa" - events={eventsList} + const [selectedDay, setSelectedDay] = useState(null); + const [type, setType] = useState("dashboard"); + const list = { + default: ( + ( +
+ +
+ )} + locale="fa" + events={eventsList} + /> + ), + dashboard: ( + + ), + }; - />, - 'dashboard': , - } - - return ( -
- - {/* + {/* { type='dashboard' /> */} - - { - list[type] - } -
- ); + + {list[type]} + + ); }; const eventsList = [ - { - id: 2, - description: "تست 2", - type: "global", - isHoliday: true, - date: "2022-01-04T00:00:00.000Z", - year: 1400, - month: 10, - day: 2 - }, - { - id: 4, - description: "تست 4", - type: "global", - isHoliday: true, - date: "2022-01-12T00:00:00.000Z", - year: 1400, - month: 10, - day: 1 - }, - { - id: 1, - description: "تست کاربر 1", - type: "userDefined", - userId: "5", - date: "2022-01-12T00:00:00.000Z", - categoryId: 1, - year: 1400, - month: 10, - day: 3, - color: 'blue' - }, - { - id: 4, - description: "تست کاربر 4", - type: "userDefined", - userId: "5", - date: "2022-01-08T00:00:00.000Z", - categoryId: 3, - year: 1400, - month: 11, - day: 6 - }, - { - id: 5, - description: "تست کاربر 5", - type: "userDefined", - userId: "5", - date: "2022-01-12T00:00:00.000Z", - categoryId: 1, - year: 1400, - month: 10, - day: 3 - } + { + id: 2, + description: "تست 2", + type: "global", + isHoliday: true, + date: "2022-01-04T00:00:00.000Z", + year: 1400, + month: 10, + day: 2, + }, + { + id: 4, + description: "تست 4", + type: "global", + isHoliday: true, + date: "2022-01-12T00:00:00.000Z", + year: 1400, + month: 10, + day: 1, + }, + { + id: 1, + description: "تست کاربر 1", + type: "userDefined", + userId: "5", + date: "2022-01-12T00:00:00.000Z", + categoryId: 1, + year: 1400, + month: 10, + day: 3, + color: "blue", + }, + { + id: 4, + description: "تست کاربر 4", + type: "userDefined", + userId: "5", + date: "2022-01-08T00:00:00.000Z", + categoryId: 3, + year: 1400, + month: 11, + day: 6, + }, + { + id: 5, + description: "تست کاربر 5", + type: "userDefined", + userId: "5", + date: "2022-01-12T00:00:00.000Z", + categoryId: 1, + year: 1400, + month: 10, + day: 3, + }, ]; -export default SimpleCalendar; \ No newline at end of file +export default SimpleCalendar; diff --git a/src/components/RangeDatePicker/index.js b/src/components/RangeDatePicker/index.js index 483a6fd..1f56e5d 100644 --- a/src/components/RangeDatePicker/index.js +++ b/src/components/RangeDatePicker/index.js @@ -1,23 +1,22 @@ import React, { useState } from "react"; -import "./index.css"; +import "./index.scss"; import DatePicker from "../Calendar/CalendarComponents"; const RangeDatePicker = () => { - const [selectedDayRange, setSelectedDayRange] = useState({ - from: null, - to: null - }); - return ( - + ); +}; - /> - ); - }; - - export default RangeDatePicker; \ No newline at end of file +export default RangeDatePicker; diff --git a/src/components/RangeDatePicker/index.css b/src/components/RangeDatePicker/index.scss similarity index 100% rename from src/components/RangeDatePicker/index.css rename to src/components/RangeDatePicker/index.scss diff --git a/src/components/Switch/index.scss b/src/components/Switch/index.scss index 9f74f26..86b36a1 100644 --- a/src/components/Switch/index.scss +++ b/src/components/Switch/index.scss @@ -10,10 +10,10 @@ // } .switch { - position: relative; + position: relative; input[type="checkbox"] { visibility: hidden; - position : absolute; + position: absolute; &:checked + label { transform: rotate(0deg); background-color: #000; diff --git a/src/index.js b/src/index.js index ef2edf8..af36065 100644 --- a/src/index.js +++ b/src/index.js @@ -1,14 +1,14 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; +import React from "react"; +import ReactDOM from "react-dom"; +import "./index.scss"; +import App from "./App"; +import reportWebVitals from "./reportWebVitals"; ReactDOM.render( , - document.getElementById('root') + document.getElementById("root") ); // If you want to start measuring performance in your app, pass a function diff --git a/src/index.css b/src/index.scss similarity index 100% rename from src/index.css rename to src/index.scss diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file