-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from BoostV/feature/move_variable_creation_to_…
…model Move variable creation to model, adjust styling and layout, add app bar
- Loading branch information
Showing
13 changed files
with
221 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
import { AppBar, Button, Toolbar, Typography } from '@material-ui/core' | ||
import Link from 'next/link' | ||
import useStyles from '../styles/layout.style' | ||
import Image from 'next/image' | ||
|
||
export default function Layout ( {children} ) { | ||
const classes = useStyles() | ||
|
||
export default function Layout ( {children}) { | ||
return ( | ||
<div> | ||
<Link href="/"> | ||
<a>Home</a> | ||
</Link> | ||
<span> | </span> | ||
<Link href="/experiment/123"> | ||
<a>Experiment</a> | ||
</Link> | ||
{children} | ||
</div> | ||
<> | ||
<AppBar> | ||
<Toolbar variant="dense"> | ||
<div className={classes.logo}> | ||
<Image src="/logo.png" alt="logo" width="32" height="32" /> | ||
</div> | ||
<Typography variant="h6"> | ||
BrownieBee | ||
</Typography> | ||
<div className={classes.links}> | ||
<Link href="/"> | ||
<Button className={classes.link}> | ||
<a>Home</a> | ||
</Button> | ||
</Link> | ||
</div> | ||
</Toolbar> | ||
</AppBar> | ||
<div className={classes.mainContent}> | ||
{children} | ||
</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import CategoricalVariable from './categorical-variable'; | ||
import ValueVariable from './value-variable'; | ||
import { Card, CardContent, Grid, IconButton, Radio, Typography } from "@material-ui/core" | ||
import CloseIcon from "@material-ui/icons/Close"; | ||
import { useState } from "react" | ||
import { CategoricalVariableType, ValueVariableType } from '../types/common'; | ||
import useStyles from '../styles/variable-editor.style'; | ||
|
||
type VariableEditorProps = { | ||
addValueVariable: (valueVariable: ValueVariableType) => void | ||
addCategoricalVariable: (categoricalVariable: CategoricalVariableType) => void | ||
close: () => void | ||
} | ||
|
||
export default function VariableEditor(props: VariableEditorProps) { | ||
const [radioIndex, setRadioIndex] = useState(0) | ||
const classes = useStyles() | ||
|
||
return ( | ||
<Grid container spacing={0}> | ||
<Grid item xs={6}> | ||
<Card className={classes.main}> | ||
<CardContent> | ||
<Grid container spacing={0}> | ||
|
||
<Grid item xs={11}> | ||
<Typography variant="h6" gutterBottom> | ||
Add variable | ||
</Typography> | ||
</Grid> | ||
|
||
<Grid item xs={1}> | ||
<IconButton size="small" onClick={() => props.close()}> | ||
<CloseIcon/> | ||
</IconButton> | ||
</Grid> | ||
|
||
<Grid item xs={3}> | ||
<Radio | ||
checked={radioIndex === 0} | ||
onChange={() => {setRadioIndex(0)}} | ||
/> | ||
<Typography>Value</Typography> | ||
</Grid> | ||
<Grid item xs={9}> | ||
<Radio | ||
checked={radioIndex === 1} | ||
onChange={() => {setRadioIndex(1)}} | ||
/> | ||
<Typography>Categorical</Typography> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<br/> | ||
<br/> | ||
{radioIndex === 0 && | ||
<ValueVariable onAdded={(valueVariable: ValueVariableType) => props.addValueVariable(valueVariable)} /> | ||
} | ||
{radioIndex === 1 && | ||
<CategoricalVariable onAdded={(categoricalVariable: CategoricalVariableType) => props.addCategoricalVariable(categoricalVariable)} /> | ||
} | ||
</Grid> | ||
</Grid> | ||
</CardContent> | ||
</Card> | ||
</Grid> | ||
</Grid> | ||
) | ||
} |
Oops, something went wrong.