diff --git a/src/components/MainPage/MainPage.tsx b/src/components/MainPage/MainPage.tsx new file mode 100644 index 0000000..0a4e46e --- /dev/null +++ b/src/components/MainPage/MainPage.tsx @@ -0,0 +1,109 @@ +import Card from '../MainPageCard/Card.tsx'; +import {cardProperties} from '../../index.tsx'; +function MainPage({ CardProps }: { CardProps:cardProperties[] }):JSX.Element{ + return( +
+
+
+
+
+ + 6 cities logo + +
+ +
+
+
+ +
+

Cities

+
+
+ +
+
+
+
+
+

Places

+ {CardProps[0].NumberOfPlaces} places to stay in Amsterdam +
+ Sort by + + Popular + + + + +
    +
  • Popular
  • +
  • Price: low to high
  • +
  • Price: high to low
  • +
  • Top rated first
  • +
+
+
+ + + + +
+
+
+
+
+
+
+
+
+ ); +} +export default MainPage; diff --git a/src/components/MainPageCard/Card.tsx b/src/components/MainPageCard/Card.tsx new file mode 100644 index 0000000..e6c2be1 --- /dev/null +++ b/src/components/MainPageCard/Card.tsx @@ -0,0 +1,40 @@ +import {cardProperties} from '../../index.tsx'; +function Card(MainPageCardProps:cardProperties):JSX.Element{ + return( +
+ {MainPageCardProps.Premium ? +
+ Premium +
: null} +
+ + Place image + +
+
+
+
+ €{MainPageCardProps.Price} + / night +
+ +
+
+
+ + Rating +
+
+

+ {MainPageCardProps.Description} +

+

{MainPageCardProps.ApartsmentType}

+
+
); +} +export default Card; diff --git a/src/index.tsx b/src/index.tsx index be81a6e..99250b6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,12 +1,64 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; +import App from './components/MainPage/MainPage'; const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); +type cardProperties={ + Premium:boolean; + Price:number; + Img:string; + ApartsmentType:string; + Description:string; + NumberOfPlaces?:number; +}; +export type {cardProperties}; + +const mainPageCardInfo:cardProperties[] = [ + { + Premium:true, + Price:120, + Img:'../markup/Img/apartment-01.jpg', + ApartsmentType:'Apartment', + Description:'Beautiful & luxurious apartment at great location', + NumberOfPlaces:132 + }, + { + Premium:false, + Price:80, + Img:'../markup/Img/room.jpg', + ApartsmentType:'Room', + Description:'Wood and stone place', + }, + + { + Premium:false, + Price:132, + Img:'../markup/Img/apartment-02.jpg', + ApartsmentType:'Apartment', + Description:'Canal View Prinsengracht', + }, + + { + Premium:true, + Price:180, + Img:'../markup/Img/apartment-03.jpg', + ApartsmentType:'Apartment', + Description:'Nice, cozy, warm big bed apartment', + }, + + { + Premium:false, + Price:80, + Img:'../markup/Img/room.jpg', + ApartsmentType:'Room', + Description:'Wood and stone place', + }]; +export default {mainPageCardInfo} ; root.render( -

Hello, World!

+
);