Launch: cleanup design

This commit is contained in:
Liam Fitzgerald 2020-10-07 10:44:44 +10:00
parent 2ed5e4e077
commit 5f3e96566d
3 changed files with 10 additions and 13 deletions

View File

@ -58,7 +58,9 @@ export default function Groups(props: GroupsProps & Parameters<typeof Box>[0]) {
gridAutoRows="124px" gridAutoRows="124px"
gridTemplateColumns="repeat(auto-fit, 124px)" gridTemplateColumns="repeat(auto-fit, 124px)"
gridGap={3} gridGap={3}
p={2} px={2}
pt={2}
pb="7"
> >
{incomingGroups.map((invite) => ( {incomingGroups.map((invite) => (
<Box <Box

View File

@ -1,31 +1,26 @@
import React from 'react'; import React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import defaultApps from '~/logic/lib/default-apps'; import defaultApps from '~/logic/lib/default-apps';
const routeList = defaultApps.map((e) => {
return `/~${e}`;
});
import { Box } from "@tlon/indigo-react"; import { Box } from "@tlon/indigo-react";
export default class Tile extends React.Component { export default class Tile extends React.Component {
render() { render() {
const { bg, to, p, ...props } = this.props; const { to, href, p, ...props } = this.props;
let childElement = ( let childElement = (
<Box p={typeof p === 'undefined' ? 2 : p} bg={bg} width="100%" height="100%"> <Box p={typeof p === 'undefined' ? 2 : p} width="100%" height="100%">
{props.children} {props.children}
</Box> </Box>
); );
if (to) { if (to) {
if (routeList.indexOf(to) === -1) { childElement= (<Link to={to}>{childElement}</Link>);
childElement= (<Link to={to}>{childElement}</Link>); } else if (href) {
} else { childElement= (<a href={href}>{childElement}</a>);
childElement= (<a href={to}>{childElement}</a>);
}
} }
return ( return (
<Box <Box
border={1} border={1}

View File

@ -3,7 +3,7 @@ import _ from "lodash";
import { Invites, Invite } from "~/types"; import { Invites, Invite } from "~/types";
import { Box, Col, Icon, Row, Text } from "@tlon/indigo-react"; import { Box, Col, Icon, Row, Text } from "@tlon/indigo-react";
import GlobalApi from "~/logic/api/global"; import GlobalApi from "~/logic/api/global";
import { StatelessAsyncButton } from "../StatelessAsyncButton"; import { StatelessAsyncButton } from "~/views/components/StatelessAsyncButton";
import { cite } from "~/logic/lib/util"; import { cite } from "~/logic/lib/util";
import { resourceFromPath } from "~/logic/lib/group"; import { resourceFromPath } from "~/logic/lib/group";