css updates

This commit is contained in:
Collin M. Barrett 2019-08-07 16:09:44 -05:00
parent 7de985ed63
commit ee5ac67110
5 changed files with 16 additions and 10 deletions

View file

@ -1,4 +1,4 @@
td > * {
.nogrow > * {
/* limit table cells from wrapping more than 2 lines */
/* https://stackoverflow.com/a/13924997/2343739 */
/* https://stackoverflow.com/a/22042054/2343739 */

View file

@ -2,7 +2,7 @@ import { Table } from 'antd';
import React from 'react';
import { Description, SubscribeButton, TagCloud } from '../../shared';
import { nameof } from '../../utils';
import './AllListsTable.css';
import styles from './AllListsTable.module.css';
import { List } from './List';
import { Tag } from './Tag';
@ -78,30 +78,36 @@ export class AllListsTable extends React.Component<{}, State> {
sorter={(a, b) => a.name.localeCompare(b.name)}
defaultSortOrder={"ascend"}
width={200}
className={styles.nogrow}
fixed="left"
render={(text: string) => <div>{text}</div>} />
<Table.Column<List>
title="Description"
dataIndex={nameof<List>("description")}
className={styles.nogrow}
render={(text: string, record: List) =>
<Description desriptionSourceUrl={record.descriptionSourceUrl} desription={text} />} />
<Table.Column<List>
title="Software"
dataIndex={nameof<List>("syntaxId")}
className={styles.nogrow}
render={(text: string) => <div>{text}</div>} />
<Table.Column<List>
title="Languages"
dataIndex={nameof<List>("languageIds")}
className={styles.nogrow}
render={(text: string) => <div>{text}</div>} />
<Table.Column<List>
title="Tags"
dataIndex={nameof<List>("tagIds")}
width={200}
width={275}
className={styles.nogrow}
render={(tagIds: number[]) =>
tagIds ? <TagCloud tags={this.state.tags.filter((t: Tag) => tagIds.includes(t.id))} /> : null} />
<Table.Column<List> title="Subscribe"
dataIndex={nameof<List>("viewUrl")}
width={123}
className={styles.nogrow}
fixed={this.state.isNarrowWindow ? undefined : "right"}
render={(text: string, record: List, index: number) =>
<SubscribeButton key={index} viewUrl={text} viewUrlMirrors={record.viewUrlMirrors} name={record.name} />} />

View file

@ -1,10 +1,9 @@
/* fix font color on dropdown buttons */
.ant-dropdown-menu-item > a,
.ant-dropdown-menu-submenu-title > a {
color: #fff;
.sub {
color: #fff !important;
}
/* make non-dropdown button equivalent width to dropdown */
.ant-btn.single {
.single {
width: 106.81px;
}

View file

@ -1,7 +1,7 @@
import { Button, Dropdown, Menu } from 'antd';
import { ButtonProps, ButtonType } from "antd/lib/button";
import React from 'react';
import './SubscribeButton.css';
import styles from './SubscribeButton.module.css';
//TODO: import DropdownButtonType from antd rather than redefining if they export the type
//import { DropdownButtonType } from "antd/lib/dropdown";
@ -17,7 +17,7 @@ export const SubscribeButton = (props: Props): JSX.Element =>
(props.viewUrlMirrors && props.viewUrlMirrors.length > 0)
? <SubscribeButtonDropdown {...props} />
: <div>
<Button className={"single"} size="small" {...buildButtonProps(props.name, props.viewUrl)}>Subscribe</Button>
<Button className={styles.single} size="small" {...buildButtonProps(props.name, props.viewUrl)}>Subscribe</Button>
</div>;
const SubscribeButtonDropdown = (props: Props): JSX.Element => {
@ -30,7 +30,7 @@ const SubscribeButtonDropdown = (props: Props): JSX.Element => {
<Menu>
{props.viewUrlMirrors.map((viewUrlMirror: string, i: number) =>
<Menu.Item key={i}>
<Button size="small" {...buildButtonProps(props.name, viewUrlMirror)}>{`Mirror ${i + 1}`}</Button>
<Button className={styles.sub} size="small" {...buildButtonProps(props.name, viewUrlMirror)}>{`Mirror ${i + 1}`}</Button>
</Menu.Item>)}
</Menu>
}>

View file

@ -1,3 +1,4 @@
/* allow for 2nd row's tags' bottom border to not be chopped in AllListsTable */
.grow {
max-height: none !important;
}