Commit 9ec117c0 by Belákovics Ádám

add template view

parent 68796a64

3.31 KB | W: | H:

9.93 KB | W: | H:

src/img_temp/ubuntu.jpg
src/img_temp/ubuntu.jpg
src/img_temp/ubuntu.jpg
src/img_temp/ubuntu.jpg
  • 2-up
  • Swipe
  • Onion skin
import React, { useState } from "react";
import { Grommet, Box, ResponsiveContext } from "grommet";
import { Grommet, Box, ResponsiveContext, Grid } from "grommet";
import theme from "../style/Theme";
import PageHeader from "./PageHeader";
import SideMenu from "./SideMenu";
......@@ -23,10 +23,23 @@ function App() {
showSideBar={showSideBar}
setShowSideBar={setShowSideBar}
/>
<Box flex justify="center" direction="row" margin="small">
<InstanceView />
<TemplateView />
</Box>
<Grid
areas={[
{ name: "instances", start: [0, 0], end: [0, 0] },
{ name: "templates", start: [1, 0], end: [1, 0] }
]}
columns={["flex", "flex"]}
rows={["flex"]}
gap="small"
margin="small"
>
<Box gridArea="instances">
<InstanceView size={size} />
</Box>
<Box gridArea="templates">
<TemplateView size={size} />
</Box>
</Grid>
</Box>
</Box>
)}
......
......@@ -18,7 +18,7 @@ const InstanceView = () => {
return (
<LoadingWrapper loading={isLoading}>
<Box direction="column" margin="small" justify="evenly" align="center">
<Box margin="small" justify="evenly" align="center">
<Heading margin="small">Virtual Machines</Heading>
<Button
icon={<ChapterAdd />}
......@@ -28,7 +28,7 @@ const InstanceView = () => {
color="darkbrand"
/>
</Box>
<Box flex direction="row" wrap="true" justify="evenly">
<Box flex direction="row" wrap justify="evenly">
{data.map(e => (
<Card
background="brand"
......
......@@ -4,7 +4,9 @@ import { Spinning } from "grommet-controls";
const LoadingWrapper = ({ loading, ...props }) => {
return loading ? (
<Spinning kind="three-bounce" color="brand" size="large" />
<Box margin="small" justify="center" align="center" flex>
<Spinning kind="three-bounce" color="brand" size="large" />
</Box>
) : (
<Box {...props} />
);
......
......@@ -37,7 +37,7 @@ const TemplateView = () => {
return (
<LoadingWrapper loading={isLoading}>
<Box direction="column" margin="small" justify="evenly" align="center">
<Box margin="small" justify="evenly" align="center">
<Heading margin="small">Templates</Heading>
<Button
icon={<ChapterAdd />}
......@@ -47,24 +47,20 @@ const TemplateView = () => {
color="darkbrand"
/>
</Box>
<Box direction="row" wrap justify="evenly">
<Box flex direction="row" wrap justify="evenly">
{mockData.map(e => (
<Box margin="small">
<Stack>
<Stack anchor="bottom-left">
{e.os === "windows" ? (
<Image
src={WindowsImage}
fit="contain"
style={{ height: "250px" }}
/>
<Box>
<Image src={WindowsImage} style={{ height: "250px" }} />
</Box>
) : (
<Image
src={UbuntuImage}
fit="contain"
style={{ height: "250px" }}
/>
<Box>
<Image src={UbuntuImage} style={{ height: "250px" }} />
</Box>
)}
<Box background="#666666CC">
<Box background="#666666CC" style={{ width: "250px" }}>
<Text margin="small">{e.name}</Text>
</Box>
</Stack>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment