Skip to content

Commit 8d55ea2

Browse files
committed
Landing page
1 parent 42ac9a5 commit 8d55ea2

File tree

2 files changed

+56
-46
lines changed

2 files changed

+56
-46
lines changed

frontend/src/App.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,18 @@ function App() {
125125
.then(response => response.json())
126126
.then((data) => {
127127
if (data["redirect"] !== undefined && data["redirect"] !== null) {
128+
/*
129+
// In Dashboard.js we do redirect, but not here
130+
// @todo clean-up some duplication in the react code
128131
if (!window.location.href.endsWith(data.redirect)) {
129132
window.location.href = data.redirect;
130133
}
134+
*/
131135
}
132136
else {
133137
setLogin(true);
134138
setUser(data["user_data"]);
135139
data["sandbox_info"]["pr_title"] && setPrTitle(data["sandbox_info"]["pr_title"]);
136-
137140
}
138141
})
139142
}, []);
@@ -238,7 +241,7 @@ function App() {
238241
<div style={{ background: '#D9D9D9', padding: '5em', marginTop: '5em' }}>
239242
<Typography variant='h5' style={{ fontWeight: 'bold' }}>Validate your IFC files against the standard</Typography>
240243
<Typography style={{ margin: '1em 0 2em 0' }}>A free, online platform by buildingSMART for checking IFC file conformity against STEP syntax, IFC schema, and normative specification rules.</Typography>
241-
<Link sx={{fontWeight: 700, textDecoration: 'none', color: '#000', '&:hover': {borderBottom: 'dotted 1px black', color: '#444'}}} href='/dashboard'>Start validating →</Link>
244+
<Link sx={{fontWeight: 700, textDecoration: 'none', color: '#000', '&:hover': {borderBottom: 'dotted 1px black', color: '#333'}}} href='/dashboard'>Start validating →</Link>
242245
</div>
243246

244247
<Typography variant='h6'>How it checks</Typography>

frontend/src/ResponsiveAppBar.js

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -75,53 +75,60 @@ function ResponsiveAppBar({ user }) {
7575
<Box sx={{ flexGrow: 1 }} />
7676

7777
{user &&
78-
<>
79-
<Box sx={{ flexGrow: 0 }}>
80-
<Tooltip title="Navigation">
81-
<IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
82-
<Avatar
83-
sx={{
84-
bgcolor: "grey",
85-
"&:hover": {
86-
border: "2px solid darkgrey",
87-
},
88-
}}
89-
>
90-
{user ? (Array.from(user["given_name"])[0] + Array.from(user["family_name"])[0]) : ""}
91-
</Avatar>
92-
</IconButton>
93-
</Tooltip>
94-
<Menu
95-
sx={{ mt: '45px' }}
96-
id="menu-appbar"
97-
anchorEl={anchorElUser}
98-
anchorOrigin={{
99-
vertical: 'top',
100-
horizontal: 'right',
101-
}}
102-
keepMounted
103-
transformOrigin={{
104-
vertical: 'top',
105-
horizontal: 'right',
106-
}}
107-
open={Boolean(anchorElUser)}
108-
onClose={handleCloseUserMenu}
109-
>
110-
{pages.map((p) => (
111-
<MenuItem key={p.label} onClick={handleCloseUserMenu}>
112-
<Link color="grey" href={p.href} underline="none">
113-
<Typography textAlign="center">{p.label}</Typography>
114-
</Link>
115-
</MenuItem>
116-
))}
117-
</Menu>
118-
</Box>
119-
</>
78+
<Box sx={{ flexGrow: 0 }}>
79+
<Tooltip title="Navigation">
80+
<IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
81+
<Avatar
82+
sx={{
83+
bgcolor: "grey",
84+
"&:hover": {
85+
border: "2px solid darkgrey",
86+
},
87+
}}
88+
>
89+
{user ? (Array.from(user["given_name"])[0] + Array.from(user["family_name"])[0]) : ""}
90+
</Avatar>
91+
</IconButton>
92+
</Tooltip>
93+
<Menu
94+
sx={{ mt: '45px' }}
95+
id="menu-appbar"
96+
anchorEl={anchorElUser}
97+
anchorOrigin={{
98+
vertical: 'top',
99+
horizontal: 'right',
100+
}}
101+
keepMounted
102+
transformOrigin={{
103+
vertical: 'top',
104+
horizontal: 'right',
105+
}}
106+
open={Boolean(anchorElUser)}
107+
onClose={handleCloseUserMenu}
108+
>
109+
{pages.map((p) => (
110+
<MenuItem key={p.label} onClick={handleCloseUserMenu}>
111+
<Link color="grey" href={p.href} underline="none">
112+
<Typography textAlign="center">{p.label}</Typography>
113+
</Link>
114+
</MenuItem>
115+
))}
116+
</Menu>
117+
</Box>
120118
}
121119

122120
{!user &&
123-
<Box sx={{ flexGrow: 1 }}>
124-
<Link href="/login">Sign In</Link>
121+
<Box sx={{ flexGrow: 0 }}>
122+
<Link sx={{
123+
textDecoration: 'none',
124+
color: 'black',
125+
display: 'inline-block',
126+
border: 'solid 1px black',
127+
padding: '0.5em 1em',
128+
borderRadius: '0.5em',
129+
fontWeight: 'bold',
130+
'&:hover': {textDecoration: 'underline', color: '#333'}
131+
}} href="/login">Sign In</Link>
125132
</Box>
126133
}
127134
</Toolbar>

0 commit comments

Comments
 (0)