mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
Remove create template button from the UI (#1793)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
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"
|
||||
@@ -8,7 +7,6 @@ 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"
|
||||
@@ -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" : ""}`
|
||||
},
|
||||
@@ -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>
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user