groups: default to coloured tile if unknown app

This commit is contained in:
Matilde Park 2020-04-01 15:46:59 -04:00
parent e1af036f1c
commit e70643b44d

View File

@ -80,15 +80,23 @@ export class GroupDetail extends Component {
let app = channel["app-name"] || "Unknown";
let channelPath = channel["app-path"];
let link = `/~${app}/join${channelPath}`
app = app.charAt(0).toUpperCase() + app.slice(1)
app = app.charAt(0).toUpperCase() + app.slice(1);
return (
<li key={channelPath} className="f9 list flex pv1 w-100">
<img
let tile = (app === "Unknown")
? <div className="dib ba pa1" style={{
backgroundColor: `#${color}`,
borderColor: `#${color}`,
height: 24,
width: 24}}/>
: <img
src={`/~groups/img/${app}.png`}
className="dib ba pa1"
style={{ borderColor: `#${color}`, height: 24, width: 24 }}
/>
return (
<li key={channelPath} className="f9 list flex pv1 w-100">
{tile}
<div className="flex flex-column flex-auto">
<p className="f9 inter ml2 w-100">{title}</p>
<p className="f9 inter ml2 w-100" style={{ marginTop: "0.35rem" }}>