From 78064e3f8f7a61b576933b85c1294b5750280e24 Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Sun, 22 Sep 2024 01:59:04 +0300 Subject: [PATCH] Move schedule components to a separate directory --- src/App.jsx | 2 +- src/{ => Schedule}/Event.jsx | 0 src/{ => Schedule}/Schedule.jsx | 6 +++--- src/{ => Schedule}/Schedule.scss | 4 ++-- src/{ => Schedule}/ScheduleChooser.jsx | 0 src/{ => Schedule}/ScheduleLoader.jsx | 2 +- src/{ => Schedule}/constants.js | 0 src/Schedule/utils.js | 3 +++ src/utils.js | 4 ---- 9 files changed, 10 insertions(+), 11 deletions(-) rename src/{ => Schedule}/Event.jsx (100%) rename src/{ => Schedule}/Schedule.jsx (96%) rename src/{ => Schedule}/Schedule.scss (97%) rename src/{ => Schedule}/ScheduleChooser.jsx (100%) rename src/{ => Schedule}/ScheduleLoader.jsx (93%) rename src/{ => Schedule}/constants.js (100%) create mode 100644 src/Schedule/utils.js diff --git a/src/App.jsx b/src/App.jsx index 8ac7881..ced3174 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import ScheduleChooser from './ScheduleChooser.jsx'; +import ScheduleChooser from './Schedule/ScheduleChooser.jsx'; function App() { return (); diff --git a/src/Event.jsx b/src/Schedule/Event.jsx similarity index 100% rename from src/Event.jsx rename to src/Schedule/Event.jsx diff --git a/src/Schedule.jsx b/src/Schedule/Schedule.jsx similarity index 96% rename from src/Schedule.jsx rename to src/Schedule/Schedule.jsx index 0663527..e32534d 100644 --- a/src/Schedule.jsx +++ b/src/Schedule/Schedule.jsx @@ -1,10 +1,10 @@ import PropTypes from 'prop-types'; -import useSchedule from './hooks/useSchedule.js'; +import useSchedule from '../hooks/useSchedule.js'; import { getSpeakerName, isTrackHidden } from './utils.js'; import { Fragment } from 'react'; -import useScheduleTable from './hooks/useScheduleTable.js'; +import useScheduleTable from '../hooks/useScheduleTable.js'; import Event from './Event.jsx'; -import defaultSpeaker from './assets/default-speaker.png'; +import defaultSpeaker from '../assets/default-speaker.png'; import './Schedule.scss'; import { langs } from './constants.js'; diff --git a/src/Schedule.scss b/src/Schedule/Schedule.scss similarity index 97% rename from src/Schedule.scss rename to src/Schedule/Schedule.scss index 8e3350e..74a2536 100644 --- a/src/Schedule.scss +++ b/src/Schedule/Schedule.scss @@ -71,11 +71,11 @@ } .schedule-en::after { - background: url('./assets/en_US.png'); + background: url('../assets/en_US.png'); } .schedule-bg::after { - background: url('./assets/bg_BG.png'); + background: url('../assets/bg_BG.png'); } .schedule-avatar { diff --git a/src/ScheduleChooser.jsx b/src/Schedule/ScheduleChooser.jsx similarity index 100% rename from src/ScheduleChooser.jsx rename to src/Schedule/ScheduleChooser.jsx diff --git a/src/ScheduleLoader.jsx b/src/Schedule/ScheduleLoader.jsx similarity index 93% rename from src/ScheduleLoader.jsx rename to src/Schedule/ScheduleLoader.jsx index a742e4d..c1b7ee8 100644 --- a/src/ScheduleLoader.jsx +++ b/src/Schedule/ScheduleLoader.jsx @@ -1,4 +1,4 @@ -import useConferences from './hooks/useConferences.js'; +import useConferences from '../hooks/useConferences.js'; import Schedule from './Schedule.jsx'; import PropTypes from 'prop-types'; import { useMemo } from 'react'; diff --git a/src/constants.js b/src/Schedule/constants.js similarity index 100% rename from src/constants.js rename to src/Schedule/constants.js diff --git a/src/Schedule/utils.js b/src/Schedule/utils.js new file mode 100644 index 0000000..4c2dab7 --- /dev/null +++ b/src/Schedule/utils.js @@ -0,0 +1,3 @@ +export const getSpeakerName = speaker => speaker.first_name.concat(' ').concat(speaker.last_name); + +export const isTrackHidden = track => track.name.en === 'Other' || track.name.bg === 'Други'; diff --git a/src/utils.js b/src/utils.js index 3d04165..2908d74 100644 --- a/src/utils.js +++ b/src/utils.js @@ -9,10 +9,6 @@ function sorter(a, b, fieldFn) { export const dateSorter = key => (a, b) => sorter(a, b, item => Date.parse(item[key])); -export const getSpeakerName = speaker => speaker.first_name.concat(' ').concat(speaker.last_name); - -export const isTrackHidden = track => track.name.en === 'Other' || track.name.bg === 'Други'; - export function calculateProgress(...elements) { const totalCount = elements.length;