Skip to content

refactor: Remove create template button from the UI #1793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions site/src/pages/TemplatesPage/TemplatesPageView.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Avatar from "@material-ui/core/Avatar"
import Box from "@material-ui/core/Box"
import Button from "@material-ui/core/Button"
import Link from "@material-ui/core/Link"
import { makeStyles } from "@material-ui/core/styles"
import Table from "@material-ui/core/Table"
import TableBody from "@material-ui/core/TableBody"
import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import AddCircleOutline from "@material-ui/icons/AddCircleOutline"
import dayjs from "dayjs"
import relativeTime from "dayjs/plugin/relativeTime"
import React from "react"
Expand All @@ -22,7 +20,6 @@ import { firstLetter } from "../../util/firstLetter"
dayjs.extend(relativeTime)

export const Language = {
createButton: "Create template",
developerCount: (ownerCount: number): string => {
return `${ownerCount} developer${ownerCount !== 1 ? "s" : ""}`
},
Expand All @@ -43,11 +40,8 @@ export interface TemplatesPageViewProps {
export const TemplatesPageView: React.FC<TemplatesPageViewProps> = (props) => {
const styles = useStyles()
return (
<Stack spacing={4}>
<Stack spacing={4} className={styles.root}>
<Margins>
<div className={styles.actions}>
{props.canCreateTemplate && <Button startIcon={<AddCircleOutline />}>{Language.createButton}</Button>}
</div>
<Table>
<TableHead>
<TableRow>
Expand Down Expand Up @@ -103,15 +97,8 @@ export const TemplatesPageView: React.FC<TemplatesPageViewProps> = (props) => {
}

const useStyles = makeStyles((theme) => ({
actions: {
root: {
marginTop: theme.spacing(3),
marginBottom: theme.spacing(3),
display: "flex",
height: theme.spacing(6),

"& button": {
marginLeft: "auto",
},
},
welcome: {
paddingTop: theme.spacing(12),
Expand Down