Skip to content

Commit

Permalink
working on frontend stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-mcginty committed Jun 9, 2020
1 parent 2c53beb commit 51bbcec
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 36 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/scala_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ dependencies {
mainClassName = 'org.bringo.server.Main'

task compileJs(type: Exec) {
inputs.files(fileTree("frontend"), "bsconfig.json", "webpack.config.js", "package.json")
outputs.dir "src/main/resources/public/dist"
commandLine "npm", "run", "build"
}

task installJs(type: Exec) {
inputs.files "bsconfig.json", "webpack.config.js", "package.json"
outputs.dir "node_modules"
commandLine "npm", "install"
}

compileJs.dependsOn installJs
compileJava.dependsOn compileJs
2 changes: 1 addition & 1 deletion frontend/Main.re
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Js.Console.log("yo");
ReactDOMRe.renderToElementWithId(<MainPage />, "main-page-app");
24 changes: 0 additions & 24 deletions frontend/components/ErrorPage.re

This file was deleted.

45 changes: 45 additions & 0 deletions frontend/components/errorPage/ErrorPage.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[@react.component]
let make = () =>
<MaterialUi_WithStyles
classes=[
{
name: "errorLogoContainer",
styles: ReactDOMRe.Style.make(~textAlign="right", ()),
},
{
name: "errorLogo",
styles:
ReactDOMRe.Style.make(~maxHeight="75px", ~maxWidth="60px", ()),
},
...SharedClasses.classes,
]
render={classes =>
MaterialUi.(
<section>
<Container maxWidth=`Md>
<Paper className=classes##pageTopMargin>
<Grid container=true spacing=V4>
<Grid item=true xs=`V4 className=classes##errorLogoContainer>
<img src="/icons/dead.svg" className=classes##errorLogo />
</Grid>
<Grid item=true xs=`V8>
<Typography variant=`H3>
{React.string("Oops!")}
</Typography>
</Grid>
<Grid item=true xs=`V2 />
<Grid item=true xs=`V8>
<Typography variant=`Body1>
{React.string(
"It looks like something went wrong! Please wait a few minutes and try again.",
)}
</Typography>
</Grid>
<Grid item=true xs=`V2 />
</Grid>
</Paper>
</Container>
</section>
)
}
/>;
12 changes: 1 addition & 11 deletions frontend/components/loginPage/LoginPage.re
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
[@react.component]
let make = () =>
<MaterialUi_WithStyles
classes=[
{
name: "buttonMargin",
styles:
ReactDOMRe.Style.make(~marginLeft="6px", ~marginRight="6px", ()),
},
{
name: "pageTopMargin",
styles: ReactDOMRe.Style.make(~marginTop="7vh", ()),
},
]
classes=SharedClasses.classes
render={classes =>
MaterialUi.(
<section>
Expand Down
8 changes: 8 additions & 0 deletions frontend/components/mainPage/MainPage.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[@react.component]
let make = () =>
<MaterialUi_WithStyles
classes=SharedClasses.classes
render={classes =>
MaterialUi.(<section> <Container maxWidth=`Md /> </section>)
}
/>;
15 changes: 15 additions & 0 deletions frontend/styles/SharedClasses.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type style = {
name: String.t,
styles: ReactDOMRe.Style.t,
};

let classes: list(MaterialUi_WithStyles.style) = [
{
name: "buttonMargin",
styles: ReactDOMRe.Style.make(~marginLeft="6px", ~marginRight="6px", ()),
},
{
name: "pageTopMargin",
styles: ReactDOMRe.Style.make(~marginTop="7vh", ()),
},
];
1 change: 1 addition & 0 deletions src/main/resources/public/icons/dead.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 51bbcec

Please sign in to comment.