Skip to content

Commit 44f81b8

Browse files
authored
Merge pull request #8 from davidlpoole/hotfix/6/null-location
Set different url depending on location
2 parents 504c442 + ce15b8a commit 44f81b8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

islands/Count.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,26 @@ export default function Count(props: CountProps) {
2222

2323
getCount(props.searchTerm.searchTerm, props.searchTerm.location);
2424

25+
let url = `https://www.seek.co.nz/${
26+
props.searchTerm.searchTerm.replace(" ", "-")
27+
}-jobs/`;
28+
29+
props.searchTerm.location ? url += `in-${props.searchTerm.location}` : null;
30+
31+
console.log(url);
32+
2533
return (
2634
<div class="my-2">
2735
<a
28-
href={`https://www.seek.co.nz/${props.searchTerm.searchTerm}-jobs/in-${props.searchTerm.location}`}
36+
href={url}
2937
target="_blank"
3038
>
3139
{props.searchTerm.searchTerm} jobs
3240
{props.searchTerm.location
3341
? ` in ${props.searchTerm.location}: `
3442
: ` in NZ: `}
3543
{count.value === ""
36-
? <img class=" inline" src="/3-dots-bounce.svg" alt="loading..." />
44+
? <img class="inline" src="/3-dots-bounce.svg" alt="loading..." />
3745
: count.value || 0}
3846
</a>
3947
</div>

0 commit comments

Comments
 (0)