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"
gridTemplateColumns="repeat(auto-fit, 124px)"
gridGap={3}
p={2}
px={2}
pt={2}
pb="7"
>
{incomingGroups.map((invite) => (
<Box

View File

@ -1,30 +1,25 @@
import React from 'react';
import { Link } from 'react-router-dom';
import defaultApps from '~/logic/lib/default-apps';
const routeList = defaultApps.map((e) => {
return `/~${e}`;
});
import { Box } from "@tlon/indigo-react";
export default class Tile extends React.Component {
render() {
const { bg, to, p, ...props } = this.props;
const { to, href, p, ...props } = this.props;
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}
</Box>
);
if (to) {
if (routeList.indexOf(to) === -1) {
childElement= (<Link to={to}>{childElement}</Link>);
} else {
childElement= (<a href={to}>{childElement}</a>);
}
childElement= (<Link to={to}>{childElement}</Link>);
} else if (href) {
childElement= (<a href={href}>{childElement}</a>);
}
return (
<Box

View File

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