Skip to content

Commit

Permalink
Merge pull request #7 from NikitaBystritsky/module4-task1
Browse files Browse the repository at this point in the history
  • Loading branch information
keksobot authored Dec 24, 2024
2 parents 686d706 + 55fcaf0 commit 27b0a0a
Show file tree
Hide file tree
Showing 16 changed files with 617 additions and 306 deletions.
222 changes: 222 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
"@babel/preset-env": "^7.26.0",
"babel-loader": "^9.2.1",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"dayjs": "^1.11.13",
"html-webpack-plugin": "^5.6.3",
"style-loader": "^4.0.0",
"webpack": "^5.79.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^5.2.0"
Expand Down
22 changes: 7 additions & 15 deletions src/mock/const.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
export const DATE_FORMAT = 'MMM D';
export const TIME_FORMAT = 'HH:mm';
export const DAY_FOMAT = 'D';
export const FULL_TIME_FOMAT = 'YYYY-MM-DDTHH:mm';
export const SLASH_TIME_FOMAT = 'DD/MM/YY HH:mm';
export const MILLISECONDS_IN_DAY = 86400000;
export const MILLISECONDS_IN_HOUR = 3600000;
export const DESTINATION_COUNT = 4;
export const POINT_COUNT = 4;
export const OFFER_COUNT = 7;

export const BooleanValues = [
true,
false
];

export const POINT_EMPTY = {
basePrice: 0,
dateFrom: null,
Expand All @@ -20,6 +23,7 @@ export const POINT_EMPTY = {
offers: [],
type: 'flight',
};

export const DESCRIPTION = [
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.',
'Aenean commodo ligula eget dolor. Aenean mass',
Expand All @@ -28,6 +32,7 @@ export const DESCRIPTION = [
'Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.',
'In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. '
];

export const OFFERS = [
'Close But No Cigar',
'On the Same Page',
Expand All @@ -39,6 +44,7 @@ export const OFFERS = [
'Break The Ice',
'In the Red',
];

export const ROUTE_TYPE = [
'Taxi',
'Bus',
Expand All @@ -50,6 +56,7 @@ export const ROUTE_TYPE = [
'Sightseeing',
'Restaurant'
];

export const CITIES = [
'Salisbury',
'Kingston upon Hull',
Expand All @@ -61,18 +68,3 @@ export const CITIES = [
'Chelmsford',
'Carlisle'
];
export const DATES = [
'2019-07-10T22:55:56.845Z',
'2019-07-11T22:55:56.845Z',
'2019-07-12T22:55:56.845Z',
'2019-07-13T22:55:56.845Z',
'2019-07-14T22:55:56.845Z'
];
export const id = [
'zpJruf3vmWw-8MUyZPWx',
'stg9-c9zrK0pu2n99OUe',
'YT-SMjFHc7S_uEnU61Th',
'-gDk1GeiUafeZJJQ-dpE',
'QqbAXKJ_Couc3bhn-ba8',
'bcpicZLm9rLOUZ85Y4M_'
];
9 changes: 5 additions & 4 deletions src/mock/point.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {getRandomInt, getRandomBulValue} from '../utils.js';
import {getRandomInt, getRandomBulValue, getDate} from '../utils.js';
export const generatePoint = (offerType, destinationId, offerIds) => ({
id: crypto.randomUUID(),
basePrice: getRandomInt(),
dateFrom: '2019-01-10T20:55:56.845Z',
dateTo: '2019-01-12T22:55:56.845Z',
dateFrom: getDate(false),
dateTo: getDate(true),
destination: destinationId,
isFavorite: getRandomBulValue(),
offers: offerIds,
type: offerType
});
}
);
Loading

0 comments on commit 27b0a0a

Please sign in to comment.