Skip to content

Commit

Permalink
🩹 Fix details
Browse files Browse the repository at this point in the history
  • Loading branch information
jyboy committed Apr 16, 2024
1 parent 2c45bbd commit 6678dd2
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
trailingComma: 'none',
semi: true,
singleQuote: true,
importOrder: ['^@core/(.*)$', '^[./]'],
plugins: [
'@trivago/prettier-plugin-sort-imports',
'prettier-plugin-css-order',
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/reservation.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import getCurrentDate from '../../src/utils/getCurrentDate';
import getToday from '../../src/utils/getToday';

describe('The Table Reservation page', () => {
it('enters valid information and clicks submit', () => {
Expand All @@ -14,7 +14,7 @@ describe('The Table Reservation page', () => {
cy.url().should('include', '/reservation-success');
cy.get('[data-testid="success-message"]').should(
'include.text',
getCurrentDate() + ' at 18:00'
getToday() + ' at 18:00'
);
});

Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<meta name="og:description"
content="We are a family owned Mediterranean restaurant, focused on traditional recipes served with a modern twist." />
<meta name="og:image" content="/src/assets/restaurant-chef.jpg" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,200..800;1,200..800&family=Markazi+Text&display=swap" rel="stylesheet">
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"format": "prettier --write \"{src,cypress}/**/*.{js,jsx,css}\"",
"test": "vitest run",
"test:ui": "cypress run",
"cypress:open": "cypress open",
"prepare": "husky"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ body {
min-height: 100vh;
font-size: 16px;
line-height: 1.5;
font-family: Karla, 'Helvetica Neue', Arial, sans-serif;
}

#root {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/TableReservation/TableReservation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom';
import { object, string, number, date } from 'yup';
import Button from '../../components/Button/Button';
import useSubmit from '../../hooks/useSubmit';
import getCurrentDate from '../../utils/getCurrentDate';
import getToday from '../../utils/getToday';

const TableReservation = () => {
const navigate = useNavigate();
Expand All @@ -21,7 +21,7 @@ const TableReservation = () => {

const formik = useFormik({
initialValues: {
date: getCurrentDate(),
date: getToday(),
time: '17:00',
guests: 1,
occasion: 'Birthday'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/UnderConstruction/UnderConstruction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import UnderConstructionImage from '../../assets/under-construction.svg';

const UnderConstruction = () => {
return (
<div className="flex flex-col items-center pt-20">
<div className="flex flex-col items-center pt-16">
<img
src={UnderConstructionImage}
alt="Under Construction illustration"
className="w-96"
className="w-90"
/>
<h1 className="mt-8 font-serif text-5.5xl text-olive">
Under Construction
Expand Down
5 changes: 3 additions & 2 deletions src/utils/getCurrentDate.js → src/utils/getToday.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const getCurrentDate = () => {
// TODO: JSDoc
const getToday = () => {
const date = new Date();
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
};

export default getCurrentDate;
export default getToday;
1 change: 1 addition & 0 deletions src/utils/toStars.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: JSDoc
const toStars = (rating) => {
const fullStars = Math.floor(rating);
const halfStar = rating % 1 !== 0 ? 0.5 : 0;
Expand Down
1 change: 1 addition & 0 deletions src/utils/wait.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: JSDoc
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

export default wait;
4 changes: 2 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export default {
content: ['./index.html', './src/**/*.{js,jsx}'],
theme: {
fontFamily: {
sans: ['Karla', 'Helvetica Neue', 'Arial', 'sans-serif'],
serif: ['Markazi Text', 'Georgia', 'Times New Roman', 'serif']
sans: ['Karla', 'Helvetica Neue', 'sans-serif'],
serif: ['Markazi Text', 'ui-serif', 'serif']
},
colors: {
white: '#fff',
Expand Down

0 comments on commit 6678dd2

Please sign in to comment.