Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion front-empathy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"framer": "^1"
},
"devDependencies": {
"framer": "^1.1.7"
"framer": "^1.1.7",
"typescript": "^3.9.6"
},
"framer": {
"displayName": ""
Expand Down
4 changes: 2 additions & 2 deletions front-empathy/src/api/artist/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { requestGET } from "../index";

export const loadArtist = (artistId = 1) => {
return requestGET(`/artist/${ artistId }`);
return requestGET(`/artist/${artistId}`);
};

export const loadArtists = (page = 1, pageUnit = 5) => {
return requestGET(`/artist?page=${ page }&page_unit=${ pageUnit }`);
return requestGET(`/artist?page=${page}&page_unit=${pageUnit}`);
};
2 changes: 1 addition & 1 deletion front-empathy/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const SERVER_URL = process.env.REACT_APP_SERVER_API;

export const requestGET = (url: any) => {
export const requestGET = (url: string) => {
return fetch(SERVER_URL + url)
.then(res => res.json())
.catch(err => console.error(err));
Expand Down
24 changes: 12 additions & 12 deletions front-empathy/src/components/CircleItemSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SliderWrapper = styled(Slider)`
`;

const ArrowWrapper = styled.div`
visibility: ${props => props.show ? 'visible' : 'hidden'};
visibility: ${ props => props.show ? 'visible' : 'hidden' };
width: 40px;
height: 100%;
display: flex;
Expand All @@ -58,7 +58,7 @@ const CircleItemSliderWrapper = styled.div`

.slide {
position: relative;
${ArrowWrapper} {
${ ArrowWrapper } {
&.left {
position: absolute;
top: 0;
Expand Down Expand Up @@ -150,19 +150,19 @@ const CircleItemSlider = ({ slickItems }) => {
<CircleItemSliderWrapper>
<h4 className="title">Upcoming event's location</h4>
<div className="slide">
<SliderWrapper ref={sliderEl} {...settings}>
{slickItems.map(({ id, title, img, date }) => (
<div className="item" key={id}>
<div className="circle" style={{ backgroundImage: `url(${img})` }}/>
<p className="title">{title}</p>
<SliderWrapper ref={ sliderEl } { ...settings }>
{ slickItems.map(({ id, title, img, date }) => (
<div className="item" key={ id }>
<div className="circle" style={ { backgroundImage: `url(${ img })` } }/>
<p className="title">{ title }</p>
</div>
))}
)) }
</SliderWrapper>
<ArrowWrapper className="left" onClick={onLeftArrowClick} show={showArrow.left}>
<ArrowRight width={20} height={20} color={"white"} style={{ transform: 'rotate(180deg)' }}/>
<ArrowWrapper className="left" onClick={ onLeftArrowClick } show={ showArrow.left }>
<ArrowRight width={ 20 } height={ 20 } color={ "white" } style={ { transform: 'rotate(180deg)' } }/>
</ArrowWrapper>
<ArrowWrapper className="right" onClick={onRightArrowClick} show={showArrow.right}>
<ArrowRight width={20} height={20} color={"white"}/>
<ArrowWrapper className="right" onClick={ onRightArrowClick } show={ showArrow.right }>
<ArrowRight width={ 20 } height={ 20 } color={ "white" }/>
</ArrowWrapper>
</div>
</CircleItemSliderWrapper>
Expand Down
19 changes: 10 additions & 9 deletions front-empathy/src/pages/LocationDetail/LocationDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const fetchData = (url) => {
};

export const getLocationId = (locationId) => {
return fetchData(`http://localhost:5000/locationDetail/${locationId}`);
return fetchData(`http://localhost:5000/locationDetail/${ locationId }`);
};

const HeroSection = styled.div`
Expand Down Expand Up @@ -181,8 +181,8 @@ const LocationDetail = ({
<p>{location.name}</p>
</Header>
<Info>
<p>{location.name}</p>
<p>{location.name}</p>
<p>{ location.name }</p>
<p>{ location.name }</p>
</Info>
</HeroSection>

Expand All @@ -193,27 +193,28 @@ const LocationDetail = ({
<InfoSection>
<div>
<span>Address</span>
<span>{location.address}</span>
<span>{ location.address }</span>
</div>
<div>
<span>ProgrammeType</span>
<span>{location.programmeType}</span>
<span>{ location.programmeType }</span>
</div>
<div>
<span>Location Fee</span>
<span>{location.fee}</span>
<span>{ location.fee }</span>
</div>
<div>
<span>Opening Hour</span>
<span>{location.openHour}</span>
<span>{ location.openHour }</span>
</div>
<div>
<span>Istagram</span>
<span>{location.instaId}</span>
<span>{ location.instaId }</span>
</div>
</InfoSection>

<CtaButtonContainer>
<CtaButton label={ `locationDetail` } onClick={ () => shareLink(`locationDetail`, `locationDetail`) }/>
<CtaButton label={`locationDetail`} onClick={() => shareLink(`locationDetail`, `locationDetail`)} />
</CtaButtonContainer>

Expand All @@ -240,7 +241,7 @@ const LocationDetail = ({
</EventGroup>
</div>
</>
)}
) }
</>
);
};
Expand Down
10 changes: 9 additions & 1 deletion front-empathy/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"typeRoots": [
"../../node_modules/@types",
"../../typings"
],
"types": [
"node"
],
"lib": [
"dom",
"dom.iterable",
Expand All @@ -20,6 +27,7 @@
"jsx": "react"
},
"include": [
"src"
"src",
"**/*.d.ts"
]
}
5 changes: 5 additions & 0 deletions front-empathy/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"no-reference": false
}
}
15 changes: 15 additions & 0 deletions front-empathy/typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference path='./Location.d.ts' />

export declare global {
interface Window {
}

interface StringKeyDict<T> {
[key: string]: T;
}

interface NumberKeyDict<T> {
[key: number]: T;
}

}
18 changes: 18 additions & 0 deletions front-empathy/typings/location.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export declare global {
interface LocationDetail {
id: string,
name: string;
image: string;
description: string;
address: string;
programmeType: string;
fee: string
openHour: string;
instaId: string;
eventGroup: EventGroup[]
}

interface EventGroup {
date: string;
}
}