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