Skip to content

Commit

Permalink
#88 add link and fix title
Browse files Browse the repository at this point in the history
  • Loading branch information
HennecartLisa committed Aug 27, 2018
1 parent c107707 commit ce26169
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
"he": "^1.1.1",
"html-webpack-plugin": "2.29.0",
"jest": "20.0.4",
"ldfetch": "^1.0.6-alpha",
Expand Down
13 changes: 6 additions & 7 deletions src/components/SidebarBuildingDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,21 @@ export default class SidebarBuildingDetail extends Component {
}
}

titleBuild = () => {
if (this.Building.title.includes("'t")) {
return "Sporthall";
} else {
return this.Building.title;
linkOrdescription = () => {
if (this.Building.description !== "Geen beschrijving beschikbaar") {
return <a href={this.Building.description}>link</a>;
}
return <p>{this.Building.description}</p>;
}

render() {
return (
<Row>
<Col>
<h2>{this.titleBuild()}</h2>
<h2>{this.Building.title.replace(/[&\/\\#,+()$~%.'":;*?<>{}1234567890]/g, '')}</h2>
</Col>
<Col s={12}>
<a href={this.Building.description}>link to the page</a>
{this.linkOrdescription()}
</Col>
<Col s={12}>
{this.showAccessibilityInformation()}
Expand Down
11 changes: 9 additions & 2 deletions src/components/SidebarSearchResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,25 @@ export default class SidebarSearchResult extends React.Component {
}
}

linkOrdescription = () => {
if (this.Building.description !== "Geen beschrijving beschikbaar") {
return <a href={this.Building.description}>link</a>;
}
return <p>{this.Building.description}</p>;
}

render() {
return (
<div className="buildings__card">
<Row>
<Col m={12} s={12}>

<h4 className="building__name">{this.Building.title}</h4>
<h4 className="building__name">{this.Building.title.replace(/[&\/\\#,+()$~%.'":;*?<>{}1234567890]/g, '')}</h4>
</Col>


<Col m={9} s={12}>
<span className="sidebar__searchresult__description"><a hred={this.Building.description}>link to the page</a></span>
<span className="sidebar__searchresult__description">{this.linkOrdescription()}</span>
</Col>
<img className="col m3 s12 sidebar__searchresult__thumbnail" src={this.Building.src}/>
<Col m={9} s={12}>
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3354,7 +3354,7 @@ hawk@~3.1.3:
hoek "2.x.x"
sntp "1.x.x"

he@1.1.x:
he@1.1.x, he@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"

Expand Down

0 comments on commit ce26169

Please sign in to comment.