Commit 0a6a168d authored by roadscape's avatar roadscape
Browse files

Styling, leverage UserNames component

parent 6a381cd1
......@@ -7,6 +7,7 @@ import SubscribeButton from 'app/components/elements/SubscribeButton';
import { Link } from 'react-router';
import PostsIndexLayout from 'app/components/pages/PostsIndexLayout';
import LoadingIndicator from 'app/components/elements/LoadingIndicator';
import UserNames from 'app/components/elements/UserNames';
export default class CommunitiesIndex extends React.Component {
componentWillMount = () => {
......@@ -40,25 +41,16 @@ export default class CommunitiesIndex extends React.Component {
);
const communityAdmins = admins => {
return admins.map((name, idx, src) => {
const account = `@${name}`;
if (src.length === 1) {
return (
<span
key={`${name}__admin`}
style={{ fontSize: '80%' }}
>
<Link to={`/${account}`}>{name}</Link>
</span>
);
} else {
return (
<div key={`${name}__admin`} style={{ fontSize: '80%' }}>
<Link to={`/${account}`}>{name}</Link>
</div>
);
}
});
if (!admins || admins.length === 0) return;
return (
<div>
{admins.length === 1
? `${tt('g.administrator')}: `
: `${tt('g.administrators')}: `}
<UserNames names={admins} />
</div>
);
};
const row = comm => {
......@@ -66,7 +58,9 @@ export default class CommunitiesIndex extends React.Component {
return (
<tr key={comm.name}>
<th>
<Link to={`/trending/${comm.name}`}>{comm.title}</Link>
<Link className="title" to={`/trending/${comm.name}`}>
{comm.title}
</Link>
{role(comm)}
<br />
{comm.about}
......@@ -74,10 +68,6 @@ export default class CommunitiesIndex extends React.Component {
{comm.subscribers} subscribers &bull;{' '}
{comm.num_authors} posters &bull; {comm.num_pending}{' '}
posts
<br />
{comm.admins.length === 1
? `${tt('g.administrator')}: `
: `${tt('g.administrators')}:`}
{admins}
</small>
</th>
......
......@@ -3,7 +3,7 @@
table tbody {background: transparent;}
table tbody tr {background: transparent !important;}
table th {text-align: left; font-weight: normal}
table th a {font-weight: 400; font-size: 1.3em;}
table th a.title {font-weight: 400; font-size: 1.3em;}
table td {vertical-align: middle; color: #666; text-align: center;}
table small {color: #999; display: block;}
table .button {margin: 0}
......
{
"g": {
"administrator": "administrator",
"administrators": "administrators",
"administrator": "admin",
"administrators": "admins",
"age": "age",
"amount": "Amount",
"and": "and",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment