-
Notifications
You must be signed in to change notification settings - Fork 1
/
CoffeeProfile.tsx
58 lines (54 loc) · 1.57 KB
/
CoffeeProfile.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { ICoffeeProfile } from 'cr-common';
import React from 'react';
import styled from 'styled-components';
const ProfileContainer = styled.div``;
const ItalicizeText = styled.span`
font-style: italic;
`;
const AdditionalInfoContainer = styled.div`
display: flex;
`;
const CoffeeProfile = (coffee: ICoffeeProfile) => {
return (
<ProfileContainer>
{coffee.url && (
<a href={coffee.url} target="_blank">
<h2>{coffee.coffeeName}</h2>
</a>
)}
{!coffee.url && <h2>{coffee.coffeeName}</h2>}
{/*
@createIssue Coffee Cup Rating Viewer
@body Out of score from 1 - 100 fill in an coffee cup so the more full, the better
*/}
Placeholder could be a coffee colored to match the percentage of (rating / 5)
<AdditionalInfoContainer>
<div>
<img src="https://via.placeholder.com/150" />
</div>
<div>
<span>
<ItalicizeText>Roaster</ItalicizeText> <strong>{coffee.roasterName}</strong>
</span>
<br />
{coffee.region && (
<span>
<ItalicizeText>Region</ItalicizeText> <strong>{coffee.region}</strong>
</span>
)}
{coffee.notes && (
<button
onClick={() => {
// this is bad for performance
window.alert(coffee.notes);
}}
>
More Information
</button>
)}
</div>
</AdditionalInfoContainer>
</ProfileContainer>
);
};
export default CoffeeProfile;